From 82161d3ba23ebbfeceae42acc5b9e7df80fa495e Mon Sep 17 00:00:00 2001 From: novalisdenahi Date: Tue, 10 Jun 2025 23:29:03 +0200 Subject: [PATCH 1/2] Regenerate --- .openapi-generator/FILES | 66 +- README.md | 35 +- api/openapi.yaml | 11218 ---------------- build.gradle | 2 +- docs/AccessType.md | 15 - docs/AddOrUpdateIntegrationLinkModel.md | 14 - docs/AddOrUpdateJiraIntegrationLinkModel.md | 16 - docs/AuditLogItemModel.md | 24 - docs/AuditLogType.md | 187 - docs/AuditLogsApi.md | 246 - docs/CodeReferenceModel.md | 20 - docs/CodeReferenceRequest.md | 20 - docs/CodeReferencesApi.md | 222 - docs/ComparisonValueListModel.md | 14 - docs/ComparisonValueModel.md | 16 - docs/ConditionModel.md | 15 - docs/ConfigModel.md | 20 - docs/ConfigSettingFormulaModel.md | 23 - docs/ConfigSettingFormulasModel.md | 17 - docs/ConfigSettingValueModel.md | 21 - docs/ConfigSettingValuesModel.md | 17 - docs/ConfigsApi.md | 371 - docs/ConnectRequest.md | 14 - docs/CreateConfigRequest.md | 16 - docs/CreateEnvironmentModel.md | 16 - docs/CreateIntegrationModel.md | 17 - docs/CreateOrUpdateEnvironmentAccessModel.md | 14 - docs/CreatePermissionGroupRequest.md | 37 - docs/CreateProductRequest.md | 15 - docs/CreateSegmentModel.md | 17 - docs/CreateSettingInitialValues.md | 19 - docs/CreateTagModel.md | 14 - docs/DeleteIntegrationLinkModel.md | 13 - docs/DeleteRepositoryReportsRequest.md | 16 - docs/EnvironmentAccessModel.md | 19 - docs/EnvironmentAccessType.md | 15 - docs/EnvironmentModel.md | 20 - docs/EnvironmentsApi.md | 373 - docs/EvaluationVersion.md | 13 - docs/FeatureFlagLimitations.md | 20 - docs/FeatureFlagSettingValuesApi.md | 391 - .../FeatureFlagSettingValuesUsingSdkKeyApi.md | 239 - ...eatureFlagSettingValuesUsingSdkKeyV2Api.md | 239 - docs/FeatureFlagSettingValuesV2Api.md | 391 - docs/FeatureFlagsSettingsApi.md | 445 - docs/FlagReference.md | 14 - docs/InitialValue.md | 14 - docs/IntegrationLinkDetail.md | 18 - docs/IntegrationLinkDetailsModel.md | 14 - docs/IntegrationLinkModel.md | 16 - docs/IntegrationLinkType.md | 15 - docs/IntegrationLinksApi.md | 383 - docs/IntegrationModel.md | 20 - docs/IntegrationType.md | 21 - docs/IntegrationsApi.md | 371 - docs/IntegrationsModel.md | 13 - docs/InvitationModel.md | 17 - docs/InviteMembersRequest.md | 14 - docs/JsonPatchOperation.md | 16 - docs/KeyGenerationMode.md | 19 - docs/MeApi.md | 74 - docs/MeModel.md | 14 - docs/MemberModel.md | 17 - docs/MembersApi.md | 733 - docs/ModifyIntegrationRequest.md | 16 - docs/OperationType.md | 23 - docs/OrganizationAdminModel.md | 17 - docs/OrganizationInvitationModel.md | 20 - docs/OrganizationMemberModel.md | 18 - docs/OrganizationMembersModel.md | 15 - docs/OrganizationModel.md | 15 - docs/OrganizationPermissionGroupModel.md | 15 - docs/OrganizationPermissionModel.md | 15 - docs/OrganizationProductModel.md | 15 - docs/OrganizationsApi.md | 74 - docs/PercentageOptionModel.md | 14 - docs/PermissionGroupModel.md | 39 - docs/PermissionGroupsApi.md | 371 - docs/PreferencesModel.md | 17 - docs/PrerequisiteComparator.md | 13 - docs/PrerequisiteFlagConditionModel.md | 16 - docs/ProductModel.md | 19 - docs/ProductsApi.md | 511 - docs/ReasonRequiredEnvironmentModel.md | 15 - docs/ReferenceLine.md | 15 - docs/ReferenceLines.md | 17 - docs/ReplaceSettingModel.md | 16 - docs/RolloutPercentageItemModel.md | 14 - docs/RolloutRuleComparator.md | 45 - docs/RolloutRuleModel.md | 18 - docs/SdkKeysApi.md | 82 - docs/SdkKeysModel.md | 14 - docs/SegmentComparator.md | 13 - docs/SegmentConditionModel.md | 15 - docs/SegmentListModel.md | 23 - docs/SegmentModel.md | 25 - docs/SegmentsApi.md | 371 - docs/SettingDataModel.md | 23 - docs/SettingFormulaModel.md | 27 - docs/SettingModel.md | 23 - docs/SettingTagModel.md | 16 - docs/SettingType.md | 17 - docs/SettingValueModel.md | 25 - docs/TagModel.md | 16 - docs/TagsApi.md | 441 - docs/TargetingRuleModel.md | 15 - docs/UpdateConfigRequest.md | 15 - docs/UpdateEnvironmentModel.md | 16 - docs/UpdateEvaluationFormulaModel.md | 15 - docs/UpdateEvaluationFormulaWithIdModel.md | 16 - docs/UpdateEvaluationFormulasModel.md | 13 - docs/UpdateMemberPermissionsRequest.md | 16 - docs/UpdatePermissionGroupRequest.md | 37 - docs/UpdatePreferencesRequest.md | 17 - docs/UpdateProductRequest.md | 15 - docs/UpdateReasonRequiredEnvironmentModel.md | 14 - docs/UpdateSegmentModel.md | 17 - docs/UpdateSettingValueModel.md | 15 - docs/UpdateSettingValueWithSettingIdModel.md | 16 - docs/UpdateSettingValuesWithIdModel.md | 13 - docs/UpdateTagModel.md | 14 - docs/UserComparator.md | 81 - docs/UserConditionModel.md | 16 - docs/UserModel.md | 16 - docs/ValueModel.md | 17 - docs/WebHookHttpMethod.md | 13 - docs/WebHookRequest.md | 16 - docs/WebhookConfig.md | 15 - docs/WebhookEnvironment.md | 15 - docs/WebhookHeaderModel.md | 15 - docs/WebhookModel.md | 19 - docs/WebhookSigningKeysModel.md | 14 - docs/WebhooksApi.md | 517 - src/main/AndroidManifest.xml | 3 - .../publicapi/java/client/ApiCallback.java | 62 - .../publicapi/java/client/ApiClient.java | 1566 --- .../publicapi/java/client/ApiException.java | 167 - .../publicapi/java/client/ApiResponse.java | 76 - .../publicapi/java/client/Configuration.java | 41 - .../java/client/GzipRequestInterceptor.java | 85 - .../configcat/publicapi/java/client/JSON.java | 495 - .../configcat/publicapi/java/client/Pair.java | 57 - .../java/client/ProgressRequestBody.java | 73 - .../java/client/ProgressResponseBody.java | 70 - .../java/client/ServerConfiguration.java | 59 - .../publicapi/java/client/ServerVariable.java | 24 - .../publicapi/java/client/StringUtil.java | 83 - .../java/client/api/AuditLogsApi.java | 572 - .../java/client/api/CodeReferencesApi.java | 476 - .../publicapi/java/client/api/ConfigsApi.java | 772 -- .../java/client/api/EnvironmentsApi.java | 780 -- .../api/FeatureFlagSettingValuesApi.java | 869 -- ...eatureFlagSettingValuesUsingSdkKeyApi.java | 550 - ...tureFlagSettingValuesUsingSdkKeyV2Api.java | 550 - .../api/FeatureFlagSettingValuesV2Api.java | 869 -- .../client/api/FeatureFlagsSettingsApi.java | 920 -- .../java/client/api/IntegrationLinksApi.java | 845 -- .../java/client/api/IntegrationsApi.java | 773 -- .../publicapi/java/client/api/MeApi.java | 192 - .../publicapi/java/client/api/MembersApi.java | 1470 -- .../java/client/api/OrganizationsApi.java | 192 - .../java/client/api/PermissionGroupsApi.java | 772 -- .../java/client/api/ProductsApi.java | 1038 -- .../publicapi/java/client/api/SdkKeysApi.java | 221 - .../java/client/api/SegmentsApi.java | 773 -- .../publicapi/java/client/api/TagsApi.java | 900 -- .../java/client/api/WebhooksApi.java | 1057 -- .../java/client/auth/ApiKeyAuth.java | 80 - .../java/client/auth/Authentication.java | 36 - .../java/client/auth/HttpBasicAuth.java | 55 - .../java/client/auth/HttpBearerAuth.java | 75 - .../client/model/AbstractOpenApiSchema.java | 146 - .../java/client/model/AccessType.java | 80 - .../AddOrUpdateIntegrationLinkModel.java | 328 - .../AddOrUpdateJiraIntegrationLinkModel.java | 395 - .../java/client/model/AuditLogItemModel.java | 613 - .../java/client/model/AuditLogType.java | 252 - .../java/client/model/CodeReferenceModel.java | 523 - .../client/model/CodeReferenceRequest.java | 544 - .../model/ComparisonValueListModel.java | 336 - .../client/model/ComparisonValueModel.java | 376 - .../java/client/model/ConditionModel.java | 351 - .../java/client/model/ConfigModel.java | 475 - .../model/ConfigSettingFormulaModel.java | 663 - .../model/ConfigSettingFormulasModel.java | 440 - .../client/model/ConfigSettingValueModel.java | 610 - .../model/ConfigSettingValuesModel.java | 440 - .../java/client/model/ConnectRequest.java | 325 - .../client/model/CreateConfigRequest.java | 393 - .../client/model/CreateEnvironmentModel.java | 391 - .../client/model/CreateIntegrationModel.java | 447 - .../CreateOrUpdateEnvironmentAccessModel.java | 319 - .../model/CreatePermissionGroupRequest.java | 966 -- .../client/model/CreateProductRequest.java | 362 - .../java/client/model/CreateSegmentModel.java | 426 - .../model/CreateSettingInitialValues.java | 511 - .../java/client/model/CreateTagModel.java | 336 - .../model/DeleteIntegrationLinkModel.java | 284 - .../model/DeleteRepositoryReportsRequest.java | 393 - .../client/model/EnvironmentAccessModel.java | 470 - .../client/model/EnvironmentAccessType.java | 80 - .../java/client/model/EnvironmentModel.java | 470 - .../java/client/model/EvaluationVersion.java | 78 - .../client/model/FeatureFlagLimitations.java | 440 - .../java/client/model/FlagReference.java | 340 - .../java/client/model/InitialValue.java | 326 - .../client/model/IntegrationLinkDetail.java | 449 - .../model/IntegrationLinkDetailsModel.java | 338 - .../client/model/IntegrationLinkModel.java | 388 - .../client/model/IntegrationLinkType.java | 80 - .../java/client/model/IntegrationModel.java | 505 - .../java/client/model/IntegrationType.java | 86 - .../java/client/model/IntegrationsModel.java | 321 - .../java/client/model/InvitationModel.java | 408 - .../client/model/InviteMembersRequest.java | 335 - .../java/client/model/JsonPatchOperation.java | 392 - .../java/client/model/KeyGenerationMode.java | 84 - .../publicapi/java/client/model/MeModel.java | 321 - .../java/client/model/MemberModel.java | 413 - .../model/ModifyIntegrationRequest.java | 417 - .../java/client/model/OperationType.java | 88 - .../client/model/OrganizationAdminModel.java | 383 - .../model/OrganizationInvitationModel.java | 492 - .../client/model/OrganizationMemberModel.java | 434 - .../model/OrganizationMembersModel.java | 418 - .../java/client/model/OrganizationModel.java | 329 - .../OrganizationPermissionGroupModel.java | 325 - .../model/OrganizationPermissionModel.java | 320 - .../model/OrganizationProductModel.java | 329 - .../client/model/PercentageOptionModel.java | 322 - .../client/model/PermissionGroupModel.java | 1015 -- .../java/client/model/PreferencesModel.java | 430 - .../client/model/PrerequisiteComparator.java | 78 - .../model/PrerequisiteFlagConditionModel.java | 352 - .../java/client/model/ProductModel.java | 441 - .../model/ReasonRequiredEnvironmentModel.java | 355 - .../java/client/model/ReferenceLine.java | 333 - .../java/client/model/ReferenceLines.java | 464 - .../client/model/ReplaceSettingModel.java | 402 - .../model/RolloutPercentageItemModel.java | 330 - .../client/model/RolloutRuleComparator.java | 110 - .../java/client/model/RolloutRuleModel.java | 446 - .../java/client/model/SdkKeysModel.java | 328 - .../java/client/model/SegmentComparator.java | 78 - .../client/model/SegmentConditionModel.java | 326 - .../java/client/model/SegmentListModel.java | 584 - .../java/client/model/SegmentModel.java | 647 - .../java/client/model/SettingDataModel.java | 551 - .../client/model/SettingFormulaModel.java | 782 -- .../java/client/model/SettingModel.java | 577 - .../java/client/model/SettingTagModel.java | 380 - .../java/client/model/SettingType.java | 82 - .../java/client/model/SettingValueModel.java | 729 - .../publicapi/java/client/model/TagModel.java | 385 - .../java/client/model/TargetingRuleModel.java | 401 - .../client/model/UpdateConfigRequest.java | 354 - .../client/model/UpdateEnvironmentModel.java | 383 - .../model/UpdateEvaluationFormulaModel.java | 387 - .../UpdateEvaluationFormulaWithIdModel.java | 413 - .../model/UpdateEvaluationFormulasModel.java | 321 - .../model/UpdateMemberPermissionsRequest.java | 388 - .../model/UpdatePermissionGroupRequest.java | 958 -- .../model/UpdatePreferencesRequest.java | 430 - .../client/model/UpdateProductRequest.java | 354 - .../UpdateReasonRequiredEnvironmentModel.java | 314 - .../java/client/model/UpdateSegmentModel.java | 417 - .../client/model/UpdateSettingValueModel.java | 396 - .../UpdateSettingValueWithSettingIdModel.java | 422 - .../model/UpdateSettingValuesWithIdModel.java | 321 - .../java/client/model/UpdateTagModel.java | 328 - .../java/client/model/UserComparator.java | 146 - .../java/client/model/UserConditionModel.java | 355 - .../java/client/model/UserModel.java | 383 - .../java/client/model/ValueModel.java | 377 - .../java/client/model/WebHookHttpMethod.java | 78 - .../java/client/model/WebHookRequest.java | 418 - .../java/client/model/WebhookConfig.java | 329 - .../java/client/model/WebhookEnvironment.java | 329 - .../java/client/model/WebhookHeaderModel.java | 351 - .../java/client/model/WebhookModel.java | 498 - .../client/model/WebhookSigningKeysModel.java | 328 - 281 files changed, 89 insertions(+), 80206 deletions(-) delete mode 100644 api/openapi.yaml delete mode 100644 docs/AccessType.md delete mode 100644 docs/AddOrUpdateIntegrationLinkModel.md delete mode 100644 docs/AddOrUpdateJiraIntegrationLinkModel.md delete mode 100644 docs/AuditLogItemModel.md delete mode 100644 docs/AuditLogType.md delete mode 100644 docs/AuditLogsApi.md delete mode 100644 docs/CodeReferenceModel.md delete mode 100644 docs/CodeReferenceRequest.md delete mode 100644 docs/CodeReferencesApi.md delete mode 100644 docs/ComparisonValueListModel.md delete mode 100644 docs/ComparisonValueModel.md delete mode 100644 docs/ConditionModel.md delete mode 100644 docs/ConfigModel.md delete mode 100644 docs/ConfigSettingFormulaModel.md delete mode 100644 docs/ConfigSettingFormulasModel.md delete mode 100644 docs/ConfigSettingValueModel.md delete mode 100644 docs/ConfigSettingValuesModel.md delete mode 100644 docs/ConfigsApi.md delete mode 100644 docs/ConnectRequest.md delete mode 100644 docs/CreateConfigRequest.md delete mode 100644 docs/CreateEnvironmentModel.md delete mode 100644 docs/CreateIntegrationModel.md delete mode 100644 docs/CreateOrUpdateEnvironmentAccessModel.md delete mode 100644 docs/CreatePermissionGroupRequest.md delete mode 100644 docs/CreateProductRequest.md delete mode 100644 docs/CreateSegmentModel.md delete mode 100644 docs/CreateSettingInitialValues.md delete mode 100644 docs/CreateTagModel.md delete mode 100644 docs/DeleteIntegrationLinkModel.md delete mode 100644 docs/DeleteRepositoryReportsRequest.md delete mode 100644 docs/EnvironmentAccessModel.md delete mode 100644 docs/EnvironmentAccessType.md delete mode 100644 docs/EnvironmentModel.md delete mode 100644 docs/EnvironmentsApi.md delete mode 100644 docs/EvaluationVersion.md delete mode 100644 docs/FeatureFlagLimitations.md delete mode 100644 docs/FeatureFlagSettingValuesApi.md delete mode 100644 docs/FeatureFlagSettingValuesUsingSdkKeyApi.md delete mode 100644 docs/FeatureFlagSettingValuesUsingSdkKeyV2Api.md delete mode 100644 docs/FeatureFlagSettingValuesV2Api.md delete mode 100644 docs/FeatureFlagsSettingsApi.md delete mode 100644 docs/FlagReference.md delete mode 100644 docs/InitialValue.md delete mode 100644 docs/IntegrationLinkDetail.md delete mode 100644 docs/IntegrationLinkDetailsModel.md delete mode 100644 docs/IntegrationLinkModel.md delete mode 100644 docs/IntegrationLinkType.md delete mode 100644 docs/IntegrationLinksApi.md delete mode 100644 docs/IntegrationModel.md delete mode 100644 docs/IntegrationType.md delete mode 100644 docs/IntegrationsApi.md delete mode 100644 docs/IntegrationsModel.md delete mode 100644 docs/InvitationModel.md delete mode 100644 docs/InviteMembersRequest.md delete mode 100644 docs/JsonPatchOperation.md delete mode 100644 docs/KeyGenerationMode.md delete mode 100644 docs/MeApi.md delete mode 100644 docs/MeModel.md delete mode 100644 docs/MemberModel.md delete mode 100644 docs/MembersApi.md delete mode 100644 docs/ModifyIntegrationRequest.md delete mode 100644 docs/OperationType.md delete mode 100644 docs/OrganizationAdminModel.md delete mode 100644 docs/OrganizationInvitationModel.md delete mode 100644 docs/OrganizationMemberModel.md delete mode 100644 docs/OrganizationMembersModel.md delete mode 100644 docs/OrganizationModel.md delete mode 100644 docs/OrganizationPermissionGroupModel.md delete mode 100644 docs/OrganizationPermissionModel.md delete mode 100644 docs/OrganizationProductModel.md delete mode 100644 docs/OrganizationsApi.md delete mode 100644 docs/PercentageOptionModel.md delete mode 100644 docs/PermissionGroupModel.md delete mode 100644 docs/PermissionGroupsApi.md delete mode 100644 docs/PreferencesModel.md delete mode 100644 docs/PrerequisiteComparator.md delete mode 100644 docs/PrerequisiteFlagConditionModel.md delete mode 100644 docs/ProductModel.md delete mode 100644 docs/ProductsApi.md delete mode 100644 docs/ReasonRequiredEnvironmentModel.md delete mode 100644 docs/ReferenceLine.md delete mode 100644 docs/ReferenceLines.md delete mode 100644 docs/ReplaceSettingModel.md delete mode 100644 docs/RolloutPercentageItemModel.md delete mode 100644 docs/RolloutRuleComparator.md delete mode 100644 docs/RolloutRuleModel.md delete mode 100644 docs/SdkKeysApi.md delete mode 100644 docs/SdkKeysModel.md delete mode 100644 docs/SegmentComparator.md delete mode 100644 docs/SegmentConditionModel.md delete mode 100644 docs/SegmentListModel.md delete mode 100644 docs/SegmentModel.md delete mode 100644 docs/SegmentsApi.md delete mode 100644 docs/SettingDataModel.md delete mode 100644 docs/SettingFormulaModel.md delete mode 100644 docs/SettingModel.md delete mode 100644 docs/SettingTagModel.md delete mode 100644 docs/SettingType.md delete mode 100644 docs/SettingValueModel.md delete mode 100644 docs/TagModel.md delete mode 100644 docs/TagsApi.md delete mode 100644 docs/TargetingRuleModel.md delete mode 100644 docs/UpdateConfigRequest.md delete mode 100644 docs/UpdateEnvironmentModel.md delete mode 100644 docs/UpdateEvaluationFormulaModel.md delete mode 100644 docs/UpdateEvaluationFormulaWithIdModel.md delete mode 100644 docs/UpdateEvaluationFormulasModel.md delete mode 100644 docs/UpdateMemberPermissionsRequest.md delete mode 100644 docs/UpdatePermissionGroupRequest.md delete mode 100644 docs/UpdatePreferencesRequest.md delete mode 100644 docs/UpdateProductRequest.md delete mode 100644 docs/UpdateReasonRequiredEnvironmentModel.md delete mode 100644 docs/UpdateSegmentModel.md delete mode 100644 docs/UpdateSettingValueModel.md delete mode 100644 docs/UpdateSettingValueWithSettingIdModel.md delete mode 100644 docs/UpdateSettingValuesWithIdModel.md delete mode 100644 docs/UpdateTagModel.md delete mode 100644 docs/UserComparator.md delete mode 100644 docs/UserConditionModel.md delete mode 100644 docs/UserModel.md delete mode 100644 docs/ValueModel.md delete mode 100644 docs/WebHookHttpMethod.md delete mode 100644 docs/WebHookRequest.md delete mode 100644 docs/WebhookConfig.md delete mode 100644 docs/WebhookEnvironment.md delete mode 100644 docs/WebhookHeaderModel.md delete mode 100644 docs/WebhookModel.md delete mode 100644 docs/WebhookSigningKeysModel.md delete mode 100644 docs/WebhooksApi.md delete mode 100644 src/main/AndroidManifest.xml delete mode 100644 src/main/java/com/configcat/publicapi/java/client/ApiCallback.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/ApiClient.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/ApiException.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/ApiResponse.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/Configuration.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/GzipRequestInterceptor.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/JSON.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/Pair.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/ProgressRequestBody.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/ProgressResponseBody.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/ServerConfiguration.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/ServerVariable.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/StringUtil.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/api/AuditLogsApi.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/api/CodeReferencesApi.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/api/ConfigsApi.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/api/EnvironmentsApi.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesApi.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyApi.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyV2Api.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesV2Api.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagsSettingsApi.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/api/IntegrationLinksApi.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/api/IntegrationsApi.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/api/MeApi.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/api/MembersApi.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/api/OrganizationsApi.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/api/PermissionGroupsApi.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/api/ProductsApi.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/api/SdkKeysApi.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/api/SegmentsApi.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/api/TagsApi.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/api/WebhooksApi.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/auth/ApiKeyAuth.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/auth/Authentication.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/auth/HttpBasicAuth.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/auth/HttpBearerAuth.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/AbstractOpenApiSchema.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/AccessType.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/AddOrUpdateIntegrationLinkModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/AddOrUpdateJiraIntegrationLinkModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/AuditLogItemModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/AuditLogType.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/CodeReferenceModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/CodeReferenceRequest.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ComparisonValueListModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ComparisonValueModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ConditionModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ConfigModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulaModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulasModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingValueModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingValuesModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ConnectRequest.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/CreateConfigRequest.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/CreateEnvironmentModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/CreateIntegrationModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/CreateOrUpdateEnvironmentAccessModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/CreatePermissionGroupRequest.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/CreateProductRequest.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/CreateSegmentModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/CreateSettingInitialValues.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/CreateTagModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/DeleteIntegrationLinkModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/DeleteRepositoryReportsRequest.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessType.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/EnvironmentModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/EvaluationVersion.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/FeatureFlagLimitations.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/FlagReference.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/InitialValue.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetail.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetailsModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkType.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/IntegrationModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/IntegrationType.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/IntegrationsModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/InvitationModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/InviteMembersRequest.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/JsonPatchOperation.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/KeyGenerationMode.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/MeModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/MemberModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ModifyIntegrationRequest.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/OperationType.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/OrganizationAdminModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/OrganizationInvitationModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/OrganizationMemberModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/OrganizationMembersModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/OrganizationModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/OrganizationPermissionGroupModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/OrganizationPermissionModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/OrganizationProductModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/PercentageOptionModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/PermissionGroupModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/PreferencesModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteComparator.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteFlagConditionModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ProductModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ReasonRequiredEnvironmentModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ReferenceLine.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ReferenceLines.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ReplaceSettingModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/RolloutPercentageItemModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/RolloutRuleComparator.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/RolloutRuleModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/SdkKeysModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/SegmentComparator.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/SegmentConditionModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/SegmentListModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/SegmentModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/SettingDataModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/SettingFormulaModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/SettingModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/SettingTagModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/SettingType.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/SettingValueModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/TagModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/TargetingRuleModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateConfigRequest.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateEnvironmentModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaWithIdModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulasModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateMemberPermissionsRequest.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdatePermissionGroupRequest.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdatePreferencesRequest.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateProductRequest.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateReasonRequiredEnvironmentModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateSegmentModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueWithSettingIdModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValuesWithIdModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateTagModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UserComparator.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UserConditionModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UserModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ValueModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/WebHookHttpMethod.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/WebHookRequest.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/WebhookConfig.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/WebhookEnvironment.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/WebhookHeaderModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/WebhookModel.java delete mode 100644 src/main/java/com/configcat/publicapi/java/client/model/WebhookSigningKeysModel.java diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index c16bdcc..d616b97 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -31,6 +31,7 @@ docs/CreateSettingInitialValues.md docs/CreateTagModel.md docs/DeleteIntegrationLinkModel.md docs/DeleteRepositoryReportsRequest.md +docs/DeletedSettingModel.md docs/EnvironmentAccessModel.md docs/EnvironmentAccessType.md docs/EnvironmentModel.md @@ -81,8 +82,10 @@ docs/PrerequisiteFlagConditionModel.md docs/ProductModel.md docs/ProductsApi.md docs/ReasonRequiredEnvironmentModel.md -docs/ReferenceLine.md -docs/ReferenceLines.md +docs/ReferenceLineModel.md +docs/ReferenceLineRequest.md +docs/ReferenceLinesModel.md +docs/ReferenceLinesRequest.md docs/ReplaceSettingModel.md docs/RolloutPercentageItemModel.md docs/RolloutRuleComparator.md @@ -100,36 +103,58 @@ docs/SettingModel.md docs/SettingTagModel.md docs/SettingType.md docs/SettingValueModel.md +docs/SettingValueType.md +docs/StaleFlagConfigModel.md +docs/StaleFlagEnvironmentModel.md +docs/StaleFlagProductModel.md +docs/StaleFlagReminderScope.md +docs/StaleFlagSettingModel.md +docs/StaleFlagSettingTagModel.md +docs/StaleFlagSettingValueModel.md +docs/StaleFlagStaleInEnvironmentsType.md docs/TagModel.md docs/TagsApi.md docs/TargetingRuleModel.md +docs/UpdateComparisonValueListModel.md +docs/UpdateComparisonValueModel.md +docs/UpdateConditionModel.md docs/UpdateConfigRequest.md docs/UpdateEnvironmentModel.md docs/UpdateEvaluationFormulaModel.md docs/UpdateEvaluationFormulaWithIdModel.md docs/UpdateEvaluationFormulasModel.md docs/UpdateMemberPermissionsRequest.md +docs/UpdatePercentageOptionModel.md docs/UpdatePermissionGroupRequest.md docs/UpdatePreferencesRequest.md +docs/UpdatePrerequisiteFlagConditionModel.md docs/UpdateProductRequest.md docs/UpdateReasonRequiredEnvironmentModel.md +docs/UpdateRolloutPercentageItemModel.md +docs/UpdateRolloutRuleModel.md +docs/UpdateSegmentConditionModel.md docs/UpdateSegmentModel.md docs/UpdateSettingValueModel.md docs/UpdateSettingValueWithSettingIdModel.md docs/UpdateSettingValuesWithIdModel.md docs/UpdateTagModel.md +docs/UpdateTargetingRuleModel.md +docs/UpdateUserConditionModel.md +docs/UpdateValueModel.md docs/UserComparator.md docs/UserConditionModel.md docs/UserModel.md docs/ValueModel.md docs/WebHookHttpMethod.md -docs/WebHookRequest.md +docs/WebHookRequestModel.md docs/WebhookConfig.md docs/WebhookEnvironment.md docs/WebhookHeaderModel.md -docs/WebhookModel.md +docs/WebhookHeaderResponseModel.md +docs/WebhookResponseModel.md docs/WebhookSigningKeysModel.md docs/WebhooksApi.md +docs/ZombieStaleFlagsApi.md git_push.sh gradle.properties gradle/wrapper/gradle-wrapper.jar @@ -171,6 +196,7 @@ src/main/java/com/configcat/publicapi/java/client/api/SdkKeysApi.java src/main/java/com/configcat/publicapi/java/client/api/SegmentsApi.java src/main/java/com/configcat/publicapi/java/client/api/TagsApi.java src/main/java/com/configcat/publicapi/java/client/api/WebhooksApi.java +src/main/java/com/configcat/publicapi/java/client/api/ZombieStaleFlagsApi.java src/main/java/com/configcat/publicapi/java/client/auth/ApiKeyAuth.java src/main/java/com/configcat/publicapi/java/client/auth/Authentication.java src/main/java/com/configcat/publicapi/java/client/auth/HttpBasicAuth.java @@ -203,6 +229,7 @@ src/main/java/com/configcat/publicapi/java/client/model/CreateSettingInitialValu src/main/java/com/configcat/publicapi/java/client/model/CreateTagModel.java src/main/java/com/configcat/publicapi/java/client/model/DeleteIntegrationLinkModel.java src/main/java/com/configcat/publicapi/java/client/model/DeleteRepositoryReportsRequest.java +src/main/java/com/configcat/publicapi/java/client/model/DeletedSettingModel.java src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessModel.java src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessType.java src/main/java/com/configcat/publicapi/java/client/model/EnvironmentModel.java @@ -240,8 +267,10 @@ src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteComparator.j src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteFlagConditionModel.java src/main/java/com/configcat/publicapi/java/client/model/ProductModel.java src/main/java/com/configcat/publicapi/java/client/model/ReasonRequiredEnvironmentModel.java -src/main/java/com/configcat/publicapi/java/client/model/ReferenceLine.java -src/main/java/com/configcat/publicapi/java/client/model/ReferenceLines.java +src/main/java/com/configcat/publicapi/java/client/model/ReferenceLineModel.java +src/main/java/com/configcat/publicapi/java/client/model/ReferenceLineRequest.java +src/main/java/com/configcat/publicapi/java/client/model/ReferenceLinesModel.java +src/main/java/com/configcat/publicapi/java/client/model/ReferenceLinesRequest.java src/main/java/com/configcat/publicapi/java/client/model/ReplaceSettingModel.java src/main/java/com/configcat/publicapi/java/client/model/RolloutPercentageItemModel.java src/main/java/com/configcat/publicapi/java/client/model/RolloutRuleComparator.java @@ -257,31 +286,52 @@ src/main/java/com/configcat/publicapi/java/client/model/SettingModel.java src/main/java/com/configcat/publicapi/java/client/model/SettingTagModel.java src/main/java/com/configcat/publicapi/java/client/model/SettingType.java src/main/java/com/configcat/publicapi/java/client/model/SettingValueModel.java +src/main/java/com/configcat/publicapi/java/client/model/SettingValueType.java +src/main/java/com/configcat/publicapi/java/client/model/StaleFlagConfigModel.java +src/main/java/com/configcat/publicapi/java/client/model/StaleFlagEnvironmentModel.java +src/main/java/com/configcat/publicapi/java/client/model/StaleFlagProductModel.java +src/main/java/com/configcat/publicapi/java/client/model/StaleFlagReminderScope.java +src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingModel.java +src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingTagModel.java +src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingValueModel.java +src/main/java/com/configcat/publicapi/java/client/model/StaleFlagStaleInEnvironmentsType.java src/main/java/com/configcat/publicapi/java/client/model/TagModel.java src/main/java/com/configcat/publicapi/java/client/model/TargetingRuleModel.java +src/main/java/com/configcat/publicapi/java/client/model/UpdateComparisonValueListModel.java +src/main/java/com/configcat/publicapi/java/client/model/UpdateComparisonValueModel.java +src/main/java/com/configcat/publicapi/java/client/model/UpdateConditionModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdateConfigRequest.java src/main/java/com/configcat/publicapi/java/client/model/UpdateEnvironmentModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaWithIdModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulasModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdateMemberPermissionsRequest.java +src/main/java/com/configcat/publicapi/java/client/model/UpdatePercentageOptionModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdatePermissionGroupRequest.java src/main/java/com/configcat/publicapi/java/client/model/UpdatePreferencesRequest.java +src/main/java/com/configcat/publicapi/java/client/model/UpdatePrerequisiteFlagConditionModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdateProductRequest.java src/main/java/com/configcat/publicapi/java/client/model/UpdateReasonRequiredEnvironmentModel.java +src/main/java/com/configcat/publicapi/java/client/model/UpdateRolloutPercentageItemModel.java +src/main/java/com/configcat/publicapi/java/client/model/UpdateRolloutRuleModel.java +src/main/java/com/configcat/publicapi/java/client/model/UpdateSegmentConditionModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdateSegmentModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueWithSettingIdModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValuesWithIdModel.java src/main/java/com/configcat/publicapi/java/client/model/UpdateTagModel.java +src/main/java/com/configcat/publicapi/java/client/model/UpdateTargetingRuleModel.java +src/main/java/com/configcat/publicapi/java/client/model/UpdateUserConditionModel.java +src/main/java/com/configcat/publicapi/java/client/model/UpdateValueModel.java src/main/java/com/configcat/publicapi/java/client/model/UserComparator.java src/main/java/com/configcat/publicapi/java/client/model/UserConditionModel.java src/main/java/com/configcat/publicapi/java/client/model/UserModel.java src/main/java/com/configcat/publicapi/java/client/model/ValueModel.java src/main/java/com/configcat/publicapi/java/client/model/WebHookHttpMethod.java -src/main/java/com/configcat/publicapi/java/client/model/WebHookRequest.java +src/main/java/com/configcat/publicapi/java/client/model/WebHookRequestModel.java src/main/java/com/configcat/publicapi/java/client/model/WebhookConfig.java src/main/java/com/configcat/publicapi/java/client/model/WebhookEnvironment.java src/main/java/com/configcat/publicapi/java/client/model/WebhookHeaderModel.java -src/main/java/com/configcat/publicapi/java/client/model/WebhookModel.java +src/main/java/com/configcat/publicapi/java/client/model/WebhookHeaderResponseModel.java +src/main/java/com/configcat/publicapi/java/client/model/WebhookResponseModel.java src/main/java/com/configcat/publicapi/java/client/model/WebhookSigningKeysModel.java diff --git a/README.md b/README.md index ad273c8..c5aa46a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ConfigCat Public Management API - API version: v1 - - Build date: 2025-02-20T16:55:24.304297906Z[Etc/UTC] + - Build date: 2025-06-10T21:25:35.532049258Z[Etc/UTC] - Generator version: 7.7.0 The purpose of this API is to access the ConfigCat platform programmatically. @@ -253,6 +253,7 @@ Class | Method | HTTP request | Description *WebhooksApi* | [**getWebhooks**](docs/WebhooksApi.md#getWebhooks) | **GET** /v1/products/{productId}/webhooks | List Webhooks *WebhooksApi* | [**replaceWebhook**](docs/WebhooksApi.md#replaceWebhook) | **PUT** /v1/webhooks/{webhookId} | Replace Webhook *WebhooksApi* | [**updateWebhook**](docs/WebhooksApi.md#updateWebhook) | **PATCH** /v1/webhooks/{webhookId} | Update Webhook +*ZombieStaleFlagsApi* | [**getStaleflags**](docs/ZombieStaleFlagsApi.md#getStaleflags) | **GET** /v1/products/{productId}/staleflags | List Zombie (stale) flags for Product ## Documentation for Models @@ -284,6 +285,7 @@ Class | Method | HTTP request | Description - [CreateTagModel](docs/CreateTagModel.md) - [DeleteIntegrationLinkModel](docs/DeleteIntegrationLinkModel.md) - [DeleteRepositoryReportsRequest](docs/DeleteRepositoryReportsRequest.md) + - [DeletedSettingModel](docs/DeletedSettingModel.md) - [EnvironmentAccessModel](docs/EnvironmentAccessModel.md) - [EnvironmentAccessType](docs/EnvironmentAccessType.md) - [EnvironmentModel](docs/EnvironmentModel.md) @@ -321,8 +323,10 @@ Class | Method | HTTP request | Description - [PrerequisiteFlagConditionModel](docs/PrerequisiteFlagConditionModel.md) - [ProductModel](docs/ProductModel.md) - [ReasonRequiredEnvironmentModel](docs/ReasonRequiredEnvironmentModel.md) - - [ReferenceLine](docs/ReferenceLine.md) - - [ReferenceLines](docs/ReferenceLines.md) + - [ReferenceLineModel](docs/ReferenceLineModel.md) + - [ReferenceLineRequest](docs/ReferenceLineRequest.md) + - [ReferenceLinesModel](docs/ReferenceLinesModel.md) + - [ReferenceLinesRequest](docs/ReferenceLinesRequest.md) - [ReplaceSettingModel](docs/ReplaceSettingModel.md) - [RolloutPercentageItemModel](docs/RolloutPercentageItemModel.md) - [RolloutRuleComparator](docs/RolloutRuleComparator.md) @@ -338,33 +342,54 @@ Class | Method | HTTP request | Description - [SettingTagModel](docs/SettingTagModel.md) - [SettingType](docs/SettingType.md) - [SettingValueModel](docs/SettingValueModel.md) + - [SettingValueType](docs/SettingValueType.md) + - [StaleFlagConfigModel](docs/StaleFlagConfigModel.md) + - [StaleFlagEnvironmentModel](docs/StaleFlagEnvironmentModel.md) + - [StaleFlagProductModel](docs/StaleFlagProductModel.md) + - [StaleFlagReminderScope](docs/StaleFlagReminderScope.md) + - [StaleFlagSettingModel](docs/StaleFlagSettingModel.md) + - [StaleFlagSettingTagModel](docs/StaleFlagSettingTagModel.md) + - [StaleFlagSettingValueModel](docs/StaleFlagSettingValueModel.md) + - [StaleFlagStaleInEnvironmentsType](docs/StaleFlagStaleInEnvironmentsType.md) - [TagModel](docs/TagModel.md) - [TargetingRuleModel](docs/TargetingRuleModel.md) + - [UpdateComparisonValueListModel](docs/UpdateComparisonValueListModel.md) + - [UpdateComparisonValueModel](docs/UpdateComparisonValueModel.md) + - [UpdateConditionModel](docs/UpdateConditionModel.md) - [UpdateConfigRequest](docs/UpdateConfigRequest.md) - [UpdateEnvironmentModel](docs/UpdateEnvironmentModel.md) - [UpdateEvaluationFormulaModel](docs/UpdateEvaluationFormulaModel.md) - [UpdateEvaluationFormulaWithIdModel](docs/UpdateEvaluationFormulaWithIdModel.md) - [UpdateEvaluationFormulasModel](docs/UpdateEvaluationFormulasModel.md) - [UpdateMemberPermissionsRequest](docs/UpdateMemberPermissionsRequest.md) + - [UpdatePercentageOptionModel](docs/UpdatePercentageOptionModel.md) - [UpdatePermissionGroupRequest](docs/UpdatePermissionGroupRequest.md) - [UpdatePreferencesRequest](docs/UpdatePreferencesRequest.md) + - [UpdatePrerequisiteFlagConditionModel](docs/UpdatePrerequisiteFlagConditionModel.md) - [UpdateProductRequest](docs/UpdateProductRequest.md) - [UpdateReasonRequiredEnvironmentModel](docs/UpdateReasonRequiredEnvironmentModel.md) + - [UpdateRolloutPercentageItemModel](docs/UpdateRolloutPercentageItemModel.md) + - [UpdateRolloutRuleModel](docs/UpdateRolloutRuleModel.md) + - [UpdateSegmentConditionModel](docs/UpdateSegmentConditionModel.md) - [UpdateSegmentModel](docs/UpdateSegmentModel.md) - [UpdateSettingValueModel](docs/UpdateSettingValueModel.md) - [UpdateSettingValueWithSettingIdModel](docs/UpdateSettingValueWithSettingIdModel.md) - [UpdateSettingValuesWithIdModel](docs/UpdateSettingValuesWithIdModel.md) - [UpdateTagModel](docs/UpdateTagModel.md) + - [UpdateTargetingRuleModel](docs/UpdateTargetingRuleModel.md) + - [UpdateUserConditionModel](docs/UpdateUserConditionModel.md) + - [UpdateValueModel](docs/UpdateValueModel.md) - [UserComparator](docs/UserComparator.md) - [UserConditionModel](docs/UserConditionModel.md) - [UserModel](docs/UserModel.md) - [ValueModel](docs/ValueModel.md) - [WebHookHttpMethod](docs/WebHookHttpMethod.md) - - [WebHookRequest](docs/WebHookRequest.md) + - [WebHookRequestModel](docs/WebHookRequestModel.md) - [WebhookConfig](docs/WebhookConfig.md) - [WebhookEnvironment](docs/WebhookEnvironment.md) - [WebhookHeaderModel](docs/WebhookHeaderModel.md) - - [WebhookModel](docs/WebhookModel.md) + - [WebhookHeaderResponseModel](docs/WebhookHeaderResponseModel.md) + - [WebhookResponseModel](docs/WebhookResponseModel.md) - [WebhookSigningKeysModel](docs/WebhookSigningKeysModel.md) diff --git a/api/openapi.yaml b/api/openapi.yaml deleted file mode 100644 index 55c4491..0000000 --- a/api/openapi.yaml +++ /dev/null @@ -1,11218 +0,0 @@ -openapi: 3.0.1 -info: - contact: - email: support@configcat.com - name: ConfigCat - url: https://configcat.com - description: "The purpose of this API is to access the ConfigCat platform programmatically.\n\ - You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature\ - \ Flags, Configs, Environments** or **Products** within ConfigCat.\n\n**Base API\ - \ URL**: https://api.configcat.com\n\nIf you prefer the swagger documentation,\ - \ you can find it here: [Swagger UI](https://api.configcat.com/swagger).\n\nThe\ - \ API is based on HTTP REST, uses resource-oriented URLs, status codes and supports\ - \ JSON \nformat. \n\n**Important:** Do not use this API for accessing and evaluating\ - \ feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview)\ - \ or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/)\ - \ instead.\n\n# OpenAPI Specification\n\nThe complete specification is publicly\ - \ available in the following formats: \n- [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json)\n\ - - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json)\n\nYou can use\ - \ it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator)\ - \ or\n[Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact\ - \ with this API.\n\n# Authentication\nThis API uses the [Basic HTTP Authentication\ - \ Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). \n\n\n\n# Throttling and rate limits\nAll\ - \ the rate limited API calls are returning information about the current rate\ - \ limit period in the following HTTP headers:\n\n| Header | Description |\n| :-\ - \ | :- |\n| X-Rate-Limit-Remaining | The maximum number of requests remaining\ - \ in the current rate limit period. |\n| X-Rate-Limit-Reset | The time\twhen\ - \ the current rate limit period resets.\t\t\t\t\t\t |\n\nWhen the rate limit\ - \ is exceeded by a request, the API returns with a `HTTP 429 - Too many requests`\ - \ status along with a `Retry-After` HTTP header.\n" - termsOfService: https://configcat.com/termsofserviceagreement - title: ConfigCat Public Management API - version: v1 - x-logo: - url: https://api.configcat.com/resources/configcat-logo-horiz.svg -servers: -- url: https://api.configcat.com -security: -- Basic: [] -tags: -- description: |- - These endpoints are exclusive for Config V2 Feature Flags. -
They can only be used on a Config that has `evaluationVersion` set to `v2`.

- With these endpoints you can control how your existing Feature Flags and Settings should serve their values. - You can turn Feature Flags on or off, update Setting values and change Targeting Rules. - - These endpoints are determining the Environment and Config by the SDK key passed in - the `X-CONFIGCAT-SDKKEY` request header. To identify the desired Feature Flag or Setting to change, - you can use either its `settingId` or `key` attribute. You can get those attributes - from the [Feature Flag & Setting](#tag/Feature-Flags-and-Settings) endpoints. - name: Feature Flag & Setting values using SDK Key V2 -- description: |- - These endpoints are exclusive for Config V2 Feature Flags. -
They can only be used on a Config that has `evaluationVersion` set to `v2`.

- With these endpoints you can control how your existing Feature Flags and Settings should serve their values. - You can turn Feature Flags on or off, update Setting values and change Targeting Rules. - - To determine which Feature Flag or Setting you want to work with you have to pass its `settingId`. It can be - obtained from the [Feature Flag & Setting](#tag/Feature-Flags-and-Settings) endpoints. - - You also have to specify in which Environment you want to change the served value configuration by its - `environmentId` which can be obtained from the [List Environments](#operation/get-environments) endpoint. - name: Feature Flag & Setting values V2 -- description: "With these endpoints you can control how your existing Feature Flags\ - \ and Settings should serve their values. \nYou can turn Feature Flags on or off,\ - \ update Setting values and also add, remove or change the order of Percentage\ - \ and Targeting Rules.\n\nThese endpoints are determining the Environment and\ - \ Config by the SDK key passed in\nthe `X-CONFIGCAT-SDKKEY` request header. To identify the\ - \ desired Feature Flag or Setting to change, \nyou can use either its `settingId`\ - \ or `key` attribute. You can get those attributes \nfrom the [Feature Flag &\ - \ Setting](#tag/Feature-Flags-and-Settings) endpoints." - name: Feature Flag & Setting values using SDK Key -- description: "With these endpoints you can control how your existing Feature Flags\ - \ and Settings should serve their values. \nYou can turn Feature Flags on or off,\ - \ update Setting values and also add, remove or reorder Percentage and Targeting\ - \ Rules.\n\nTo determine which Feature Flag or Setting you want to work with you\ - \ have to pass its `settingId`. It can be\nobtained from the [Feature Flag & Setting](#tag/Feature-Flags-and-Settings)\ - \ endpoints.\n\nYou also have to specify in which Environment you want to change\ - \ the served value configuration by its\n`environmentId` which can be obtained\ - \ from the [List Environments](#operation/get-environments) endpoint." - name: Feature Flag & Setting values -- description: "With these endpoints you can manage your Feature Flags or Settings\ - \ within a Config. \nHowever you can't use them for manipulating the values of\ - \ your Feature Flags and Settings,\nto do that please visit the [Feature Flag\ - \ & Setting values using SDK Key](#tag/Feature-Flag-and-Setting-values-using-SDK-Key)\n\ - and [Feature Flag & Setting values](#tag/Feature-Flag-and-Setting-values) sections\ - \ of the API.\n\nFor using these endpoints, first you have to select which Config\ - \ you want to work with by its `configId` \nwhich can be obtained from the [List\ - \ Configs](#operation/get-configs) endpoint. \nThen you can use it to create new\ - \ Feature Flags or to get information about existing ones.\n\nThen you can obtain\ - \ the `settingId` or `key` of your desired Feature Flag or Setting \nto use them\ - \ for further operations in this API. \n\nHere you can read more about\ - \ the concept of Settings." - name: Feature Flags & Settings -- description: |- - With these endpoints you can get useful information about your Organizations. - This also can be used to manage your [Products](#tag/Products). - - Here you can read more about the Organizations. - name: Organizations -- description: |- - With these endpoints you can manage your Members. - - Here you can read more about Team Management. - name: Members -- description: |- - With these endpoints you can manage your Permission Groups. - - Here you can read more about Permissions. - name: Permission Groups -- description: |- - With these endpoints you can manage your Products. - By gathering the right `productId`, you can also manage [Environments](#tag/Environments), [Configs](#tag/Configs), [Tags](#tag/Tags), [Webhooks](#tag/Webhooks), and [Permission Groups](#tag/Permission-Groups) through the API. - - Here you can read more about the concept of Products. - name: Products -- description: |- - With these endpoints you can manage Webhooks. - - Here you can read more about the concept of Webhooks. - name: Webhooks -- description: "With these endpoints you can manage your Configs.\nThis also can be\ - \ used to manage [Feature Flags and Settings](#tag/Feature-Flags-and-Settings)\ - \ and their \n[served values](#tag/Feature-Flag-and-Setting-values) through this\ - \ API.\n\nHere you can read more about the concept\ - \ of Configs." - name: Configs -- description: "With these endpoints you can update existing Environments or add new\ - \ ones into your selected [Product](#tag/Products). \n\nHere you can read more about\ - \ the concept of Environments." - name: Environments -- description: |- - With these endpoints you can manage your Segments. - Segments allow you to group your users based on any of their properties. Define user segments and add them to multiple feature flags. - name: Segments -- description: With these endpoints you can manage your SDK Keys. - name: SDK Keys -- description: "With these endpoints you can manage Tags. Tags are stored under a\ - \ Product. You can and add a Tag to a Feature Flag or Setting using the [Update\ - \ Flag](#operation/update-setting) endpoint." - name: Tags -- description: |- - With these endpoints you can manage your Integrations. - - - Datadog - - Slack - - Amplitude - - MixPanel - - Segment - - PubNub (work in progress) - name: Integrations -- description: With these endpoints you can manage your integration links. - name: Integration links -- description: Access audit log entries. - name: Audit logs -- description: Information about the current user. - name: Me -- description: |- - With this endpoint you can upload Feature Flag and Setting usage references that will be shown on the ConfigCat Dashboard. - - Here you can read more about the concept of Code References. - name: Code References -paths: - /v1/organizations: - get: - description: This endpoint returns the list of the Organizations that belongs - to the user. - operationId: get-organizations - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/OrganizationModel' - type: array - description: "" - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: List Organizations - tags: - - Organizations - x-accepts: - - application/json - /v1/products: - get: - description: This endpoint returns the list of the Products that belongs to - the user. - operationId: get-products - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/ProductModel' - type: array - description: "" - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: List Products - tags: - - Products - x-accepts: - - application/json - /v1/products/{productId}/tags: - get: - description: "This endpoint returns the list of the Tags in a \nspecified Product,\ - \ identified by the `productId` parameter." - operationId: get-tags - parameters: - - description: The identifier of the Product. - explode: false - in: path - name: productId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/TagModel' - type: array - description: "" - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: List Tags - tags: - - Tags - x-accepts: - - application/json - post: - description: "This endpoint creates a new Tag in a specified Product \nidentified\ - \ by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products)\ - \ endpoint." - operationId: create-tag - parameters: - - description: The identifier of the Organization. - explode: false - in: path - name: productId - required: true - schema: - format: uuid - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateTagModel' - text/json: - schema: - $ref: '#/components/schemas/CreateTagModel' - application/*+json: - schema: - $ref: '#/components/schemas/CreateTagModel' - required: true - responses: - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/TagModel' - description: When the creation was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Create Tag - tags: - - Tags - x-content-type: application/json - x-accepts: - - application/json - /v1/products/{productId}/webhooks: - get: - description: |- - This endpoint returns the list of the Webhooks that belongs to the given Product identified by the - `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - operationId: get-webhooks - parameters: - - description: The identifier of the Product. - explode: false - in: path - name: productId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/WebhookModel' - type: array - description: "" - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: List Webhooks - tags: - - Webhooks - x-accepts: - - application/json - /v1/products/{productId}/configs: - get: - description: |- - This endpoint returns the list of the Configs that belongs to the given Product identified by the - `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - operationId: get-configs - parameters: - - description: The identifier of the Product. - explode: false - in: path - name: productId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/ConfigModel' - type: array - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: List Configs - tags: - - Configs - x-accepts: - - application/json - post: - description: "This endpoint creates a new Config in a specified Product \nidentified\ - \ by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products)\ - \ endpoint." - operationId: create-config - parameters: - - description: The identifier of the Product. - explode: false - in: path - name: productId - required: true - schema: - format: uuid - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateConfigRequest' - text/json: - schema: - $ref: '#/components/schemas/CreateConfigRequest' - application/*+json: - schema: - $ref: '#/components/schemas/CreateConfigRequest' - required: true - responses: - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigModel' - description: When the creation was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Create Config - tags: - - Configs - x-content-type: application/json - x-accepts: - - application/json - /v1/products/{productId}/environments: - get: - description: |- - This endpoint returns the list of the Environments that belongs to the given Product identified by the - `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - operationId: get-environments - parameters: - - description: The identifier of the Product. - explode: false - in: path - name: productId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/EnvironmentModel' - type: array - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: List Environments - tags: - - Environments - x-accepts: - - application/json - post: - description: "This endpoint creates a new Environment in a specified Product\ - \ \nidentified by the `productId` parameter, which can be obtained from the\ - \ [List Products](#operation/get-products) endpoint." - operationId: create-environment - parameters: - - description: The identifier of the Product. - explode: false - in: path - name: productId - required: true - schema: - format: uuid - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateEnvironmentModel' - text/json: - schema: - $ref: '#/components/schemas/CreateEnvironmentModel' - application/*+json: - schema: - $ref: '#/components/schemas/CreateEnvironmentModel' - required: true - responses: - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/EnvironmentModel' - description: When the creation was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Create Environment - tags: - - Environments - x-content-type: application/json - x-accepts: - - application/json - /v1/products/{productId}/permissions: - get: - description: |- - This endpoint returns the list of the Permission Groups that belongs to the given Product identified by the - `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - operationId: get-permission-groups - parameters: - - description: The identifier of the Product. - explode: false - in: path - name: productId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/PermissionGroupModel' - type: array - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: List Permission Groups - tags: - - Permission Groups - x-accepts: - - application/json - post: - description: "This endpoint creates a new Permission Group in a specified Product\ - \ \nidentified by the `productId` parameter, which can be obtained from the\ - \ [List Products](#operation/get-products) endpoint." - operationId: create-permission-group - parameters: - - description: The identifier of the Product. - explode: false - in: path - name: productId - required: true - schema: - format: uuid - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreatePermissionGroupRequest' - text/json: - schema: - $ref: '#/components/schemas/CreatePermissionGroupRequest' - application/*+json: - schema: - $ref: '#/components/schemas/CreatePermissionGroupRequest' - required: true - responses: - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/PermissionGroupModel' - description: When the creation was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Create Permission Group - tags: - - Permission Groups - x-content-type: application/json - x-accepts: - - application/json - /v1/products/{productId}/integrations: - get: - description: |- - This endpoint returns the list of the Integrations that belongs to the given Product identified by the - `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - operationId: get-integrations - parameters: - - description: The identifier of the Product. - explode: false - in: path - name: productId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/IntegrationsModel' - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: List Integrations - tags: - - Integrations - x-accepts: - - application/json - post: - description: "This endpoint creates a new Integration in a specified Product\ - \ \nidentified by the `productId` parameter, which can be obtained from the\ - \ [List Products](#operation/get-products) endpoint.\n\nThe Parameters dictionary\ - \ differs for each IntegrationType:\n- Datadog\n\t- `apikey`: Required. Datadog\ - \ API key.\n\t- `site`: Datadog site. Available values: `Us`, `Eu`, `Us1Fed`,\ - \ `Us3`, `Us5`. Default: `Us`.\n- Slack \n\tConnecting the Slack integration\ - \ through the Public Management API will not post messages with the ConfigCat\ - \ Feature Flags Slack app but with an incoming webhook.\n\t- `incoming_webhook.url`:\ - \ Required. The [incoming webhook URL](https://api.slack.com/messaging/webhooks)\ - \ where the integration should post messages.\n- Amplitude\n\t- `apiKey`:\ - \ Required. Amplitude API Key.\n\t- `secretKey`: Required. Amplitude Secret\ - \ Key.\n- Mixpanel\n\t- `serviceAccountUserName`: Required. Mixpanel Service\ - \ Account Username.\n\t- `serviceAccountSecret`: Required. Mixpanel Service\ - \ Account Secret.\n\t- `projectId`: Required. Mixpanel Project ID.\n\t- `server`:\ - \ Mixpanel Server. Available values: `StandardServer`, `EUResidencyServer`.\ - \ Default: `StandardServer`.\n- Twilio Segment\n\t- `writeKey`: Required.\ - \ Twilio Segment Write Key.\n\t- `server`: Twilio Segment Server. Available\ - \ values: `Us`, `Eu`. Default: `Us`.\n- PubNub (work in progress)" - operationId: create-integration - parameters: - - description: The identifier of the Product. - explode: false - in: path - name: productId - required: true - schema: - format: uuid - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateIntegrationModel' - text/json: - schema: - $ref: '#/components/schemas/CreateIntegrationModel' - application/*+json: - schema: - $ref: '#/components/schemas/CreateIntegrationModel' - required: true - responses: - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/IntegrationModel' - description: When the creation was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Create Integration - tags: - - Integrations - x-content-type: application/json - x-accepts: - - application/json - /v1/products/{productId}/segments: - get: - description: |- - This endpoint returns the list of the Segments that belongs to the given Product identified by the - `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - operationId: get-segments - parameters: - - description: The identifier of the Product. - explode: false - in: path - name: productId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/SegmentListModel' - type: array - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: List Segments - tags: - - Segments - x-accepts: - - application/json - post: - description: "This endpoint creates a new Segment in a specified Product \n\ - identified by the `productId` parameter, which can be obtained from the [List\ - \ Products](#operation/get-products) endpoint." - operationId: create-segment - parameters: - - description: The identifier of the Product. - explode: false - in: path - name: productId - required: true - schema: - format: uuid - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateSegmentModel' - text/json: - schema: - $ref: '#/components/schemas/CreateSegmentModel' - application/*+json: - schema: - $ref: '#/components/schemas/CreateSegmentModel' - required: true - responses: - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/SegmentModel' - description: When the creation was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Create Segment - tags: - - Segments - x-content-type: application/json - x-accepts: - - application/json - /v1/configs/{configId}/settings: - get: - description: "This endpoint returns the list of the Feature Flags and Settings\ - \ defined in a \nspecified Config, identified by the `configId` parameter." - operationId: get-settings - parameters: - - description: The identifier of the Config. - explode: false - in: path - name: configId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/SettingModel' - type: array - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: List Flags - tags: - - Feature Flags & Settings - x-accepts: - - application/json - post: - description: |- - This endpoint creates a new Feature Flag or Setting in a specified Config - identified by the `configId` parameter. - - **Important:** The `key` attribute must be unique within the given Config. - operationId: create-setting - parameters: - - description: The identifier of the Config. - explode: false - in: path - name: configId - required: true - schema: - format: uuid - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateSettingInitialValues' - text/json: - schema: - $ref: '#/components/schemas/CreateSettingInitialValues' - application/*+json: - schema: - $ref: '#/components/schemas/CreateSettingInitialValues' - required: true - responses: - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/SettingModel' - description: When the creation was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Create Flag - tags: - - Feature Flags & Settings - x-content-type: application/json - x-accepts: - - application/json - /v1/products/{productId}/auditlogs: - get: - description: "This endpoint returns the list of Audit log items for a given\ - \ Product \nand the result can be optionally filtered by Config and/or Environment." - operationId: get-auditlogs - parameters: - - description: The identifier of the Product. - explode: false - in: path - name: productId - required: true - schema: - format: uuid - type: string - style: simple - - description: The identifier of the Config. - explode: true - in: query - name: configId - required: false - schema: - format: uuid - type: string - style: form - - description: The identifier of the Environment. - explode: true - in: query - name: environmentId - required: false - schema: - format: uuid - type: string - style: form - - description: Filter Audit logs by Audit log type. - explode: true - in: query - name: auditLogType - required: false - schema: - allOf: - - $ref: '#/components/schemas/AuditLogType' - nullable: true - style: form - - description: Filter Audit logs by starting UTC date. - explode: true - in: query - name: fromUtcDateTime - required: false - schema: - format: date-time - type: string - style: form - - description: Filter Audit logs by ending UTC date. - explode: true - in: query - name: toUtcDateTime - required: false - schema: - format: date-time - type: string - style: form - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/AuditLogItemModel' - type: array - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: List Audit log items for Product - tags: - - Audit logs - x-accepts: - - application/json - /v1/settings/{settingId}/code-references: - get: - description: "" - parameters: - - description: The identifier of the Feature Flag or Setting. - explode: false - in: path - name: settingId - required: true - schema: - format: int32 - type: integer - style: simple - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/CodeReferenceModel' - type: array - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Get References for Feature Flag or Setting - tags: - - Code References - x-accepts: - - application/json - /v1/configs/{configId}: - delete: - description: This endpoint removes a Config identified by the `configId` parameter. - operationId: delete-config - parameters: - - description: The identifier of the Config. - explode: false - in: path - name: configId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "204": - description: When the delete was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Delete Config - tags: - - Configs - x-accepts: - - application/json - get: - description: |- - This endpoint returns the metadata of a Config - identified by the `configId`. - operationId: get-config - parameters: - - description: The identifier of the Config. - explode: false - in: path - name: configId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigModel' - description: "When everything is ok, the config data returned." - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Get Config - tags: - - Configs - x-accepts: - - application/json - put: - description: This endpoint updates a Config identified by the `configId` parameter. - operationId: update-config - parameters: - - description: The identifier of the Config. - explode: false - in: path - name: configId - required: true - schema: - format: uuid - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateConfigRequest' - text/json: - schema: - $ref: '#/components/schemas/UpdateConfigRequest' - application/*+json: - schema: - $ref: '#/components/schemas/UpdateConfigRequest' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigModel' - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Update Config - tags: - - Configs - x-content-type: application/json - x-accepts: - - application/json - /v1/configs/{configId}/deleted-settings: - get: - description: This endpoint returns the list of Feature Flags and Settings that - were deleted from the given Config. - operationId: get-deleted-settings - parameters: - - description: The identifier of the Config. - explode: false - in: path - name: configId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/SettingModel' - type: array - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: List Deleted Settings - tags: - - Audit logs - x-accepts: - - application/json - /v1/environments/{environmentId}: - delete: - description: |- - This endpoint removes an Environment identified by the `environmentId` parameter. - If the `cleanupAuditLogs` flag is set to true, it also deletes the audit log records related to the environment - (except for the `Created a new environment` and `Deleted an environment` records). - operationId: delete-environment - parameters: - - description: The identifier of the Environment. - explode: false - in: path - name: environmentId - required: true - schema: - format: uuid - type: string - style: simple - - description: An optional flag which indicates whether the audit log records - related to the environment should be deleted or not. - explode: true - in: query - name: cleanupAuditLogs - required: false - schema: - type: boolean - style: form - responses: - "204": - description: When the delete was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Delete Environment - tags: - - Environments - x-accepts: - - application/json - get: - description: "This endpoint returns the metadata of an Environment \nidentified\ - \ by the `environmentId`." - operationId: get-environment - parameters: - - description: The identifier of the Environment. - explode: false - in: path - name: environmentId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/EnvironmentModel' - description: "When everything is ok, the environment data returned." - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Get Environment - tags: - - Environments - x-accepts: - - application/json - put: - description: This endpoint updates an Environment identified by the `environmentId` - parameter. - operationId: update-environment - parameters: - - description: The identifier of the Environment. - explode: false - in: path - name: environmentId - required: true - schema: - format: uuid - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateEnvironmentModel' - text/json: - schema: - $ref: '#/components/schemas/UpdateEnvironmentModel' - application/*+json: - schema: - $ref: '#/components/schemas/UpdateEnvironmentModel' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/EnvironmentModel' - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Update Environment - tags: - - Environments - x-content-type: application/json - x-accepts: - - application/json - /v1/permissions/{permissionGroupId}: - delete: - description: This endpoint removes a Permission Group identified by the `permissionGroupId` - parameter. - operationId: delete-permission-group - parameters: - - description: The identifier of the Permission Group. - explode: false - in: path - name: permissionGroupId - required: true - schema: - format: int64 - type: integer - style: simple - responses: - "204": - description: When the delete was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Delete Permission Group - tags: - - Permission Groups - x-accepts: - - application/json - get: - description: "This endpoint returns the metadata of a Permission Group \nidentified\ - \ by the `permissionGroupId`." - operationId: get-permission-group - parameters: - - description: The identifier of the Permission Group. - explode: false - in: path - name: permissionGroupId - required: true - schema: - format: int64 - type: integer - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/PermissionGroupModel' - description: "When everything is ok, the permission group data returned." - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Get Permission Group - tags: - - Permission Groups - x-accepts: - - application/json - put: - description: This endpoint updates a Permission Group identified by the `permissionGroupId` - parameter. - operationId: update-permission-group - parameters: - - description: The identifier of the Permission Group. - explode: false - in: path - name: permissionGroupId - required: true - schema: - format: int64 - type: integer - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdatePermissionGroupRequest' - text/json: - schema: - $ref: '#/components/schemas/UpdatePermissionGroupRequest' - application/*+json: - schema: - $ref: '#/components/schemas/UpdatePermissionGroupRequest' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/PermissionGroupModel' - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Update Permission Group - tags: - - Permission Groups - x-content-type: application/json - x-accepts: - - application/json - /v1/integrations/{integrationId}: - delete: - description: This endpoint removes a Integration identified by the `integrationId` - parameter. - operationId: delete-integration - parameters: - - description: The identifier of the Integration. - explode: false - in: path - name: integrationId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "204": - description: When the delete was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Delete Integration - tags: - - Integrations - x-accepts: - - application/json - get: - description: |- - This endpoint returns the metadata of an Integration - identified by the `integrationId`. - operationId: get-integration - parameters: - - description: The identifier of the Integration. - explode: false - in: path - name: integrationId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/IntegrationModel' - description: "When everything is ok, the integration data returned." - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Get Integration - tags: - - Integrations - x-accepts: - - application/json - put: - description: "This endpoint updates a Config identified by the `integrationId`\ - \ parameter.\n\nThe Parameters dictionary differs for each IntegrationType:\n\ - - Datadog\n\t- `apikey`: Required. Datadog API key.\n\t- `site`: Datadog site.\ - \ Available values: `Us`, `Eu`, `Us1Fed`, `Us3`, `Us5`. Default: `Us`.\n-\ - \ Slack \n\tConnecting the Slack integration through the Public Management\ - \ API will not post messages with the ConfigCat Feature Flags Slack app but\ - \ with an incoming webhook.\n\t- `incoming_webhook.url`: Required. The [incoming\ - \ webhook URL](https://api.slack.com/messaging/webhooks) where the integration\ - \ should post messages.\n- Amplitude\n\t- `apiKey`: Required. Amplitude API\ - \ Key.\n\t- `secretKey`: Required. Amplitude Secret Key.\n- Mixpanel\n\t-\ - \ `serviceAccountUserName`: Required. Mixpanel Service Account Username.\n\ - \t- `serviceAccountSecret`: Required. Mixpanel Service Account Secret.\n\t\ - - `projectId`: Required. Mixpanel Project ID.\n\t- `server`: Mixpanel Server.\ - \ Available values: `StandardServer`, `EUResidencyServer`. Default: `StandardServer`.\n\ - - Twilio Segment\n\t- `writeKey`: Required. Twilio Segment Write Key.\n\t\ - - `server`: Twilio Segment Server. Available values: `Us`, `Eu`. Default:\ - \ `Us`.\n- PubNub (work in progress)" - operationId: update-integration - parameters: - - description: The identifier of the Integration. - explode: false - in: path - name: integrationId - required: true - schema: - format: uuid - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ModifyIntegrationRequest' - text/json: - schema: - $ref: '#/components/schemas/ModifyIntegrationRequest' - application/*+json: - schema: - $ref: '#/components/schemas/ModifyIntegrationRequest' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/IntegrationModel' - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Update Integration - tags: - - Integrations - x-content-type: application/json - x-accepts: - - application/json - /v1/integrationLink/{integrationLinkType}/{key}/details: - get: - description: "" - operationId: get-integration-link-details - parameters: - - description: The integration link's type. - explode: false - in: path - name: integrationLinkType - required: true - schema: - $ref: '#/components/schemas/IntegrationLinkType' - style: simple - - description: The key of the integration link. - explode: false - in: path - name: key - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/IntegrationLinkDetailsModel' - description: "When everything is ok, the details for the integration link\ - \ returned." - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Get Integration link - tags: - - Integration links - x-accepts: - - application/json - /v1/configs/{configId}/environments/{environmentId}: - get: - description: This endpoint returns the SDK Key for your Config in a specified - Environment. - operationId: get-sdk-keys - parameters: - - description: The identifier of the Config. - explode: false - in: path - name: configId - required: true - schema: - format: uuid - type: string - style: simple - - description: The identifier of the Environment. - explode: false - in: path - name: environmentId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SdkKeysModel' - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Get SDK Key - tags: - - SDK Keys - x-accepts: - - application/json - /v1/me: - get: - description: "" - operationId: get-me - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/MeModel' - description: "" - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Get authenticated user details - tags: - - Me - x-accepts: - - application/json - /v1/organizations/{organizationId}/auditlogs: - get: - description: "This endpoint returns the list of Audit log items for a given\ - \ Organization \nand the result can be optionally filtered by Product and/or\ - \ Config and/or Environment." - operationId: get-organization-auditlogs - parameters: - - description: The identifier of the Organization. - explode: false - in: path - name: organizationId - required: true - schema: - format: uuid - type: string - style: simple - - description: The identifier of the Product. - explode: true - in: query - name: productId - required: false - schema: - format: uuid - type: string - style: form - - description: The identifier of the Config. - explode: true - in: query - name: configId - required: false - schema: - format: uuid - type: string - style: form - - description: The identifier of the Environment. - explode: true - in: query - name: environmentId - required: false - schema: - format: uuid - type: string - style: form - - description: Filter Audit logs by Audit log type. - explode: true - in: query - name: auditLogType - required: false - schema: - allOf: - - $ref: '#/components/schemas/AuditLogType' - nullable: true - style: form - - description: Filter Audit logs by starting UTC date. - explode: true - in: query - name: fromUtcDateTime - required: false - schema: - format: date-time - type: string - style: form - - description: Filter Audit logs by ending UTC date. - explode: true - in: query - name: toUtcDateTime - required: false - schema: - format: date-time - type: string - style: form - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/AuditLogItemModel' - type: array - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: List Audit log items for Organization - tags: - - Audit logs - x-accepts: - - application/json - /v1/organizations/{organizationId}/members: - get: - deprecated: true - description: "This endpoint returns the list of Members that belongs \nto the\ - \ given Organization, identified by the `organizationId` parameter.\n\nThe\ - \ results may vary based on the access level of the user who calls the endpoint:\ - \ \n- When it's called with Organization Admin privileges, the result will\ - \ contain each member in the Organization.\n- When it's called without Organization\ - \ Admin privileges, the result will contain each Organization Admin along\ - \ with members \n of those products where the caller has `Team members and\ - \ permission groups` (`canManageMembers`) permission." - operationId: get-organization-members - parameters: - - description: The identifier of the Organization. - explode: false - in: path - name: organizationId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/UserModel' - type: array - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: List Organization Members - tags: - - Members - x-accepts: - - application/json - /v2/organizations/{organizationId}/members: - get: - description: "This endpoint returns the list of Members that belongs \nto the\ - \ given Organization, identified by the `organizationId` parameter.\n\nThe\ - \ results may vary based on the access level of the user who calls the endpoint:\ - \ \n- When it's called with Organization Admin privileges, the result will\ - \ contain each member in the Organization.\n- When it's called without Organization\ - \ Admin privileges, the result will contain each Organization Admin along\ - \ with members \n of those products where the caller has `Team members and\ - \ permission groups` (`canManageMembers`) permission." - operationId: get-organization-members-v2 - parameters: - - description: The identifier of the Organization. - explode: false - in: path - name: organizationId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/OrganizationMembersModel' - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: List Organization Members - tags: - - Members - x-accepts: - - application/json - /v1/organizations/{organizationId}/invitations: - get: - description: |- - This endpoint returns the list of pending invitations within the - given Organization identified by the `organizationId` parameter. - operationId: get-pending-invitations-org - parameters: - - description: The identifier of the Organization. - explode: false - in: path - name: organizationId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/OrganizationInvitationModel' - type: array - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: List Pending Invitations in Organization - tags: - - Members - x-accepts: - - application/json - /v1/products/{productId}/invitations: - get: - description: |- - This endpoint returns the list of pending invitations within the - given Product identified by the `productId` parameter. - operationId: get-pending-invitations - parameters: - - description: The identifier of the Product. - explode: false - in: path - name: productId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/InvitationModel' - type: array - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: List Pending Invitations in Product - tags: - - Members - x-accepts: - - application/json - /v1/products/{productId}: - delete: - description: This endpoint removes a Product identified by the `productId` parameter. - operationId: delete-product - parameters: - - description: The identifier of the Product. - explode: false - in: path - name: productId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "204": - description: When the delete was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Delete Product - tags: - - Products - x-accepts: - - application/json - get: - description: "This endpoint returns the metadata of a Product \nidentified by\ - \ the `productId`." - operationId: get-product - parameters: - - description: The identifier of the Product. - explode: false - in: path - name: productId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ProductModel' - description: "When everything is ok, the product data is returned." - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Get Product - tags: - - Products - x-accepts: - - application/json - put: - description: This endpoint updates a Product identified by the `productId` parameter. - operationId: update-product - parameters: - - description: The identifier of the Product. - explode: false - in: path - name: productId - required: true - schema: - format: uuid - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateProductRequest' - text/json: - schema: - $ref: '#/components/schemas/UpdateProductRequest' - application/*+json: - schema: - $ref: '#/components/schemas/UpdateProductRequest' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ProductModel' - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Update Product - tags: - - Products - x-content-type: application/json - x-accepts: - - application/json - /v1/products/{productId}/members: - get: - description: "This endpoint returns the list of Members that belongs \nto the\ - \ given Product, identified by the `productId` parameter." - operationId: get-product-members - parameters: - - description: The identifier of the Product. - explode: false - in: path - name: productId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/MemberModel' - type: array - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: List Product Members - tags: - - Members - x-accepts: - - application/json - /v1/products/{productId}/preferences: - get: - description: "This endpoint returns the preferences of a Product \nidentified\ - \ by the `productId`." - operationId: get-product-preferences - parameters: - - description: The identifier of the Product. - explode: false - in: path - name: productId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/PreferencesModel' - description: "When everything is ok, the product preferences data is returned." - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Get Product Preferences - tags: - - Products - x-accepts: - - application/json - post: - description: This endpoint updates the preferences of a Product identified by - the `productId` parameter. - operationId: update-product-preferences - parameters: - - description: The identifier of the Product. - explode: false - in: path - name: productId - required: true - schema: - format: uuid - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdatePreferencesRequest' - text/json: - schema: - $ref: '#/components/schemas/UpdatePreferencesRequest' - application/*+json: - schema: - $ref: '#/components/schemas/UpdatePreferencesRequest' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/PreferencesModel' - description: When the update was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Update Product Preferences - tags: - - Products - x-content-type: application/json - x-accepts: - - application/json - /v1/segments/{segmentId}: - delete: - description: This endpoint removes a Segment identified by the `segmentId` parameter. - operationId: delete-segment - parameters: - - description: The identifier of the Segment. - explode: false - in: path - name: segmentId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "204": - description: When the delete was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Delete Segment - tags: - - Segments - x-accepts: - - application/json - get: - description: |- - This endpoint returns the metadata of a Segment - identified by the `segmentId`. - operationId: get-segment - parameters: - - description: The identifier of the Segment. - explode: false - in: path - name: segmentId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SegmentModel' - description: "When everything is ok, the config data returned." - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Get Segment - tags: - - Segments - x-accepts: - - application/json - put: - description: This endpoint updates a Segment identified by the `segmentId` parameter. - operationId: update-segment - parameters: - - description: The identifier of the Segment. - explode: false - in: path - name: segmentId - required: true - schema: - format: uuid - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateSegmentModel' - text/json: - schema: - $ref: '#/components/schemas/UpdateSegmentModel' - application/*+json: - schema: - $ref: '#/components/schemas/UpdateSegmentModel' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SegmentModel' - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Update Segment - tags: - - Segments - x-content-type: application/json - x-accepts: - - application/json - /v1/settings/{settingId}: - delete: - description: "This endpoint removes a Feature Flag or Setting from a specified\ - \ Config, \nidentified by the `configId` parameter." - operationId: delete-setting - parameters: - - description: The identifier of the Setting. - explode: false - in: path - name: settingId - required: true - schema: - format: int32 - type: integer - style: simple - responses: - "204": - description: When the delete was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Delete Flag - tags: - - Feature Flags & Settings - x-accepts: - - application/json - get: - description: "This endpoint returns the metadata attributes of a Feature Flag\ - \ or Setting \nidentified by the `settingId` parameter." - operationId: get-setting - parameters: - - description: The identifier of the Setting. - explode: false - in: path - name: settingId - required: true - schema: - format: int32 - type: integer - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SettingModel' - description: "When everything is ok, the setting data returned." - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Get Flag - tags: - - Feature Flags & Settings - x-accepts: - - application/json - patch: - description: "This endpoint updates the metadata of a Feature Flag or Setting\ - \ \nwith a collection of [JSON Patch](https://jsonpatch.com) operations in\ - \ a specified Config.\n\nOnly the `name`, `hint` and `tags` attributes are\ - \ modifiable by this endpoint.\nThe `tags` attribute is a simple collection\ - \ of the [tag IDs](#operation/get-tags) attached to the given setting.\n\n\ - The advantage of using JSON Patch is that you can describe individual update\ - \ operations on a resource\nwithout touching attributes that you don't want\ - \ to change.\n\nFor example: We have the following resource.\n```json\n{\n\ - \ \"settingId\": 5345,\n \"key\": \"myGrandFeature\",\n \"name\": \"Tihs\ - \ is a naem with soem typos.\",\n \"hint\": \"This flag controls my grandioso\ - \ feature.\",\n \"settingType\": \"boolean\",\n \"tags\": [\n {\n \ - \ \"tagId\": 0, \n \"name\": \"sample tag\", \n \"color\": \"\ - whale\"\n }\n ]\n}\n```\nIf we send an update request body as below (it\ - \ changes the `name` and adds the already existing tag with the id `2`):\n\ - ```json\n[\n {\n \"op\": \"replace\", \n \"path\": \"/name\", \n \ - \ \"value\": \"This is the name without typos.\"\n }, \n {\n \"op\"\ - : \"add\", \n \"path\": \"/tags/-\", \n \"value\": 2\n }\n]\n```\n\ - Only the `name` and `tags` are updated and all the other attributes remain\ - \ unchanged.\nSo we get a response like this:\n```json\n{\n \"settingId\"\ - : 5345, \n \"key\": \"myGrandFeature\", \n \"name\": \"This is the name\ - \ without typos.\", \n \"hint\": \"This flag controls my grandioso feature.\"\ - , \n \"settingType\": \"boolean\", \n \"tags\": [\n {\n \"tagId\"\ - : 0, \n \"name\": \"sample tag\", \n \"color\": \"whale\"\n },\ - \ \n {\n \"tagId\": 2, \n \"name\": \"another tag\", \n \ - \ \"color\": \"koala\"\n }\n ]\n}\n```" - operationId: update-setting - parameters: - - description: The identifier of the Setting. - explode: false - in: path - name: settingId - required: true - schema: - format: int32 - type: integer - style: simple - requestBody: - content: - application/json: - schema: - items: - $ref: '#/components/schemas/JsonPatchOperation' - type: array - text/json: - schema: - items: - $ref: '#/components/schemas/JsonPatchOperation' - type: array - application/*+json: - schema: - items: - $ref: '#/components/schemas/JsonPatchOperation' - type: array - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SettingModel' - description: When the update was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Update Flag - tags: - - Feature Flags & Settings - x-content-type: application/json - x-accepts: - - application/json - put: - description: "This endpoint replaces the whole value of a Feature Flag or Setting\n\ - identified by the `settingId` parameter.\n\n**Important:** As this endpoint\ - \ is doing a complete replace, it's important to set every other attribute\ - \ that you don't \nwant to change in its original state. Not listing one means\ - \ it will reset." - operationId: replace-setting - parameters: - - description: The identifier of the Setting. - explode: false - in: path - name: settingId - required: true - schema: - format: int32 - type: integer - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ReplaceSettingModel' - text/json: - schema: - $ref: '#/components/schemas/ReplaceSettingModel' - application/*+json: - schema: - $ref: '#/components/schemas/ReplaceSettingModel' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SettingModel' - description: When the replace was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Replace Flag - tags: - - Feature Flags & Settings - x-content-type: application/json - x-accepts: - - application/json - /v1/tags/{tagId}/settings: - get: - description: "This endpoint returns the list of the Settings that \nhas the\ - \ specified Tag, identified by the `tagId` parameter." - operationId: get-settings-by-tag - parameters: - - description: The identifier of the Tag. - explode: false - in: path - name: tagId - required: true - schema: - format: int64 - type: integer - style: simple - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/SettingModel' - type: array - description: "When everything is ok, the settings data returned." - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: List Settings by Tag - tags: - - Tags - x-accepts: - - application/json - /v1/settings/{settingKeyOrId}/value: - get: - description: "This endpoint returns the value of a Feature Flag or Setting \n\ - in a specified Environment identified by the SDK key passed\ - \ in the `X-CONFIGCAT-SDKKEY` header.\n\nThe most important attributes in\ - \ the response are the `value`, `rolloutRules` and `percentageRules`.\nThe\ - \ `value` represents what the clients will get when the evaluation requests\ - \ of our SDKs \nare not matching to any of the defined Targeting or Percentage\ - \ Rules, or when there are no additional rules to evaluate.\n\nThe `rolloutRules`\ - \ and `percentageRules` attributes are representing the current \nTargeting\ - \ and Percentage Rules configuration of the actual Feature Flag or Setting\ - \ \nin an **ordered** collection, which means the order of the returned rules\ - \ is matching to the\nevaluation order. You can read more about these rules\ - \ [here](https://configcat.com/docs/targeting/targeting-overview/)." - operationId: get-setting-value-by-sdkkey - parameters: - - description: The key or id of the Setting. - explode: false - in: path - name: settingKeyOrId - required: true - schema: - type: string - style: simple - - description: The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) - explode: false - in: header - name: X-CONFIGCAT-SDKKEY - required: false - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SettingValueModel' - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Get value - tags: - - Feature Flag & Setting values using SDK Key - x-accepts: - - application/json - patch: - description: "This endpoint updates the value of a Feature Flag or Setting \n\ - with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified\ - \ Environment\nidentified by the SDK key passed in the `X-CONFIGCAT-SDKKEY`\ - \ header.\n\nOnly the `value`, `rolloutRules` and `percentageRules` attributes\ - \ are modifiable by this endpoint.\n\nThe advantage of using JSON Patch is\ - \ that you can describe individual update operations on a resource\nwithout\ - \ touching attributes that you don't want to change. It supports collection\ - \ reordering, so it also \ncan be used for reordering the targeting rules\ - \ of a Feature Flag or Setting.\n\nFor example: We have the following resource.\n\ - ```json\n{\n \"rolloutPercentageItems\": [\n {\n \"percentage\":\ - \ 30,\n \"value\": true\n },\n {\n \"percentage\": 70,\n \ - \ \"value\": false\n }\n ],\n \"rolloutRules\": [],\n \"value\"\ - : false\n}\n```\nIf we send an update request body as below:\n```json\n[\n\ - \ {\n \"op\": \"replace\",\n \"path\": \"/value\",\n \"value\":\ - \ true\n }\n]\n```\nOnly the default served value is going to be set to `true`\ - \ and all the Percentage Rules are remaining unchanged.\nSo we get a response\ - \ like this:\n```json\n{\n \"rolloutPercentageItems\": [\n {\n \"\ - percentage\": 30,\n \"value\": true\n },\n {\n \"percentage\"\ - : 70,\n \"value\": false\n }\n ],\n \"rolloutRules\": [],\n \"\ - value\": true\n}\n```" - operationId: update-setting-value-by-sdkkey - parameters: - - description: The key or id of the Setting. - explode: false - in: path - name: settingKeyOrId - required: true - schema: - type: string - style: simple - - description: The reason note for the Audit Log if the Product's "Config changes - require a reason" preference is turned on. - explode: true - in: query - name: reason - required: false - schema: - type: string - style: form - - description: The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) - explode: false - in: header - name: X-CONFIGCAT-SDKKEY - required: false - schema: - type: string - style: simple - requestBody: - content: - application/json: - examples: - turn on a feature flag: - description: This example turns on a feature flag. - value: - - op: replace - path: /value - value: true - add percentage rules: - description: This example adds two items to the percentage evaluation - rules. - value: - - op: add - path: /rolloutPercentageItems/- - value: - percentage: 30 - value: true - - op: add - path: /rolloutPercentageItems/- - value: - percentage: 70 - value: false - add targeting rules: - description: This example adds two items to the targeting evaluation - rules. - value: - - op: add - path: /rolloutRules/- - value: - comparisonAttribute: Identifier - comparator: contains - comparisonValue: '@example.com' - value: true - - op: add - path: /rolloutRules/- - value: - comparisonAttribute: Identifier - comparator: isOneOf - comparisonValue: '@blacklist.com' - value: false - modify targeting rule: - description: This example modifies the first targeting rule's comparison - value and the second's value. - value: - - op: replace - path: /rolloutRules/0/comparisonValue - value: '@example2.com' - - op: replace - path: /rolloutRules/1/value - value: true - add segment rules: - description: This example adds a segment to the evaluation rules. - value: - - op: add - path: /rolloutRules/- - value: - segmentComparator: isIn - segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff - reorder targeting rules: - description: This example swaps the first and the second targeting - evaluation rule. - value: - - op: move - path: /rolloutRules/1 - from: /rolloutRules/0 - schema: - items: - $ref: '#/components/schemas/JsonPatchOperation' - type: array - text/json: - examples: - turn on a feature flag: - description: This example turns on a feature flag. - value: - - op: replace - path: /value - value: true - add percentage rules: - description: This example adds two items to the percentage evaluation - rules. - value: - - op: add - path: /rolloutPercentageItems/- - value: - percentage: 30 - value: true - - op: add - path: /rolloutPercentageItems/- - value: - percentage: 70 - value: false - add targeting rules: - description: This example adds two items to the targeting evaluation - rules. - value: - - op: add - path: /rolloutRules/- - value: - comparisonAttribute: Identifier - comparator: contains - comparisonValue: '@example.com' - value: true - - op: add - path: /rolloutRules/- - value: - comparisonAttribute: Identifier - comparator: isOneOf - comparisonValue: '@blacklist.com' - value: false - modify targeting rule: - description: This example modifies the first targeting rule's comparison - value and the second's value. - value: - - op: replace - path: /rolloutRules/0/comparisonValue - value: '@example2.com' - - op: replace - path: /rolloutRules/1/value - value: true - add segment rules: - description: This example adds a segment to the evaluation rules. - value: - - op: add - path: /rolloutRules/- - value: - segmentComparator: isIn - segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff - reorder targeting rules: - description: This example swaps the first and the second targeting - evaluation rule. - value: - - op: move - path: /rolloutRules/1 - from: /rolloutRules/0 - schema: - items: - $ref: '#/components/schemas/JsonPatchOperation' - type: array - application/*+json: - examples: - turn on a feature flag: - description: This example turns on a feature flag. - value: - - op: replace - path: /value - value: true - add percentage rules: - description: This example adds two items to the percentage evaluation - rules. - value: - - op: add - path: /rolloutPercentageItems/- - value: - percentage: 30 - value: true - - op: add - path: /rolloutPercentageItems/- - value: - percentage: 70 - value: false - add targeting rules: - description: This example adds two items to the targeting evaluation - rules. - value: - - op: add - path: /rolloutRules/- - value: - comparisonAttribute: Identifier - comparator: contains - comparisonValue: '@example.com' - value: true - - op: add - path: /rolloutRules/- - value: - comparisonAttribute: Identifier - comparator: isOneOf - comparisonValue: '@blacklist.com' - value: false - modify targeting rule: - description: This example modifies the first targeting rule's comparison - value and the second's value. - value: - - op: replace - path: /rolloutRules/0/comparisonValue - value: '@example2.com' - - op: replace - path: /rolloutRules/1/value - value: true - add segment rules: - description: This example adds a segment to the evaluation rules. - value: - - op: add - path: /rolloutRules/- - value: - segmentComparator: isIn - segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff - reorder targeting rules: - description: This example swaps the first and the second targeting - evaluation rule. - value: - - op: move - path: /rolloutRules/1 - from: /rolloutRules/0 - schema: - items: - $ref: '#/components/schemas/JsonPatchOperation' - type: array - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SettingValueModel' - description: "" - "204": - description: When no change applied on the resource. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Update value - tags: - - Feature Flag & Setting values using SDK Key - x-content-type: application/json - x-accepts: - - application/json - put: - description: "This endpoint replaces the value of a Feature Flag or Setting\ - \ \nin a specified Environment identified by the SDK key\ - \ passed in the `X-CONFIGCAT-SDKKEY` header.\n\nOnly the `value`, `rolloutRules`\ - \ and `percentageRules` attributes are modifiable by this endpoint.\n\n**Important:**\ - \ As this endpoint is doing a complete replace, it's important to set every\ - \ other attribute that you don't \nwant to change to its original state. Not\ - \ listing one means it will reset.\n\nFor example: We have the following resource.\n\ - ```json\n{\n \"rolloutPercentageItems\": [\n {\n \"percentage\":\ - \ 30,\n \"value\": true\n },\n {\n \"percentage\": 70,\n \ - \ \"value\": false\n }\n ],\n \"rolloutRules\": [],\n \"value\"\ - : false\n}\n```\nIf we send a replace request body as below:\n```json\n{\n\ - \ \"value\": true\n}\n```\nThen besides that the default served value is\ - \ set to `true`, all the Percentage Rules are deleted. \nSo we get a response\ - \ like this:\n```json\n{\n \"rolloutPercentageItems\": [],\n \"rolloutRules\"\ - : [],\n \"value\": true\n}\n```" - operationId: replace-setting-value-by-sdkkey - parameters: - - description: The key or id of the Setting. - explode: false - in: path - name: settingKeyOrId - required: true - schema: - type: string - style: simple - - description: The reason note for the Audit Log if the Product's "Config changes - require a reason" preference is turned on. - explode: true - in: query - name: reason - required: false - schema: - type: string - style: form - - description: The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) - explode: false - in: header - name: X-CONFIGCAT-SDKKEY - required: false - schema: - type: string - style: simple - requestBody: - content: - application/json: - examples: - simple: - description: This example turns on a feature flag. - value: - value: true - advanced: - description: This example turns on a feature flag and adds two items - to its percentage evaluation rules. - value: - value: true - rolloutPercentageItems: - - percentage: 30 - value: true - - percentage: 70 - value: false - schema: - $ref: '#/components/schemas/UpdateSettingValueModel' - text/json: - examples: - simple: - description: This example turns on a feature flag. - value: - value: true - advanced: - description: This example turns on a feature flag and adds two items - to its percentage evaluation rules. - value: - value: true - rolloutPercentageItems: - - percentage: 30 - value: true - - percentage: 70 - value: false - schema: - $ref: '#/components/schemas/UpdateSettingValueModel' - application/*+json: - examples: - simple: - description: This example turns on a feature flag. - value: - value: true - advanced: - description: This example turns on a feature flag and adds two items - to its percentage evaluation rules. - value: - value: true - rolloutPercentageItems: - - percentage: 30 - value: true - - percentage: 70 - value: false - schema: - $ref: '#/components/schemas/UpdateSettingValueModel' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SettingValueModel' - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Replace value - tags: - - Feature Flag & Setting values using SDK Key - x-content-type: application/json - x-accepts: - - application/json - /v1/environments/{environmentId}/settings/{settingId}/value: - get: - description: "This endpoint returns the value of a Feature Flag or Setting \n\ - in a specified Environment identified by the `environmentId` parameter.\n\n\ - The most important attributes in the response are the `value`, `rolloutRules`\ - \ and `percentageRules`.\nThe `value` represents what the clients will get\ - \ when the evaluation requests of our SDKs \nare not matching to any of the\ - \ defined Targeting or Percentage Rules, or when there are no additional rules\ - \ to evaluate.\n\nThe `rolloutRules` and `percentageRules` attributes are\ - \ representing the current \nTargeting and Percentage Rules configuration\ - \ of the actual Feature Flag or Setting \nin an **ordered** collection, which\ - \ means the order of the returned rules is matching to the\nevaluation order.\ - \ You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview)." - operationId: get-setting-value - parameters: - - description: The identifier of the Environment. - explode: false - in: path - name: environmentId - required: true - schema: - format: uuid - type: string - style: simple - - description: The id of the Setting. - explode: false - in: path - name: settingId - required: true - schema: - format: int32 - type: integer - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SettingValueModel' - description: "When everything is ok, the setting value data returned." - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Get value - tags: - - Feature Flag & Setting values - x-accepts: - - application/json - patch: - description: "This endpoint updates the value of a Feature Flag or Setting \n\ - with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified\ - \ Environment.\n\nOnly the `value`, `rolloutRules` and `percentageRules` attributes\ - \ are modifiable by this endpoint.\n\nThe advantage of using JSON Patch is\ - \ that you can describe individual update operations on a resource\nwithout\ - \ touching attributes that you don't want to change. It supports collection\ - \ reordering, so it also \ncan be used for reordering the targeting rules\ - \ of a Feature Flag or Setting.\n\nFor example: We have the following resource.\n\ - ```json\n{\n \"rolloutPercentageItems\": [\n {\n \"percentage\":\ - \ 30,\n \"value\": true\n },\n {\n \"percentage\": 70,\n \ - \ \"value\": false\n }\n ],\n \"rolloutRules\": [],\n \"value\"\ - : false\n}\n```\nIf we send an update request body as below:\n```json\n[\n\ - \ {\n \"op\": \"replace\",\n \"path\": \"/value\",\n \"value\":\ - \ true\n }\n]\n```\nOnly the default value is going to be set to `true` and\ - \ all the Percentage Rules are remaining unchanged.\nSo we get a response\ - \ like this:\n```json\n{\n \"rolloutPercentageItems\": [\n {\n \"\ - percentage\": 30,\n \"value\": true\n },\n {\n \"percentage\"\ - : 70,\n \"value\": false\n }\n ],\n \"rolloutRules\": [],\n \"\ - value\": true\n}\n```\n\nThe `rolloutRules` property describes two types of\ - \ rules:\n\n- **Targeting rules**: When you want to add or update a targeting\ - \ rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members\ - \ are required.\n- **Segment rules**: When you want to add add or update a\ - \ segment rule, the `segmentId` which identifies the desired segment and the\ - \ `segmentComparator` members are required." - operationId: update-setting-value - parameters: - - description: The identifier of the Environment. - explode: false - in: path - name: environmentId - required: true - schema: - format: uuid - type: string - style: simple - - description: The id of the Setting. - explode: false - in: path - name: settingId - required: true - schema: - format: int32 - type: integer - style: simple - - description: The reason note for the Audit Log if the Product's "Config changes - require a reason" preference is turned on. - explode: true - in: query - name: reason - required: false - schema: - type: string - style: form - requestBody: - content: - application/json: - examples: - turn on a feature flag: - description: This example turns on a feature flag. - value: - - op: replace - path: /value - value: true - add percentage rules: - description: This example adds two items to the percentage evaluation - rules. - value: - - op: add - path: /rolloutPercentageItems/- - value: - percentage: 30 - value: true - - op: add - path: /rolloutPercentageItems/- - value: - percentage: 70 - value: false - add targeting rules: - description: This example adds two items to the targeting evaluation - rules. - value: - - op: add - path: /rolloutRules/- - value: - comparisonAttribute: Identifier - comparator: contains - comparisonValue: '@example.com' - value: true - - op: add - path: /rolloutRules/- - value: - comparisonAttribute: Identifier - comparator: isOneOf - comparisonValue: '@blacklist.com' - value: false - modify targeting rule: - description: This example modifies the first targeting rule's comparison - value and the second's value. - value: - - op: replace - path: /rolloutRules/0/comparisonValue - value: '@example2.com' - - op: replace - path: /rolloutRules/1/value - value: true - add segment rules: - description: This example adds a segment to the evaluation rules. - value: - - op: add - path: /rolloutRules/- - value: - segmentComparator: isIn - segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff - reorder targeting rules: - description: This example swaps the first and the second targeting - evaluation rule. - value: - - op: move - path: /rolloutRules/1 - from: /rolloutRules/0 - schema: - items: - $ref: '#/components/schemas/JsonPatchOperation' - type: array - text/json: - examples: - turn on a feature flag: - description: This example turns on a feature flag. - value: - - op: replace - path: /value - value: true - add percentage rules: - description: This example adds two items to the percentage evaluation - rules. - value: - - op: add - path: /rolloutPercentageItems/- - value: - percentage: 30 - value: true - - op: add - path: /rolloutPercentageItems/- - value: - percentage: 70 - value: false - add targeting rules: - description: This example adds two items to the targeting evaluation - rules. - value: - - op: add - path: /rolloutRules/- - value: - comparisonAttribute: Identifier - comparator: contains - comparisonValue: '@example.com' - value: true - - op: add - path: /rolloutRules/- - value: - comparisonAttribute: Identifier - comparator: isOneOf - comparisonValue: '@blacklist.com' - value: false - modify targeting rule: - description: This example modifies the first targeting rule's comparison - value and the second's value. - value: - - op: replace - path: /rolloutRules/0/comparisonValue - value: '@example2.com' - - op: replace - path: /rolloutRules/1/value - value: true - add segment rules: - description: This example adds a segment to the evaluation rules. - value: - - op: add - path: /rolloutRules/- - value: - segmentComparator: isIn - segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff - reorder targeting rules: - description: This example swaps the first and the second targeting - evaluation rule. - value: - - op: move - path: /rolloutRules/1 - from: /rolloutRules/0 - schema: - items: - $ref: '#/components/schemas/JsonPatchOperation' - type: array - application/*+json: - examples: - turn on a feature flag: - description: This example turns on a feature flag. - value: - - op: replace - path: /value - value: true - add percentage rules: - description: This example adds two items to the percentage evaluation - rules. - value: - - op: add - path: /rolloutPercentageItems/- - value: - percentage: 30 - value: true - - op: add - path: /rolloutPercentageItems/- - value: - percentage: 70 - value: false - add targeting rules: - description: This example adds two items to the targeting evaluation - rules. - value: - - op: add - path: /rolloutRules/- - value: - comparisonAttribute: Identifier - comparator: contains - comparisonValue: '@example.com' - value: true - - op: add - path: /rolloutRules/- - value: - comparisonAttribute: Identifier - comparator: isOneOf - comparisonValue: '@blacklist.com' - value: false - modify targeting rule: - description: This example modifies the first targeting rule's comparison - value and the second's value. - value: - - op: replace - path: /rolloutRules/0/comparisonValue - value: '@example2.com' - - op: replace - path: /rolloutRules/1/value - value: true - add segment rules: - description: This example adds a segment to the evaluation rules. - value: - - op: add - path: /rolloutRules/- - value: - segmentComparator: isIn - segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff - reorder targeting rules: - description: This example swaps the first and the second targeting - evaluation rule. - value: - - op: move - path: /rolloutRules/1 - from: /rolloutRules/0 - schema: - items: - $ref: '#/components/schemas/JsonPatchOperation' - type: array - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SettingValueModel' - description: When the patch was successful. - "204": - description: When no change applied on the resource. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Update value - tags: - - Feature Flag & Setting values - x-content-type: application/json - x-accepts: - - application/json - put: - description: "This endpoint replaces the whole value of a Feature Flag or Setting\ - \ in a specified Environment.\n\nOnly the `value`, `rolloutRules` and `percentageRules`\ - \ attributes are modifiable by this endpoint.\n\n**Important:** As this endpoint\ - \ is doing a complete replace, it's important to set every other attribute\ - \ that you don't \nwant to change in its original state. Not listing one means\ - \ it will reset.\n\nFor example: We have the following resource.\n```json\n\ - {\n \"rolloutPercentageItems\": [\n {\n \"percentage\": 30,\n \ - \ \"value\": true\n },\n {\n \"percentage\": 70,\n \"value\"\ - : false\n }\n ],\n \"rolloutRules\": [],\n \"value\": false\n}\n```\n\ - If we send a replace request body as below:\n```json\n{\n \"value\": true\n\ - }\n```\nThen besides that the default value is set to `true`, all the Percentage\ - \ Rules are deleted. \nSo we get a response like this:\n```json\n{\n \"rolloutPercentageItems\"\ - : [],\n \"rolloutRules\": [],\n \"value\": true\n}\n```\n\nThe `rolloutRules`\ - \ property describes two types of rules:\n\n- **Targeting rules**: When you\ - \ want to add or update a targeting rule, the `comparator`, `comparisonAttribute`,\ - \ and `comparisonValue` members are required.\n- **Segment rules**: When you\ - \ want to add add or update a segment rule, the `segmentId` which identifies\ - \ the desired segment and the `segmentComparator` members are required." - operationId: replace-setting-value - parameters: - - description: The identifier of the Environment. - explode: false - in: path - name: environmentId - required: true - schema: - format: uuid - type: string - style: simple - - description: The id of the Setting. - explode: false - in: path - name: settingId - required: true - schema: - format: int32 - type: integer - style: simple - - description: The reason note for the Audit Log if the Product's "Config changes - require a reason" preference is turned on. - explode: true - in: query - name: reason - required: false - schema: - type: string - style: form - requestBody: - content: - application/json: - examples: - simple: - description: This example turns on a feature flag. - value: - value: true - advanced: - description: This example turns on a feature flag and adds two items - to its percentage evaluation rules. - value: - value: true - rolloutPercentageItems: - - percentage: 30 - value: true - - percentage: 70 - value: false - schema: - $ref: '#/components/schemas/UpdateSettingValueModel' - text/json: - examples: - simple: - description: This example turns on a feature flag. - value: - value: true - advanced: - description: This example turns on a feature flag and adds two items - to its percentage evaluation rules. - value: - value: true - rolloutPercentageItems: - - percentage: 30 - value: true - - percentage: 70 - value: false - schema: - $ref: '#/components/schemas/UpdateSettingValueModel' - application/*+json: - examples: - simple: - description: This example turns on a feature flag. - value: - value: true - advanced: - description: This example turns on a feature flag and adds two items - to its percentage evaluation rules. - value: - value: true - rolloutPercentageItems: - - percentage: 30 - value: true - - percentage: 70 - value: false - schema: - $ref: '#/components/schemas/UpdateSettingValueModel' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SettingValueModel' - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Replace value - tags: - - Feature Flag & Setting values - x-content-type: application/json - x-accepts: - - application/json - /v2/settings/{settingKeyOrId}/value: - get: - description: |- - This endpoint returns the value of a Feature Flag or Setting - in a specified Environment identified by the SDK key passed in the `X-CONFIGCAT-SDKKEY` header. - - The most important fields in the response are the `defaultValue`, `targetingRules`. - The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs - are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. - - The `targetingRules` represents the current - Targeting Rule configuration of the actual Feature Flag or Setting - in an **ordered** collection, which means the order of the returned rules is matching to the - evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). - - The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used at the [percentage evaluation](https://configcat.com/docs/advanced/targeting/#anatomy-of-the-percentage-based-targeting) of the Feature Flag or Setting. - operationId: get-setting-value-by-sdkkey-v2 - parameters: - - description: The key or id of the Setting. - explode: false - in: path - name: settingKeyOrId - required: true - schema: - type: string - style: simple - - description: The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) - explode: false - in: header - name: X-CONFIGCAT-SDKKEY - required: false - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SettingFormulaModel' - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Get value - tags: - - Feature Flag & Setting values using SDK Key V2 - x-accepts: - - application/json - patch: - description: |- - This endpoint updates the value of a Feature Flag or Setting - with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. - - Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. - - The advantage of using JSON Patch is that you can describe individual update operations on a resource - without touching attributes that you don't want to change. It supports collection reordering, so it also - can be used for reordering the targeting rules of a Feature Flag or Setting. - - For example: We have the following resource of a Feature Flag. - ```json - { - "defaultValue": { - "boolValue": false - }, - "targetingRules": [ - { - "conditions": [ - { - "userCondition": { - "comparisonAttribute": "Email", - "comparator": "sensitiveTextEquals", - "comparisonValue": { - "stringValue": "test@example.com" - } - } - } - ], - "percentageOptions": [], - "value": { - "boolValue": true - } - } - ] - } - ``` - If we send an update request body as below: - ```json - [ - { - "op": "replace", - "path": "/targetingRules/0/value/boolValue", - "value": true - } - ] - ``` - Only the first Targeting Rule's `value` is going to be set to `false` and all the other fields are remaining unchanged. - - So we get a response like this: - ```json - { - "defaultValue": { - "boolValue": false - }, - "targetingRules": [ - { - "conditions": [ - { - "userCondition": { - "comparisonAttribute": "Email", - "comparator": "sensitiveTextEquals", - "comparisonValue": { - "stringValue": "test@example.com" - } - } - } - ], - "percentageOptions": [], - "value": { - "boolValue": false - } - } - ] - } - ``` - operationId: update-setting-value-by-sdkkey-v2 - parameters: - - description: The key or id of the Setting. - explode: false - in: path - name: settingKeyOrId - required: true - schema: - type: string - style: simple - - description: The reason note for the Audit Log if the Product's "Config changes - require a reason" preference is turned on. - explode: true - in: query - name: reason - required: false - schema: - type: string - style: form - - description: The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) - explode: false - in: header - name: X-CONFIGCAT-SDKKEY - required: false - schema: - type: string - style: simple - requestBody: - content: - application/json: - examples: - turn on a feature flag: - description: This example turns on a feature flag. - value: - - op: replace - path: /defaultValue/boolValue - value: true - add targeting rules: - description: This example adds an evaluation rule with two conditions - to the Flag's targeting rules. - value: - - op: add - path: /targetingRules/- - value: - conditions: - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Email - comparisonValue: - stringValue: example@test.com - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Role - comparisonValue: - stringValue: Developer - value: - boolValue: false - modify targeting rule: - description: This example modifies a targeting rule's value. - value: - - op: replace - path: /targetingRules/0/value/boolValue - value: "true" - modify targeting rule's condition: - description: This example modifies a condition's comparison attribute - within a targeting rule. - value: - - op: replace - path: /targetingRules/0/conditions/0/userCondition/comparisonAttribute - value: Role - add segment condition: - description: This example adds a segment condition to a targeting - rule. - value: - - op: add - path: /targetingRules/0/conditions/- - value: - segmentCondition: - segmentComparator: isIn - segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff - add prerequisite flag condition: - description: This example adds a prerequisite flag condition to a - targeting rule. - value: - - op: add - path: /targetingRules/0/conditions/- - value: - prerequisiteFlagCondition: - prerequisiteSettingId: isIn - comparator: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff - prerequisiteComparisonValue: - boolValue: true - reorder targeting rules: - description: This example swaps the first and the second targeting - rule. - value: - - op: move - path: /targetingRules/1 - from: /targetingRules/0 - reorder targeting rule conditions: - description: This example swaps the first and the second condition - of a targeting rule. - value: - - op: move - path: /targetingRules/0/conditions/1 - from: /targetingRules/0/conditions/0 - schema: - items: - $ref: '#/components/schemas/JsonPatchOperation' - type: array - text/json: - examples: - turn on a feature flag: - description: This example turns on a feature flag. - value: - - op: replace - path: /defaultValue/boolValue - value: true - add targeting rules: - description: This example adds an evaluation rule with two conditions - to the Flag's targeting rules. - value: - - op: add - path: /targetingRules/- - value: - conditions: - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Email - comparisonValue: - stringValue: example@test.com - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Role - comparisonValue: - stringValue: Developer - value: - boolValue: false - modify targeting rule: - description: This example modifies a targeting rule's value. - value: - - op: replace - path: /targetingRules/0/value/boolValue - value: "true" - modify targeting rule's condition: - description: This example modifies a condition's comparison attribute - within a targeting rule. - value: - - op: replace - path: /targetingRules/0/conditions/0/userCondition/comparisonAttribute - value: Role - add segment condition: - description: This example adds a segment condition to a targeting - rule. - value: - - op: add - path: /targetingRules/0/conditions/- - value: - segmentCondition: - segmentComparator: isIn - segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff - add prerequisite flag condition: - description: This example adds a prerequisite flag condition to a - targeting rule. - value: - - op: add - path: /targetingRules/0/conditions/- - value: - prerequisiteFlagCondition: - prerequisiteSettingId: isIn - comparator: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff - prerequisiteComparisonValue: - boolValue: true - reorder targeting rules: - description: This example swaps the first and the second targeting - rule. - value: - - op: move - path: /targetingRules/1 - from: /targetingRules/0 - reorder targeting rule conditions: - description: This example swaps the first and the second condition - of a targeting rule. - value: - - op: move - path: /targetingRules/0/conditions/1 - from: /targetingRules/0/conditions/0 - schema: - items: - $ref: '#/components/schemas/JsonPatchOperation' - type: array - application/*+json: - examples: - turn on a feature flag: - description: This example turns on a feature flag. - value: - - op: replace - path: /defaultValue/boolValue - value: true - add targeting rules: - description: This example adds an evaluation rule with two conditions - to the Flag's targeting rules. - value: - - op: add - path: /targetingRules/- - value: - conditions: - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Email - comparisonValue: - stringValue: example@test.com - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Role - comparisonValue: - stringValue: Developer - value: - boolValue: false - modify targeting rule: - description: This example modifies a targeting rule's value. - value: - - op: replace - path: /targetingRules/0/value/boolValue - value: "true" - modify targeting rule's condition: - description: This example modifies a condition's comparison attribute - within a targeting rule. - value: - - op: replace - path: /targetingRules/0/conditions/0/userCondition/comparisonAttribute - value: Role - add segment condition: - description: This example adds a segment condition to a targeting - rule. - value: - - op: add - path: /targetingRules/0/conditions/- - value: - segmentCondition: - segmentComparator: isIn - segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff - add prerequisite flag condition: - description: This example adds a prerequisite flag condition to a - targeting rule. - value: - - op: add - path: /targetingRules/0/conditions/- - value: - prerequisiteFlagCondition: - prerequisiteSettingId: isIn - comparator: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff - prerequisiteComparisonValue: - boolValue: true - reorder targeting rules: - description: This example swaps the first and the second targeting - rule. - value: - - op: move - path: /targetingRules/1 - from: /targetingRules/0 - reorder targeting rule conditions: - description: This example swaps the first and the second condition - of a targeting rule. - value: - - op: move - path: /targetingRules/0/conditions/1 - from: /targetingRules/0/conditions/0 - schema: - items: - $ref: '#/components/schemas/JsonPatchOperation' - type: array - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SettingFormulaModel' - description: "" - "204": - description: When no change applied on the resource. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Update value - tags: - - Feature Flag & Setting values using SDK Key V2 - x-content-type: application/json - x-accepts: - - application/json - put: - description: |- - This endpoint replaces the value and the Targeting Rules of a Feature Flag or Setting - in a specified Environment identified by the SDK key passed in the `X-CONFIGCAT-SDKKEY` header. - - Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. - - **Important:** As this endpoint is doing a complete replace, it's important to set every other field that you don't - want to change to its original state. Not listing one means it will reset. - - For example: We have the following resource of a Feature Flag. - ```json - { - "defaultValue": { - "boolValue": false - }, - "targetingRules": [ - { - "conditions": [ - { - "userCondition": { - "comparisonAttribute": "Email", - "comparator": "sensitiveTextEquals", - "comparisonValue": { - "stringValue": "test@example.com" - } - } - } - ], - "percentageOptions": [], - "value": { - "boolValue": true - } - } - ] - } - ``` - If we send a replace request body as below: - ```json - { - "defaultValue": { - "boolValue": true - } - } - ``` - Then besides that the default served value is set to `true`, all the Targeting Rules are deleted. - So we get a response like this: - ```json - { - "defaultValue": { - "boolValue": true - }, - "targetingRules": [] - } - ``` - operationId: replace-setting-value-by-sdkkey-v2 - parameters: - - description: The key or id of the Setting. - explode: false - in: path - name: settingKeyOrId - required: true - schema: - type: string - style: simple - - description: The reason note for the Audit Log if the Product's "Config changes - require a reason" preference is turned on. - explode: true - in: query - name: reason - required: false - schema: - type: string - style: form - - description: The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) - explode: false - in: header - name: X-CONFIGCAT-SDKKEY - required: false - schema: - type: string - style: simple - requestBody: - content: - application/json: - examples: - simple: - description: This example turns on a feature flag. - value: - defaultValue: - boolValue: true - advanced: - description: This example turns on a feature flag and adds an evaluation - rule with two conditions to its targeting rules. - value: - defaultValue: - boolValue: true - targetingRules: - - conditions: - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Email - comparisonValue: - stringValue: example@test.com - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Role - comparisonValue: - stringValue: Developer - value: - boolValue: false - schema: - $ref: '#/components/schemas/UpdateEvaluationFormulaModel' - text/json: - examples: - simple: - description: This example turns on a feature flag. - value: - defaultValue: - boolValue: true - advanced: - description: This example turns on a feature flag and adds an evaluation - rule with two conditions to its targeting rules. - value: - defaultValue: - boolValue: true - targetingRules: - - conditions: - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Email - comparisonValue: - stringValue: example@test.com - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Role - comparisonValue: - stringValue: Developer - value: - boolValue: false - schema: - $ref: '#/components/schemas/UpdateEvaluationFormulaModel' - application/*+json: - examples: - simple: - description: This example turns on a feature flag. - value: - defaultValue: - boolValue: true - advanced: - description: This example turns on a feature flag and adds an evaluation - rule with two conditions to its targeting rules. - value: - defaultValue: - boolValue: true - targetingRules: - - conditions: - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Email - comparisonValue: - stringValue: example@test.com - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Role - comparisonValue: - stringValue: Developer - value: - boolValue: false - schema: - $ref: '#/components/schemas/UpdateEvaluationFormulaModel' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SettingFormulaModel' - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Replace value - tags: - - Feature Flag & Setting values using SDK Key V2 - x-content-type: application/json - x-accepts: - - application/json - /v2/environments/{environmentId}/settings/{settingId}/value: - get: - description: |- - This endpoint returns the value of a Feature Flag or Setting - in a specified Environment identified by the `environmentId` parameter. - - The most important fields in the response are the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute`. - The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs - are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. - - The `targetingRules` represents the current - Targeting Rule configuration of the actual Feature Flag or Setting - in an **ordered** collection, which means the order of the returned rules is matching to the - evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). - - The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used for [percentage evaluation](https://configcat.com/docs/targeting/percentage-options/) of the Feature Flag or Setting. - operationId: get-setting-value-v2 - parameters: - - description: The identifier of the Environment. - explode: false - in: path - name: environmentId - required: true - schema: - format: uuid - type: string - style: simple - - description: The id of the Setting. - explode: false - in: path - name: settingId - required: true - schema: - format: int32 - type: integer - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SettingFormulaModel' - description: "When everything is ok, the setting value data returned." - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Get value - tags: - - Feature Flag & Setting values V2 - x-accepts: - - application/json - patch: - description: |- - This endpoint updates the value of a Feature Flag or Setting - with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. - - Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. - - The advantage of using JSON Patch is that you can describe individual update operations on a resource - without touching attributes that you don't want to change. It supports collection reordering, so it also - can be used for reordering the targeting rules of a Feature Flag or Setting. - - For example: We have the following resource of a Feature Flag. - ```json - { - "defaultValue": { - "boolValue": false - }, - "targetingRules": [ - { - "conditions": [ - { - "userCondition": { - "comparisonAttribute": "Email", - "comparator": "sensitiveTextEquals", - "comparisonValue": { - "stringValue": "test@example.com" - } - } - } - ], - "percentageOptions": [], - "value": { - "boolValue": true - } - } - ] - } - ``` - If we send an update request body as below: - ```json - [ - { - "op": "replace", - "path": "/targetingRules/0/value/boolValue", - "value": true - } - ] - ``` - Only the first Targeting Rule's `value` is going to be set to `false` and all the other fields are remaining unchanged. - - So we get a response like this: - ```json - { - "defaultValue": { - "boolValue": false - }, - "targetingRules": [ - { - "conditions": [ - { - "userCondition": { - "comparisonAttribute": "Email", - "comparator": "sensitiveTextEquals", - "comparisonValue": { - "stringValue": "test@example.com" - } - } - } - ], - "percentageOptions": [], - "value": { - "boolValue": false - } - } - ] - } - ``` - operationId: update-setting-value-v2 - parameters: - - description: The identifier of the Environment. - explode: false - in: path - name: environmentId - required: true - schema: - format: uuid - type: string - style: simple - - description: The id of the Setting. - explode: false - in: path - name: settingId - required: true - schema: - format: int32 - type: integer - style: simple - - description: The reason note for the Audit Log if the Product's "Config changes - require a reason" preference is turned on. - explode: true - in: query - name: reason - required: false - schema: - type: string - style: form - requestBody: - content: - application/json: - examples: - turn on a feature flag: - description: This example turns on a feature flag. - value: - - op: replace - path: /defaultValue/boolValue - value: true - add targeting rules: - description: This example adds an evaluation rule with two conditions - to the Flag's targeting rules. - value: - - op: add - path: /targetingRules/- - value: - conditions: - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Email - comparisonValue: - stringValue: example@test.com - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Role - comparisonValue: - stringValue: Developer - value: - boolValue: false - modify targeting rule: - description: This example modifies a targeting rule's value. - value: - - op: replace - path: /targetingRules/0/value/boolValue - value: "true" - modify targeting rule's condition: - description: This example modifies a condition's comparison attribute - within a targeting rule. - value: - - op: replace - path: /targetingRules/0/conditions/0/userCondition/comparisonAttribute - value: Role - add segment condition: - description: This example adds a segment condition to a targeting - rule. - value: - - op: add - path: /targetingRules/0/conditions/- - value: - segmentCondition: - segmentComparator: isIn - segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff - add prerequisite flag condition: - description: This example adds a prerequisite flag condition to a - targeting rule. - value: - - op: add - path: /targetingRules/0/conditions/- - value: - prerequisiteFlagCondition: - prerequisiteSettingId: isIn - comparator: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff - prerequisiteComparisonValue: - boolValue: true - reorder targeting rules: - description: This example swaps the first and the second targeting - rule. - value: - - op: move - path: /targetingRules/1 - from: /targetingRules/0 - reorder targeting rule conditions: - description: This example swaps the first and the second condition - of a targeting rule. - value: - - op: move - path: /targetingRules/0/conditions/1 - from: /targetingRules/0/conditions/0 - schema: - items: - $ref: '#/components/schemas/JsonPatchOperation' - type: array - text/json: - examples: - turn on a feature flag: - description: This example turns on a feature flag. - value: - - op: replace - path: /defaultValue/boolValue - value: true - add targeting rules: - description: This example adds an evaluation rule with two conditions - to the Flag's targeting rules. - value: - - op: add - path: /targetingRules/- - value: - conditions: - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Email - comparisonValue: - stringValue: example@test.com - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Role - comparisonValue: - stringValue: Developer - value: - boolValue: false - modify targeting rule: - description: This example modifies a targeting rule's value. - value: - - op: replace - path: /targetingRules/0/value/boolValue - value: "true" - modify targeting rule's condition: - description: This example modifies a condition's comparison attribute - within a targeting rule. - value: - - op: replace - path: /targetingRules/0/conditions/0/userCondition/comparisonAttribute - value: Role - add segment condition: - description: This example adds a segment condition to a targeting - rule. - value: - - op: add - path: /targetingRules/0/conditions/- - value: - segmentCondition: - segmentComparator: isIn - segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff - add prerequisite flag condition: - description: This example adds a prerequisite flag condition to a - targeting rule. - value: - - op: add - path: /targetingRules/0/conditions/- - value: - prerequisiteFlagCondition: - prerequisiteSettingId: isIn - comparator: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff - prerequisiteComparisonValue: - boolValue: true - reorder targeting rules: - description: This example swaps the first and the second targeting - rule. - value: - - op: move - path: /targetingRules/1 - from: /targetingRules/0 - reorder targeting rule conditions: - description: This example swaps the first and the second condition - of a targeting rule. - value: - - op: move - path: /targetingRules/0/conditions/1 - from: /targetingRules/0/conditions/0 - schema: - items: - $ref: '#/components/schemas/JsonPatchOperation' - type: array - application/*+json: - examples: - turn on a feature flag: - description: This example turns on a feature flag. - value: - - op: replace - path: /defaultValue/boolValue - value: true - add targeting rules: - description: This example adds an evaluation rule with two conditions - to the Flag's targeting rules. - value: - - op: add - path: /targetingRules/- - value: - conditions: - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Email - comparisonValue: - stringValue: example@test.com - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Role - comparisonValue: - stringValue: Developer - value: - boolValue: false - modify targeting rule: - description: This example modifies a targeting rule's value. - value: - - op: replace - path: /targetingRules/0/value/boolValue - value: "true" - modify targeting rule's condition: - description: This example modifies a condition's comparison attribute - within a targeting rule. - value: - - op: replace - path: /targetingRules/0/conditions/0/userCondition/comparisonAttribute - value: Role - add segment condition: - description: This example adds a segment condition to a targeting - rule. - value: - - op: add - path: /targetingRules/0/conditions/- - value: - segmentCondition: - segmentComparator: isIn - segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff - add prerequisite flag condition: - description: This example adds a prerequisite flag condition to a - targeting rule. - value: - - op: add - path: /targetingRules/0/conditions/- - value: - prerequisiteFlagCondition: - prerequisiteSettingId: isIn - comparator: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff - prerequisiteComparisonValue: - boolValue: true - reorder targeting rules: - description: This example swaps the first and the second targeting - rule. - value: - - op: move - path: /targetingRules/1 - from: /targetingRules/0 - reorder targeting rule conditions: - description: This example swaps the first and the second condition - of a targeting rule. - value: - - op: move - path: /targetingRules/0/conditions/1 - from: /targetingRules/0/conditions/0 - schema: - items: - $ref: '#/components/schemas/JsonPatchOperation' - type: array - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SettingFormulaModel' - description: When the patch was successful. - "204": - description: When no change applied on the resource. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Update value - tags: - - Feature Flag & Setting values V2 - x-content-type: application/json - x-accepts: - - application/json - put: - description: |- - This endpoint replaces the value and the Targeting Rules of a Feature Flag or Setting - in a specified Environment identified by the SDK key passed in the `X-CONFIGCAT-SDKKEY` header. - - Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. - - **Important:** As this endpoint is doing a complete replace, it's important to set every other field that you don't - want to change to its original state. Not listing one means it will reset. - - For example: We have the following resource of a Feature Flag. - ```json - { - "defaultValue": { - "boolValue": false - }, - "targetingRules": [ - { - "conditions": [ - { - "userCondition": { - "comparisonAttribute": "Email", - "comparator": "sensitiveTextEquals", - "comparisonValue": { - "stringValue": "test@example.com" - } - } - } - ], - "percentageOptions": [], - "value": { - "boolValue": true - } - } - ] - } - ``` - If we send a replace request body as below: - ```json - { - "defaultValue": { - "boolValue": true - } - } - ``` - Then besides that the default served value is set to `true`, all the Targeting Rules are deleted. - So we get a response like this: - ```json - { - "defaultValue": { - "boolValue": true - }, - "targetingRules": [] - } - ``` - operationId: replace-setting-value-v2 - parameters: - - description: The identifier of the Environment. - explode: false - in: path - name: environmentId - required: true - schema: - format: uuid - type: string - style: simple - - description: The id of the Setting. - explode: false - in: path - name: settingId - required: true - schema: - format: int32 - type: integer - style: simple - - description: The reason note for the Audit Log if the Product's "Config changes - require a reason" preference is turned on. - explode: true - in: query - name: reason - required: false - schema: - type: string - style: form - requestBody: - content: - application/json: - examples: - simple: - description: This example turns on a feature flag. - value: - defaultValue: - boolValue: true - advanced: - description: This example turns on a feature flag and adds an evaluation - rule with two conditions to its targeting rules. - value: - defaultValue: - boolValue: true - targetingRules: - - conditions: - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Email - comparisonValue: - stringValue: example@test.com - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Role - comparisonValue: - stringValue: Developer - value: - boolValue: false - schema: - $ref: '#/components/schemas/UpdateEvaluationFormulaModel' - text/json: - examples: - simple: - description: This example turns on a feature flag. - value: - defaultValue: - boolValue: true - advanced: - description: This example turns on a feature flag and adds an evaluation - rule with two conditions to its targeting rules. - value: - defaultValue: - boolValue: true - targetingRules: - - conditions: - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Email - comparisonValue: - stringValue: example@test.com - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Role - comparisonValue: - stringValue: Developer - value: - boolValue: false - schema: - $ref: '#/components/schemas/UpdateEvaluationFormulaModel' - application/*+json: - examples: - simple: - description: This example turns on a feature flag. - value: - defaultValue: - boolValue: true - advanced: - description: This example turns on a feature flag and adds an evaluation - rule with two conditions to its targeting rules. - value: - defaultValue: - boolValue: true - targetingRules: - - conditions: - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Email - comparisonValue: - stringValue: example@test.com - - userCondition: - comparator: sensitiveTextEquals - comparisonAttribute: Role - comparisonValue: - stringValue: Developer - value: - boolValue: false - schema: - $ref: '#/components/schemas/UpdateEvaluationFormulaModel' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SettingFormulaModel' - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Replace value - tags: - - Feature Flag & Setting values V2 - x-content-type: application/json - x-accepts: - - application/json - /v1/configs/{configId}/environments/{environmentId}/values: - get: - description: "This endpoint returns the value of a specified Config's Feature\ - \ Flags or Settings identified by the `configId` parameter\nin a specified\ - \ Environment identified by the `environmentId` parameter.\n\nThe most important\ - \ attributes in the response are the `value`, `rolloutRules` and `percentageRules`.\n\ - The `value` represents what the clients will get when the evaluation requests\ - \ of our SDKs \nare not matching to any of the defined Targeting or Percentage\ - \ Rules, or when there are no additional rules to evaluate.\n\nThe `rolloutRules`\ - \ and `percentageRules` attributes are representing the current \nTargeting\ - \ and Percentage Rules configuration of the actual Feature Flag or Setting\ - \ \nin an **ordered** collection, which means the order of the returned rules\ - \ is matching to the\nevaluation order. You can read more about these rules\ - \ [here](https://configcat.com/docs/targeting/targeting-overview/)." - operationId: get-setting-values - parameters: - - description: The identifier of the Config. - explode: false - in: path - name: configId - required: true - schema: - format: uuid - type: string - style: simple - - description: The identifier of the Environment. - explode: false - in: path - name: environmentId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigSettingValuesModel' - description: "When everything is ok, the setting values returned." - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Get values - tags: - - Feature Flag & Setting values - x-accepts: - - application/json - post: - description: "This endpoint replaces the values of a specified Config's Feature\ - \ Flags or Settings identified by the `configId` parameter\nin a specified\ - \ Environment identified by the `environmentId` parameter.\n\nOnly the `value`,\ - \ `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint.\n\ - \n**Important:** As this endpoint is doing a complete replace, it's important\ - \ to set every other attribute that you don't \nwant to change in its original\ - \ state. Not listing one means it will reset.\n\nFor example: We have the\ - \ following resource.\n```json\n{\n \"settingValues\": [\n {\n \"\ - rolloutPercentageItems\": [\n {\n \"percentage\": 30,\n \ - \ \"value\": true\n },\n {\n \"percentage\"\ - : 70,\n \"value\": false\n }\n ],\n \"rolloutRules\"\ - : [],\n \"value\": false,\n \"settingId\": 1\n }\n ]\n}\n```\n\ - If we send a replace request body as below:\n```json\n{ \n \"settingValues\"\ - : [\n {\n \"value\": true,\n \"settingId\": 1\n }\n ]\n}\n\ - ```\nThen besides that the default value is set to `true`, all the Percentage\ - \ Rules are deleted. \nSo we get a response like this:\n```json\n{\n \"settingValues\"\ - : [\n {\n \"rolloutPercentageItems\": [],\n \"rolloutRules\"\ - : [],\n \"value\": true,\n \"setting\": \n {\n \"settingId\"\ - : 1\n }\n }\n ]\n}\n```\n\nThe `rolloutRules` property describes\ - \ two types of rules:\n\n- **Targeting rules**: When you want to add or update\ - \ a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue`\ - \ members are required.\n- **Segment rules**: When you want to add add or\ - \ update a segment rule, the `segmentId` which identifies the desired segment\ - \ and the `segmentComparator` members are required." - operationId: post-setting-values - parameters: - - description: The identifier of the Config. - explode: false - in: path - name: configId - required: true - schema: - format: uuid - type: string - style: simple - - description: The identifier of the Environment. - explode: false - in: path - name: environmentId - required: true - schema: - format: uuid - type: string - style: simple - - description: The reason note for the Audit Log if the Product's "Config changes - require a reason" preference is turned on. - explode: true - in: query - name: reason - required: false - schema: - type: string - style: form - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateSettingValuesWithIdModel' - text/json: - schema: - $ref: '#/components/schemas/UpdateSettingValuesWithIdModel' - application/*+json: - schema: - $ref: '#/components/schemas/UpdateSettingValuesWithIdModel' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigSettingValuesModel' - description: "When everything is ok, the updated setting values returned." - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Post values - tags: - - Feature Flag & Setting values - x-content-type: application/json - x-accepts: - - application/json - /v2/configs/{configId}/environments/{environmentId}/values: - get: - description: |- - This endpoint returns all Feature Flag and Setting values of a Config identified by the `configId` parameter - in a specified Environment identified by the `environmentId` parameter. - - The most important fields in the response are the `defaultValue`, `targetingRules`. - The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs - are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. - - The `targetingRules` represents the current - Targeting Rule configuration of the actual Feature Flag or Setting - in an **ordered** collection, which means the order of the returned rules is matching to the - evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). - - The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used for [percentage evaluation](https://configcat.com/docs/targeting/percentage-options/) of the Feature Flag or Setting. - operationId: get-setting-values-v2 - parameters: - - description: The identifier of the Config. - explode: false - in: path - name: configId - required: true - schema: - format: uuid - type: string - style: simple - - description: The identifier of the Environment. - explode: false - in: path - name: environmentId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigSettingFormulasModel' - description: "When everything is ok, the setting values returned." - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Get values - tags: - - Feature Flag & Setting values V2 - x-accepts: - - application/json - post: - description: "This endpoint batch updates the Feature Flags and Settings of\ - \ a Config identified by the `configId` parameter\nin a specified Environment\ - \ identified by the `environmentId` parameter.\n\nOnly those Feature Flags\ - \ and Settings are updated which are part of the request, all the others are\ - \ left untouched.\n\n**Important:** As this endpoint is doing a complete replace\ - \ on those Feature Flags and Settings, which are set in the request. \nIt's\ - \ important to set every other field that you don't want to change in its\ - \ original state. Not listing a field means that it will reset.\n\nFor example:\ - \ We have the following resource of a Feature Flag.\n```json\n{\n \"settingFormulas\"\ - : [\n {\n \"defaultValue\": {\n \"boolValue\": false\n \ - \ },\n \"targetingRules\": [\n {\n \"conditions\": [\n\ - \ {\n \"userCondition\": {\n \"comparisonAttribute\"\ - : \"Email\",\n \"comparator\": \"sensitiveTextEquals\",\n \ - \ \"comparisonValue\": {\n \"stringValue\"\ - : \"test@example.com\"\n }\n }\n }\n\ - \ ],\n \"percentageOptions\": [],\n \"value\":\ - \ {\n \"boolValue\": true\n }\n }\n ],\n \ - \ \"settingId\": 1\n }\n ]\n}\n```\nIf we send a batch replace request\ - \ body as below:\n```json\n{ \n \"updateFormulas\": [\n {\n \"defaultValue\"\ - : {\n \"boolValue\": false\n },\n \"settingId\": 1\n }\n\ - \ ]\n}\n```\nThen besides that the default value is set to `true`, all Targeting\ - \ Rules of the related Feature Flag are deleted.\nSo we get a response like\ - \ this:\n```json\n{\n \"settingFormulas\": [\n {\n \"defaultValue\"\ - : {\n \"boolValue\": false\n },\n \"targetingRules\": [],\n\ - \ \"setting\": \n {\n \"settingId\": 1\n }\n }\n\ - \ ]\n}\n```" - operationId: post-setting-values-v2 - parameters: - - description: The identifier of the Config. - explode: false - in: path - name: configId - required: true - schema: - format: uuid - type: string - style: simple - - description: The identifier of the Environment. - explode: false - in: path - name: environmentId - required: true - schema: - format: uuid - type: string - style: simple - - description: The reason note for the Audit Log if the Product's "Config changes - require a reason" preference is turned on. - explode: true - in: query - name: reason - required: false - schema: - type: string - style: form - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateEvaluationFormulasModel' - text/json: - schema: - $ref: '#/components/schemas/UpdateEvaluationFormulasModel' - application/*+json: - schema: - $ref: '#/components/schemas/UpdateEvaluationFormulasModel' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigSettingFormulasModel' - description: "When everything is ok, the updated setting values returned." - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Post values - tags: - - Feature Flag & Setting values V2 - x-content-type: application/json - x-accepts: - - application/json - /v1/tags/{tagId}: - delete: - description: "This endpoint deletes a Tag identified by the `tagId` parameter.\ - \ To remove a Tag from a Feature Flag or Setting use the [Update Flag](#operation/update-setting)\ - \ endpoint." - operationId: delete-tag - parameters: - - description: The identifier of the Tag. - explode: false - in: path - name: tagId - required: true - schema: - format: int64 - type: integer - style: simple - responses: - "204": - description: When the delete was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Delete Tag - tags: - - Tags - x-accepts: - - application/json - get: - description: "This endpoint returns the metadata of a Tag \nidentified by the\ - \ `tagId`." - operationId: get-tag - parameters: - - description: The identifier of the Tag. - explode: false - in: path - name: tagId - required: true - schema: - format: int64 - type: integer - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/TagModel' - description: "When everything is ok, the tag data returned." - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Get Tag - tags: - - Tags - x-accepts: - - application/json - put: - description: This endpoint updates a Tag identified by the `tagId` parameter. - operationId: update-tag - parameters: - - description: The identifier of the Tag. - explode: false - in: path - name: tagId - required: true - schema: - format: int64 - type: integer - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateTagModel' - text/json: - schema: - $ref: '#/components/schemas/UpdateTagModel' - application/*+json: - schema: - $ref: '#/components/schemas/UpdateTagModel' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/TagModel' - description: "" - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Update Tag - tags: - - Tags - x-content-type: application/json - x-accepts: - - application/json - /v1/webhooks/{webhookId}: - delete: - description: This endpoint removes a Webhook identified by the `webhookId` parameter. - operationId: delete-webhook - parameters: - - description: The identifier of the Webhook. - explode: false - in: path - name: webhookId - required: true - schema: - format: int32 - type: integer - style: simple - responses: - "204": - description: When the delete was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Delete Webhook - tags: - - Webhooks - x-accepts: - - application/json - get: - description: "This endpoint returns the metadata of a Webhook \nidentified by\ - \ the `webhookId`." - operationId: get-webhook - parameters: - - description: The identifier of the Webhook. - explode: false - in: path - name: webhookId - required: true - schema: - format: int32 - type: integer - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/WebhookModel' - description: "When everything is ok, the webhook data is returned." - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Get Webhook - tags: - - Webhooks - x-accepts: - - application/json - patch: - description: "This endpoint updates a Webhook identified by the `webhookId`\ - \ parameter with a collection of [JSON Patch](https://jsonpatch.com) operations.\n\ - \nThe advantage of using JSON Patch is that you can describe individual update\ - \ operations on a resource without touching attributes that you don't want\ - \ to change.\n\nFor example: We have the following resource.\n```json\n{\n\ - \ \"webhookId\": 6,\n \"url\": \"https://example.com/hook\",\n \"httpMethod\"\ - : \"post\",\n \"content\": \"null\",\n \"webHookHeaders\": []\n}\n```\n\ - If we send an update request body as below (it changes the `content` field\ - \ and adds a new HTTP header):\n```json\n[\n {\n \"op\": \"replace\",\ - \ \n \"path\": \"/content\", \n \"value\": \"Some webhook content.\"\ - \n }, \n {\n \"op\": \"add\", \n \"path\": \"/webHookHeaders/-\",\ - \ \n \"value\": {\n \"key\": \"X-Custom-Header\", \n \"value\"\ - : \"Custom header value\"\n }\n }\n]\n```\nOnly the `content` and `webHookHeaders`\ - \ are updated and all the other attributes remain unchanged.\nSo we get a\ - \ response like this:\n```json\n{\n \"webhookId\": 6,\n \"url\": \"https://example.com/hook\"\ - ,\n \"httpMethod\": \"post\", \n \"content\": \"Some webhook content.\"\ - , \n \"webHookHeaders\": [\n {\n \"key\": \"X-Custom-Header\", \n\ - \ \"value\": \"Custom header value\", \n \"isSecure\": false\n \ - \ }\n ]\n}\n```" - operationId: update-webhook - parameters: - - description: The identifier of the Webhook. - explode: false - in: path - name: webhookId - required: true - schema: - format: int32 - type: integer - style: simple - requestBody: - content: - application/json: - schema: - items: - $ref: '#/components/schemas/JsonPatchOperation' - type: array - text/json: - schema: - items: - $ref: '#/components/schemas/JsonPatchOperation' - type: array - application/*+json: - schema: - items: - $ref: '#/components/schemas/JsonPatchOperation' - type: array - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/WebhookModel' - description: When the update was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Update Webhook - tags: - - Webhooks - x-content-type: application/json - x-accepts: - - application/json - put: - description: |- - This endpoint replaces the whole value of a Webhook identified by the `webhookId` parameter. - - **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't - want to change in its original state. Not listing one means it will reset. - operationId: replace-webhook - parameters: - - description: The identifier of the Webhook. - explode: false - in: path - name: webhookId - required: true - schema: - format: int32 - type: integer - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/WebHookRequest' - text/json: - schema: - $ref: '#/components/schemas/WebHookRequest' - application/*+json: - schema: - $ref: '#/components/schemas/WebHookRequest' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/WebhookModel' - description: When the replace was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Replace Webhook - tags: - - Webhooks - x-content-type: application/json - x-accepts: - - application/json - /v1/webhooks/{webhookId}/keys: - get: - description: "This endpoint returns the signing keys of a Webhook \nidentified\ - \ by the `webhookId`.\n\nSigning keys are used for ensuring the Webhook requests\ - \ you receive are actually sent by ConfigCat.\n\nHere you can read more\ - \ about Webhook request verification." - operationId: get-webhook-signing-keys - parameters: - - description: The identifier of the Webhook. - explode: false - in: path - name: webhookId - required: true - schema: - format: int32 - type: integer - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/WebhookSigningKeysModel' - description: "When everything is ok, the webhook signing keys are returned." - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Get Webhook Signing Keys - tags: - - Webhooks - x-accepts: - - application/json - /v1/environments/{environmentId}/settings/{settingId}/integrationLinks/{integrationLinkType}/{key}: - delete: - description: "" - operationId: delete-integration-link - parameters: - - description: The identifier of the Environment. - explode: false - in: path - name: environmentId - required: true - schema: - format: uuid - type: string - style: simple - - description: The id of the Setting. - explode: false - in: path - name: settingId - required: true - schema: - format: int32 - type: integer - style: simple - - description: The integration's type. - explode: false - in: path - name: integrationLinkType - required: true - schema: - $ref: '#/components/schemas/IntegrationLinkType' - style: simple - - description: The key of the integration link. - explode: false - in: path - name: key - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/DeleteIntegrationLinkModel' - description: When everything is ok. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Delete Integration link - tags: - - Integration links - x-accepts: - - application/json - post: - description: "" - operationId: add-or-update-integration-link - parameters: - - description: The identifier of the Environment. - explode: false - in: path - name: environmentId - required: true - schema: - format: uuid - type: string - style: simple - - description: The id of the Setting. - explode: false - in: path - name: settingId - required: true - schema: - format: int32 - type: integer - style: simple - - description: The integration link's type. - explode: false - in: path - name: integrationLinkType - required: true - schema: - $ref: '#/components/schemas/IntegrationLinkType' - style: simple - - description: The key of the integration link. - explode: false - in: path - name: key - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AddOrUpdateIntegrationLinkModel' - text/json: - schema: - $ref: '#/components/schemas/AddOrUpdateIntegrationLinkModel' - application/*+json: - schema: - $ref: '#/components/schemas/AddOrUpdateIntegrationLinkModel' - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/IntegrationLinkModel' - description: "When everything is ok, the integration link data returned." - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Add or update Integration link - tags: - - Integration links - x-content-type: application/json - x-accepts: - - application/json - /v1/jira/environments/{environmentId}/settings/{settingId}/integrationLinks/{key}: - post: - operationId: jira-add-or-update-integration-link - parameters: - - description: The identifier of the Environment. - explode: false - in: path - name: environmentId - required: true - schema: - format: uuid - type: string - style: simple - - description: The id of the Setting. - explode: false - in: path - name: settingId - required: true - schema: - format: int32 - type: integer - style: simple - - description: The key of the integration link. - explode: false - in: path - name: key - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AddOrUpdateJiraIntegrationLinkModel' - text/json: - schema: - $ref: '#/components/schemas/AddOrUpdateJiraIntegrationLinkModel' - application/*+json: - schema: - $ref: '#/components/schemas/AddOrUpdateJiraIntegrationLinkModel' - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/IntegrationLinkModel' - description: "When everything is ok, the integration link data returned." - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - tags: - - Integration links - x-content-type: application/json - x-accepts: - - application/json - /v1/jira/connect: - post: - operationId: jira-connect - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ConnectRequest' - text/json: - schema: - $ref: '#/components/schemas/ConnectRequest' - application/*+json: - schema: - $ref: '#/components/schemas/ConnectRequest' - responses: - "200": - description: OK - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - tags: - - Integration links - x-content-type: application/json - x-accepts: - - application/json - /v1/organizations/{organizationId}/products: - post: - description: "This endpoint creates a new Product in a specified Organization\ - \ \nidentified by the `organizationId` parameter, which can be obtained from\ - \ the [List Organizations](#operation/get-organizations) endpoint." - operationId: create-product - parameters: - - description: The identifier of the Organization. - explode: false - in: path - name: organizationId - required: true - schema: - format: uuid - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateProductRequest' - text/json: - schema: - $ref: '#/components/schemas/CreateProductRequest' - application/*+json: - schema: - $ref: '#/components/schemas/CreateProductRequest' - required: true - responses: - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/ProductModel' - description: When the creation was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Create Product - tags: - - Products - x-content-type: application/json - x-accepts: - - application/json - /v1/configs/{configId}/environments/{environmentId}/webhooks: - post: - description: |- - This endpoint creates a new Webhook in a specified Product - identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - operationId: create-webhook - parameters: - - description: The identifier of the Config. - explode: false - in: path - name: configId - required: true - schema: - format: uuid - type: string - style: simple - - description: The identifier of the Environment. - explode: false - in: path - name: environmentId - required: true - schema: - format: uuid - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/WebHookRequest' - text/json: - schema: - $ref: '#/components/schemas/WebHookRequest' - application/*+json: - schema: - $ref: '#/components/schemas/WebHookRequest' - required: true - responses: - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/WebhookModel' - description: When the creation was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Create Webhook - tags: - - Webhooks - x-content-type: application/json - x-accepts: - - application/json - /v1/code-references/delete-reports: - post: - description: "" - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DeleteRepositoryReportsRequest' - text/json: - schema: - $ref: '#/components/schemas/DeleteRepositoryReportsRequest' - application/*+json: - schema: - $ref: '#/components/schemas/DeleteRepositoryReportsRequest' - required: true - responses: - "200": - description: OK - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Delete Reference reports - tags: - - Code References - x-content-type: application/json - x-accepts: - - application/json - /v1/products/{productId}/members/invite: - post: - description: This endpoint invites a Member into the given Product identified - by the `productId` parameter. - operationId: invite-member - parameters: - - description: The identifier of the Product. - explode: false - in: path - name: productId - required: true - schema: - format: uuid - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/InviteMembersRequest' - text/json: - schema: - $ref: '#/components/schemas/InviteMembersRequest' - application/*+json: - schema: - $ref: '#/components/schemas/InviteMembersRequest' - required: true - responses: - "200": - description: When the invite was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Invite Member - tags: - - Members - x-content-type: application/json - x-accepts: - - application/json - /v1/code-references: - post: - description: "" - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CodeReferenceRequest' - text/json: - schema: - $ref: '#/components/schemas/CodeReferenceRequest' - application/*+json: - schema: - $ref: '#/components/schemas/CodeReferenceRequest' - required: true - responses: - "200": - description: OK - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Upload References - tags: - - Code References - x-content-type: application/json - x-accepts: - - application/json - /v1/organizations/{organizationId}/members/{userId}: - delete: - description: "This endpoint removes a Member identified by the `userId` from\ - \ the \ngiven Organization identified by the `organizationId` parameter." - operationId: delete-organization-member - parameters: - - description: The identifier of the Organization. - explode: false - in: path - name: organizationId - required: true - schema: - format: uuid - type: string - style: simple - - description: The identifier of the Member. - explode: false - in: path - name: userId - required: true - schema: - type: string - style: simple - responses: - "204": - description: When the delete was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Delete Member from Organization - tags: - - Members - x-accepts: - - application/json - post: - description: "This endpoint updates the permissions of a Member identified by\ - \ the `userId`. \nThis endpoint can also be used to move a Member between\ - \ Permission Groups within a Product.\nOnly a single Permission Group can\ - \ be set per Product." - operationId: add-member-to-group - parameters: - - description: The identifier of the Organization. - explode: false - in: path - name: organizationId - required: true - schema: - format: uuid - type: string - style: simple - - description: The identifier of the Member. - explode: false - in: path - name: userId - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateMemberPermissionsRequest' - text/json: - schema: - $ref: '#/components/schemas/UpdateMemberPermissionsRequest' - application/*+json: - schema: - $ref: '#/components/schemas/UpdateMemberPermissionsRequest' - required: true - responses: - "200": - description: When the update was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Update Member Permissions - tags: - - Members - x-content-type: application/json - x-accepts: - - application/json - /v1/invitations/{invitationId}: - delete: - description: This endpoint removes an Invitation identified by the `invitationId` - parameter. - operationId: delete-invitation - parameters: - - description: The identifier of the Invitation. - explode: false - in: path - name: invitationId - required: true - schema: - format: uuid - type: string - style: simple - responses: - "204": - description: When the delete was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Delete Invitation - tags: - - Members - x-accepts: - - application/json - /v1/products/{productId}/members/{userId}: - delete: - description: "This endpoint removes a Member identified by the `userId` from\ - \ the \ngiven Product identified by the `productId` parameter." - operationId: delete-product-member - parameters: - - description: The identifier of the Product. - explode: false - in: path - name: productId - required: true - schema: - format: uuid - type: string - style: simple - - description: The identifier of the Member. - explode: false - in: path - name: userId - required: true - schema: - type: string - style: simple - responses: - "204": - description: When the delete was successful. - "400": - description: Bad request. - "404": - description: Not found. - "429": - description: Too many requests. In case of the request rate exceeds the - rate limits. - summary: Delete Member from Product - tags: - - Members - x-accepts: - - application/json -components: - schemas: - AccessType: - description: Represent the Feature Management permission. - enum: - - readOnly - - full - - custom - type: string - AddOrUpdateIntegrationLinkModel: - example: - description: description - url: url - properties: - description: - maxLength: 1000 - nullable: true - type: string - url: - maxLength: 1000 - nullable: true - type: string - type: object - AddOrUpdateJiraIntegrationLinkModel: - example: - jiraJwtToken: jiraJwtToken - clientKey: clientKey - description: description - url: url - properties: - jiraJwtToken: - maxLength: 15000 - minLength: 0 - type: string - clientKey: - maxLength: 255 - minLength: 0 - type: string - description: - maxLength: 1000 - minLength: 0 - nullable: true - type: string - url: - maxLength: 1000 - minLength: 0 - nullable: true - type: string - required: - - clientKey - - jiraJwtToken - type: object - AuditLogItemModel: - example: - auditLogTypeEnum: productCreated - auditLogDateTime: 2000-01-23T04:56:07.000+00:00 - auditLogType: auditLogType - auditLogId: 0 - truncated: true - why: why - userEmail: userEmail - where: where - details: details - actionTarget: actionTarget - userName: userName - changeSetId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - properties: - auditLogId: - format: int64 - type: integer - auditLogDateTime: - format: date-time - type: string - auditLogTypeEnum: - $ref: '#/components/schemas/AuditLogType' - changeSetId: - format: uuid - nullable: true - type: string - truncated: - type: boolean - auditLogType: - nullable: true - type: string - userEmail: - nullable: true - type: string - userName: - nullable: true - type: string - where: - nullable: true - type: string - why: - nullable: true - type: string - actionTarget: - nullable: true - type: string - details: - nullable: true - type: string - type: object - AuditLogType: - enum: - - productCreated - - productChanged - - productOwnershipTransferred - - productDeleted - - productsReordered - - teamMemberInvited - - teamMemberInvitationRevoked - - teamMemberJoined - - teamMemberPermissionGroupChanged - - teamMemberRemoved - - teamMemberLeft - - teamMemberInvitationChanged - - teamMemberInvitationResent - - teamMemberInvitationRejected - - configCreated - - configChanged - - configDeleted - - configsReordered - - environmentCreated - - environmentChanged - - environmentDeleted - - environmentsReordered - - settingCreated - - settingChanged - - settingDeleted - - settingsReordered - - settingValueChanged - - webHookCreated - - webHookChanged - - webHookDeleted - - permissionGroupCreated - - permissionGroupChanged - - permissionGroupDeleted - - permissionGroupDefault - - apiKeyAdded - - apiKeyRemoved - - integrationAdded - - integrationChanged - - integrationRemoved - - apiKeyConnected - - integrationLinkAdded - - integrationLinkRemoved - - organizationAdded - - organizationRemoved - - organizationChanged - - organizationSubscriptionTypeChanged - - organizationAdminChanged - - organizationAdminLeft - - twoFactorDisabledForMember - - tagAdded - - tagChanged - - tagRemoved - - settingTagAdded - - settingTagRemoved - - publicApiAccessTokenAdded - - publicApiAccessTokenRemoved - - domainAdded - - domainVerified - - domainRemoved - - domainSamlConfigured - - domainSamlDeleted - - autoProvisioningConfigurationChanged - - samlIdpConfigurationAdded - - samlIdpConfigurationRemoved - - samlIdpConfigurationUpdated - - autoProvisioningEnabledChanged - - organizationMemberJoined - - organizationMemberProductJoinRequested - - organizationMemberProductJoinRequestRejected - - organizationMemberProductJoinRequestApproved - - organizationMemberRemoved - - codeReferencesUploaded - - codeReferenceDeleted - - codeReferenceStaleBranchDeleted - - segmentCreated - - segmentChanged - - segmentDeleted - - webhookSigningKeyDeleted - - webhookSigningKeyCreated - - userProvisioningConfigurationChanged - - syncGroupProvisioningRuleChanged - - syncGroupsReordered - - syncUserProvisioningEnabled - - syncUserProvisioningDisabled - - userEmailChanged - - userFullNameChanged - - userDisabled - - awsConnected - - awsDisconnected - type: string - CodeReferenceModel: - example: - codeReferenceId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - references: - - file: file - referenceLine: - lineText: lineText - lineNumber: 0 - fileUrl: fileUrl - postLines: - - lineText: lineText - lineNumber: 0 - - lineText: lineText - lineNumber: 0 - preLines: - - lineText: lineText - lineNumber: 0 - - lineText: lineText - lineNumber: 0 - - file: file - referenceLine: - lineText: lineText - lineNumber: 0 - fileUrl: fileUrl - postLines: - - lineText: lineText - lineNumber: 0 - - lineText: lineText - lineNumber: 0 - preLines: - - lineText: lineText - lineNumber: 0 - - lineText: lineText - lineNumber: 0 - commitUrl: commitUrl - uploader: uploader - repository: repository - branch: branch - syncedAt: 2000-01-23T04:56:07.000+00:00 - commitHash: commitHash - properties: - branch: - description: The source control branch on where the scan was performed. - (Source of the branch selector on the ConfigCat Dashboard) - nullable: true - type: string - references: - description: The actual references to the given Feature Flag or Setting. - items: - $ref: '#/components/schemas/ReferenceLines' - nullable: true - type: array - commitUrl: - description: The related commit's URL. - nullable: true - type: string - commitHash: - description: The related commit's hash. - nullable: true - type: string - syncedAt: - description: The date and time when the reference report was uploaded. - format: date-time - type: string - repository: - description: The source control repository that contains the scanned code. - nullable: true - type: string - codeReferenceId: - description: The identifier of the reference report. - format: uuid - type: string - uploader: - description: The code reference scanning tool's name. - nullable: true - type: string - type: object - CodeReferenceRequest: - example: - flagReferences: - - references: - - file: file - referenceLine: - lineText: lineText - lineNumber: 0 - fileUrl: fileUrl - postLines: - - lineText: lineText - lineNumber: 0 - - lineText: lineText - lineNumber: 0 - preLines: - - lineText: lineText - lineNumber: 0 - - lineText: lineText - lineNumber: 0 - - file: file - referenceLine: - lineText: lineText - lineNumber: 0 - fileUrl: fileUrl - postLines: - - lineText: lineText - lineNumber: 0 - - lineText: lineText - lineNumber: 0 - preLines: - - lineText: lineText - lineNumber: 0 - - lineText: lineText - lineNumber: 0 - settingId: 0 - - references: - - file: file - referenceLine: - lineText: lineText - lineNumber: 0 - fileUrl: fileUrl - postLines: - - lineText: lineText - lineNumber: 0 - - lineText: lineText - lineNumber: 0 - preLines: - - lineText: lineText - lineNumber: 0 - - lineText: lineText - lineNumber: 0 - - file: file - referenceLine: - lineText: lineText - lineNumber: 0 - fileUrl: fileUrl - postLines: - - lineText: lineText - lineNumber: 0 - - lineText: lineText - lineNumber: 0 - preLines: - - lineText: lineText - lineNumber: 0 - - lineText: lineText - lineNumber: 0 - settingId: 0 - configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - commitUrl: commitUrl - uploader: uploader - activeBranches: - - activeBranches - - activeBranches - repository: repository - branch: branch - commitHash: commitHash - properties: - configId: - description: The Config's identifier the scanning was performed against. - format: uuid - type: string - repository: - description: The source control repository that contains the scanned code. - (Source of the repository selector on the ConfigCat Dashboard) - maxLength: 255 - minLength: 1 - type: string - branch: - description: The source control branch on where the scan was performed. - (Source of the branch selector on the ConfigCat Dashboard) - maxLength: 255 - minLength: 1 - type: string - commitUrl: - description: The related commit's URL. (Appears on the ConfigCat Dashboard) - maxLength: 1000 - minLength: 0 - nullable: true - type: string - commitHash: - description: The related commit's hash. (Appears on the ConfigCat Dashboard) - maxLength: 255 - minLength: 0 - nullable: true - type: string - uploader: - description: The scanning tool's name. (Appears on the ConfigCat Dashboard) - maxLength: 255 - minLength: 0 - nullable: true - type: string - activeBranches: - description: The currently active branches of the repository. Each previously - uploaded report that belongs to a non-reported active branch is being - deleted. - items: - type: string - nullable: true - type: array - flagReferences: - description: The actual code reference collection. - items: - $ref: '#/components/schemas/FlagReference' - nullable: true - type: array - required: - - branch - - configId - - repository - type: object - ComparisonValueListModel: - example: - hint: hint - value: value - properties: - value: - description: The actual comparison value. - minLength: 1 - type: string - hint: - description: An optional hint for the comparison value. - maxLength: 1500 - minLength: 0 - nullable: true - type: string - required: - - value - type: object - ComparisonValueModel: - description: The value that the user object's attribute is compared to. - example: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - properties: - stringValue: - description: The string representation of the comparison value. - nullable: true - type: string - doubleValue: - description: The number representation of the comparison value. - format: double - nullable: true - type: number - listValue: - description: The list representation of the comparison value. - items: - $ref: '#/components/schemas/ComparisonValueListModel' - nullable: true - type: array - type: object - ConditionModel: - example: - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - properties: - userCondition: - $ref: '#/components/schemas/UserConditionModel' - segmentCondition: - $ref: '#/components/schemas/SegmentConditionModel' - prerequisiteFlagCondition: - $ref: '#/components/schemas/PrerequisiteFlagConditionModel' - type: object - ConfigModel: - description: Details of the Config. - example: - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - description: description - migratedConfigId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - evaluationVersion: v1 - order: 0 - properties: - product: - $ref: '#/components/schemas/ProductModel' - configId: - description: Identifier of the Config. - format: uuid - type: string - name: - description: Name of the Config. - nullable: true - type: string - description: - description: Description of the Config. - nullable: true - type: string - order: - description: The order of the Config represented on the ConfigCat Dashboard. - format: int32 - type: integer - migratedConfigId: - format: uuid - nullable: true - type: string - evaluationVersion: - $ref: '#/components/schemas/EvaluationVersion' - type: object - ConfigSettingFormulaModel: - example: - lastVersionId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - targetingRules: - - percentageOptions: - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentageOptions: - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - percentageEvaluationAttribute: percentageEvaluationAttribute - defaultValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - settingIdsWherePrerequisite: - - 0 - - 0 - lastUpdaterUserEmail: lastUpdaterUserEmail - integrationLinks: - - integrationLinkType: trello - description: description - key: key - url: url - - integrationLinkType: trello - description: description - key: key - url: url - settingTags: - - color: color - tagId: 1 - name: name - settingTagId: 6 - - color: color - tagId: 1 - name: name - settingTagId: 6 - setting: - createdAt: 2000-01-23T04:56:07.000+00:00 - creatorEmail: creatorEmail - hint: hint - name: name - creatorFullName: creatorFullName - isWatching: true - settingType: boolean - key: key - settingId: 0 - order: 6 - updatedAt: 2000-01-23T04:56:07.000+00:00 - lastUpdaterUserFullName: lastUpdaterUserFullName - properties: - lastVersionId: - format: uuid - type: string - defaultValue: - $ref: '#/components/schemas/ValueModel' - targetingRules: - description: The targeting rules of the Feature Flag or Setting. - items: - $ref: '#/components/schemas/TargetingRuleModel' - nullable: true - type: array - setting: - $ref: '#/components/schemas/SettingDataModel' - updatedAt: - description: The last updated date and time when the Feature Flag or Setting. - format: date-time - nullable: true - type: string - percentageEvaluationAttribute: - description: "The user attribute used for percentage evaluation. If not\ - \ set, it defaults to the `Identifier` user object attribute." - nullable: true - type: string - lastUpdaterUserEmail: - description: The email of the user who last updated the Feature Flag or - Setting. - nullable: true - type: string - lastUpdaterUserFullName: - description: The name of the user who last updated the Feature Flag or Setting. - nullable: true - type: string - integrationLinks: - description: The integration links attached to the Feature Flag or Setting. - items: - $ref: '#/components/schemas/IntegrationLinkModel' - nullable: true - type: array - settingTags: - description: The tags attached to the Feature Flag or Setting. - items: - $ref: '#/components/schemas/SettingTagModel' - nullable: true - type: array - settingIdsWherePrerequisite: - description: List of Feature Flag and Setting IDs where the actual Feature - Flag or Setting is prerequisite. - items: - format: int32 - type: integer - nullable: true - type: array - type: object - ConfigSettingFormulasModel: - example: - environment: - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - color: color - name: name - description: description - order: 0 - reasonRequired: true - featureFlagLimitations: - maxComparisonValueListItemLength: 9 - maxComparisonValueListLength: 7 - maxPercentageOptionCount: 5 - maxConditionPerTargetingRuleCount: 2 - maxComparisonValueLength: 2 - maxStringFlagValueLength: 3 - maxTargetingRuleCount: 5 - settingFormulas: - - lastVersionId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - targetingRules: - - percentageOptions: - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentageOptions: - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - percentageEvaluationAttribute: percentageEvaluationAttribute - defaultValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - settingIdsWherePrerequisite: - - 0 - - 0 - lastUpdaterUserEmail: lastUpdaterUserEmail - integrationLinks: - - integrationLinkType: trello - description: description - key: key - url: url - - integrationLinkType: trello - description: description - key: key - url: url - settingTags: - - color: color - tagId: 1 - name: name - settingTagId: 6 - - color: color - tagId: 1 - name: name - settingTagId: 6 - setting: - createdAt: 2000-01-23T04:56:07.000+00:00 - creatorEmail: creatorEmail - hint: hint - name: name - creatorFullName: creatorFullName - isWatching: true - settingType: boolean - key: key - settingId: 0 - order: 6 - updatedAt: 2000-01-23T04:56:07.000+00:00 - lastUpdaterUserFullName: lastUpdaterUserFullName - - lastVersionId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - targetingRules: - - percentageOptions: - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentageOptions: - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - percentageEvaluationAttribute: percentageEvaluationAttribute - defaultValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - settingIdsWherePrerequisite: - - 0 - - 0 - lastUpdaterUserEmail: lastUpdaterUserEmail - integrationLinks: - - integrationLinkType: trello - description: description - key: key - url: url - - integrationLinkType: trello - description: description - key: key - url: url - settingTags: - - color: color - tagId: 1 - name: name - settingTagId: 6 - - color: color - tagId: 1 - name: name - settingTagId: 6 - setting: - createdAt: 2000-01-23T04:56:07.000+00:00 - creatorEmail: creatorEmail - hint: hint - name: name - creatorFullName: creatorFullName - isWatching: true - settingType: boolean - key: key - settingId: 0 - order: 6 - updatedAt: 2000-01-23T04:56:07.000+00:00 - lastUpdaterUserFullName: lastUpdaterUserFullName - readOnly: true - config: - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - description: description - migratedConfigId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - evaluationVersion: v1 - order: 0 - properties: - config: - $ref: '#/components/schemas/ConfigModel' - environment: - $ref: '#/components/schemas/EnvironmentModel' - readOnly: - type: boolean - settingFormulas: - description: Evaluation descriptors of each updated Feature Flag and Setting. - items: - $ref: '#/components/schemas/ConfigSettingFormulaModel' - nullable: true - type: array - featureFlagLimitations: - $ref: '#/components/schemas/FeatureFlagLimitations' - type: object - ConfigSettingValueModel: - example: - rolloutRules: - - comparator: isOneOf - comparisonValue: comparisonValue - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn - value: "" - comparisonAttribute: comparisonAttribute - - comparator: isOneOf - comparisonValue: comparisonValue - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn - value: "" - comparisonAttribute: comparisonAttribute - rolloutPercentageItems: - - percentage: 0 - value: "" - - percentage: 0 - value: "" - lastUpdaterUserEmail: lastUpdaterUserEmail - value: "" - integrationLinks: - - integrationLinkType: trello - description: description - key: key - url: url - - integrationLinkType: trello - description: description - key: key - url: url - settingTags: - - color: color - tagId: 1 - name: name - settingTagId: 6 - - color: color - tagId: 1 - name: name - settingTagId: 6 - setting: - createdAt: 2000-01-23T04:56:07.000+00:00 - creatorEmail: creatorEmail - hint: hint - name: name - creatorFullName: creatorFullName - isWatching: true - settingType: boolean - key: key - settingId: 0 - order: 6 - updatedAt: 2000-01-23T04:56:07.000+00:00 - lastUpdaterUserFullName: lastUpdaterUserFullName - properties: - rolloutRules: - description: The targeting rule collection. - items: - $ref: '#/components/schemas/RolloutRuleModel' - nullable: true - type: array - rolloutPercentageItems: - description: The percentage rule collection. - items: - $ref: '#/components/schemas/RolloutPercentageItemModel' - nullable: true - type: array - value: - description: The value to serve. It must respect the setting type. - nullable: true - setting: - $ref: '#/components/schemas/SettingDataModel' - updatedAt: - description: The last updated date and time when the Feature Flag or Setting. - format: date-time - nullable: true - type: string - lastUpdaterUserEmail: - description: The email of the user who last updated the Feature Flag or - Setting. - nullable: true - type: string - lastUpdaterUserFullName: - description: The name of the user who last updated the Feature Flag or Setting. - nullable: true - type: string - integrationLinks: - description: The integration links attached to the Feature Flag or Setting. - items: - $ref: '#/components/schemas/IntegrationLinkModel' - nullable: true - type: array - settingTags: - description: The tags attached to the Feature Flag or Setting. - items: - $ref: '#/components/schemas/SettingTagModel' - nullable: true - type: array - type: object - ConfigSettingValuesModel: - example: - environment: - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - color: color - name: name - description: description - order: 0 - reasonRequired: true - featureFlagLimitations: - maxComparisonValueListItemLength: 9 - maxComparisonValueListLength: 7 - maxPercentageOptionCount: 5 - maxConditionPerTargetingRuleCount: 2 - maxComparisonValueLength: 2 - maxStringFlagValueLength: 3 - maxTargetingRuleCount: 5 - readOnly: true - settingValues: - - rolloutRules: - - comparator: isOneOf - comparisonValue: comparisonValue - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn - value: "" - comparisonAttribute: comparisonAttribute - - comparator: isOneOf - comparisonValue: comparisonValue - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn - value: "" - comparisonAttribute: comparisonAttribute - rolloutPercentageItems: - - percentage: 0 - value: "" - - percentage: 0 - value: "" - lastUpdaterUserEmail: lastUpdaterUserEmail - value: "" - integrationLinks: - - integrationLinkType: trello - description: description - key: key - url: url - - integrationLinkType: trello - description: description - key: key - url: url - settingTags: - - color: color - tagId: 1 - name: name - settingTagId: 6 - - color: color - tagId: 1 - name: name - settingTagId: 6 - setting: - createdAt: 2000-01-23T04:56:07.000+00:00 - creatorEmail: creatorEmail - hint: hint - name: name - creatorFullName: creatorFullName - isWatching: true - settingType: boolean - key: key - settingId: 0 - order: 6 - updatedAt: 2000-01-23T04:56:07.000+00:00 - lastUpdaterUserFullName: lastUpdaterUserFullName - - rolloutRules: - - comparator: isOneOf - comparisonValue: comparisonValue - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn - value: "" - comparisonAttribute: comparisonAttribute - - comparator: isOneOf - comparisonValue: comparisonValue - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn - value: "" - comparisonAttribute: comparisonAttribute - rolloutPercentageItems: - - percentage: 0 - value: "" - - percentage: 0 - value: "" - lastUpdaterUserEmail: lastUpdaterUserEmail - value: "" - integrationLinks: - - integrationLinkType: trello - description: description - key: key - url: url - - integrationLinkType: trello - description: description - key: key - url: url - settingTags: - - color: color - tagId: 1 - name: name - settingTagId: 6 - - color: color - tagId: 1 - name: name - settingTagId: 6 - setting: - createdAt: 2000-01-23T04:56:07.000+00:00 - creatorEmail: creatorEmail - hint: hint - name: name - creatorFullName: creatorFullName - isWatching: true - settingType: boolean - key: key - settingId: 0 - order: 6 - updatedAt: 2000-01-23T04:56:07.000+00:00 - lastUpdaterUserFullName: lastUpdaterUserFullName - config: - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - description: description - migratedConfigId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - evaluationVersion: v1 - order: 0 - properties: - config: - $ref: '#/components/schemas/ConfigModel' - environment: - $ref: '#/components/schemas/EnvironmentModel' - readOnly: - type: boolean - settingValues: - items: - $ref: '#/components/schemas/ConfigSettingValueModel' - nullable: true - type: array - featureFlagLimitations: - $ref: '#/components/schemas/FeatureFlagLimitations' - type: object - ConnectRequest: - example: - jiraJwtToken: jiraJwtToken - clientKey: clientKey - properties: - clientKey: - maxLength: 255 - minLength: 0 - type: string - jiraJwtToken: - maxLength: 15000 - minLength: 0 - type: string - required: - - clientKey - - jiraJwtToken - type: object - CreateConfigRequest: - example: - name: name - description: description - evaluationVersion: v1 - order: 0 - properties: - name: - description: The name of the Config. - maxLength: 255 - minLength: 1 - type: string - description: - description: The description of the Config. - maxLength: 1000 - minLength: 0 - nullable: true - type: string - order: - description: "The order of the Config represented on the ConfigCat Dashboard.\r\ - \nDetermined from an ascending sequence of integers." - format: int32 - nullable: true - type: integer - evaluationVersion: - $ref: '#/components/schemas/EvaluationVersion' - required: - - name - type: object - CreateEnvironmentModel: - example: - color: color - name: name - description: description - order: 0 - properties: - name: - description: The name of the Environment. - maxLength: 255 - minLength: 1 - type: string - color: - description: The color of the Environment. RGB or HTML color codes are allowed. - maxLength: 255 - minLength: 0 - nullable: true - type: string - description: - description: The description of the Environment. - maxLength: 1000 - minLength: 0 - nullable: true - type: string - order: - description: "The order of the Environment represented on the ConfigCat\ - \ Dashboard.\r\nDetermined from an ascending sequence of integers." - format: int32 - nullable: true - type: integer - required: - - name - type: object - CreateIntegrationModel: - example: - integrationType: dataDog - environmentIds: - - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - configIds: - - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - parameters: - key: parameters - properties: - integrationType: - $ref: '#/components/schemas/IntegrationType' - name: - description: Name of the Integration. - minLength: 1 - type: string - parameters: - additionalProperties: - nullable: true - type: string - description: Parameters of the Integration. - type: object - environmentIds: - description: "List of Environment IDs that are connected with this Integration.\ - \ If the list is empty, all of the Environments are connected." - items: - format: uuid - type: string - type: array - configIds: - description: "List of Config IDs that are connected with this Integration.\ - \ If the list is empty, all of the Configs are connected." - items: - format: uuid - type: string - type: array - required: - - configIds - - environmentIds - - integrationType - - name - - parameters - type: object - CreateOrUpdateEnvironmentAccessModel: - example: - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - environmentAccessType: null - properties: - environmentId: - description: Identifier of the Environment. - format: uuid - type: string - environmentAccessType: - $ref: '#/components/schemas/EnvironmentAccessType' - type: object - CreatePermissionGroupRequest: - example: - canViewProductStatistics: true - canDeleteTag: true - environmentAccesses: - - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - environmentAccessType: null - - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - environmentAccessType: null - canManageProductPreferences: true - canManageIntegrations: true - canDeleteSegments: true - accessType: readOnly - canManageMembers: true - canManageWebhook: true - canUseExportImport: true - canViewSdkKey: true - canDeleteSetting: true - canRotateSdkKey: true - canCreateOrUpdateSegments: true - canCreateOrUpdateSetting: true - canDeleteConfig: true - canDisable2FA: true - canDeleteEnvironment: true - canCreateOrUpdateConfig: true - canTagSetting: true - canCreateOrUpdateEnvironment: true - name: name - canViewProductAuditLog: true - canCreateOrUpdateTag: true - newEnvironmentAccessType: full - properties: - name: - description: Name of the Permission Group. - maxLength: 255 - minLength: 1 - type: string - canManageMembers: - description: Group members can manage team members. - type: boolean - canCreateOrUpdateConfig: - description: Group members can create/update Configs. - type: boolean - canDeleteConfig: - description: Group members can delete Configs. - type: boolean - canCreateOrUpdateEnvironment: - description: Group members can create/update Environments. - type: boolean - canDeleteEnvironment: - description: Group members can delete Environments. - type: boolean - canCreateOrUpdateSetting: - description: Group members can create/update Feature Flags and Settings. - type: boolean - canTagSetting: - description: Group members can attach/detach Tags to Feature Flags and Settings. - type: boolean - canDeleteSetting: - description: Group members can delete Feature Flags and Settings. - type: boolean - canCreateOrUpdateTag: - description: Group members can create/update Tags. - type: boolean - canDeleteTag: - description: Group members can delete Tags. - type: boolean - canManageWebhook: - description: Group members can create/update/delete Webhooks. - type: boolean - canUseExportImport: - description: Group members can use the export/import feature. - type: boolean - canManageProductPreferences: - description: Group members can update Product preferences. - type: boolean - canManageIntegrations: - description: Group members can add and configure integrations. - type: boolean - canViewSdkKey: - description: Group members has access to SDK keys. - type: boolean - canRotateSdkKey: - description: Group members can rotate SDK keys. - type: boolean - canCreateOrUpdateSegments: - description: Group members can create/update Segments. - type: boolean - canDeleteSegments: - description: Group members can delete Segments. - type: boolean - canViewProductAuditLog: - description: Group members has access to audit logs. - type: boolean - canViewProductStatistics: - description: Group members has access to product statistics. - type: boolean - accessType: - $ref: '#/components/schemas/AccessType' - newEnvironmentAccessType: - $ref: '#/components/schemas/EnvironmentAccessType' - environmentAccesses: - description: List of environment specific permissions. - items: - $ref: '#/components/schemas/CreateOrUpdateEnvironmentAccessModel' - nullable: true - type: array - canDisable2FA: - description: Group members can disable two-factor authentication for other - members. - type: boolean - required: - - name - type: object - CreateProductRequest: - example: - name: name - description: description - order: 0 - properties: - name: - description: The name of the Product. - maxLength: 1000 - minLength: 1 - type: string - description: - description: The description of the Product. - maxLength: 1000 - minLength: 0 - nullable: true - type: string - order: - description: "The order of the Product represented on the ConfigCat Dashboard.\r\ - \nDetermined from an ascending sequence of integers." - format: int32 - nullable: true - type: integer - required: - - name - type: object - CreateSegmentModel: - example: - comparator: isOneOf - comparisonValue: comparisonValue - name: name - description: description - comparisonAttribute: comparisonAttribute - properties: - name: - description: Name of the Segment. - maxLength: 255 - minLength: 1 - type: string - description: - description: Description of the Segment. - maxLength: 1000 - minLength: 0 - nullable: true - type: string - comparisonAttribute: - description: The user's attribute the evaluation process must take into - account. - maxLength: 1000 - minLength: 1 - type: string - comparator: - $ref: '#/components/schemas/RolloutRuleComparator' - comparisonValue: - description: The value to compare with the given user attribute's value. - minLength: 1 - type: string - required: - - comparator - - comparisonAttribute - - comparisonValue - - name - type: object - CreateSettingInitialValues: - example: - initialValues: - - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - value: "" - - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - value: "" - hint: hint - name: name - settingType: boolean - key: key - tags: - - 0 - - 0 - order: 6 - properties: - hint: - description: "A short description for the setting, shown on the Dashboard\ - \ UI." - maxLength: 1000 - minLength: 0 - nullable: true - type: string - tags: - description: The IDs of the tags which are attached to the setting. - items: - format: int64 - type: integer - nullable: true - type: array - order: - description: "The order of the Setting represented on the ConfigCat Dashboard.\r\ - \nDetermined from an ascending sequence of integers." - format: int32 - nullable: true - type: integer - key: - description: The key of the Feature Flag or Setting. - maxLength: 255 - minLength: 1 - type: string - name: - description: The name of the Feature Flag or Setting. - maxLength: 255 - minLength: 1 - type: string - settingType: - $ref: '#/components/schemas/SettingType' - initialValues: - description: "Optional, initial value of the Feature Flag or Setting in\ - \ the given Environments." - items: - $ref: '#/components/schemas/InitialValue' - nullable: true - type: array - required: - - key - - name - - settingType - type: object - CreateTagModel: - example: - color: color - name: name - properties: - name: - description: Name of the Tag. - maxLength: 255 - minLength: 1 - type: string - color: - description: "Color of the Tag. Possible values: `panther`, `whale`, `salmon`,\ - \ `lizard`, `canary`, `koala`, or any HTML color code." - maxLength: 255 - minLength: 0 - nullable: true - type: string - required: - - name - type: object - DeleteIntegrationLinkModel: - example: - hasRemainingIntegrationLink: true - properties: - hasRemainingIntegrationLink: - type: boolean - type: object - DeleteRepositoryReportsRequest: - example: - configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - repository: repository - branch: branch - settingId: 0 - properties: - configId: - description: The Config's identifier from where the reports should be deleted. - format: uuid - type: string - repository: - description: The source control repository which's reports should be deleted. - maxLength: 255 - minLength: 1 - type: string - branch: - description: "If it's set, only this branch's reports belonging to the given\ - \ repository will be deleted." - maxLength: 255 - minLength: 0 - nullable: true - type: string - settingId: - description: "If it's set, only this setting's reports belonging to the\ - \ given repository will be deleted." - format: int32 - nullable: true - type: integer - required: - - configId - - repository - type: object - EnvironmentAccessModel: - example: - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - color: color - environmentAccessType: null - name: name - description: description - order: 6 - reasonRequired: true - properties: - environmentId: - description: Identifier of the Environment. - format: uuid - type: string - name: - description: Name of the Environment. - nullable: true - type: string - color: - description: Color of the Environment. - nullable: true - type: string - description: - description: Description of the Environment. - nullable: true - type: string - order: - description: The order of the Environment represented on the ConfigCat Dashboard. - format: int32 - type: integer - reasonRequired: - description: Determines whether a mandatory reason must be given every time - when the Feature Flags or Settings in the given Environment are saved. - type: boolean - environmentAccessType: - $ref: '#/components/schemas/EnvironmentAccessType' - type: object - EnvironmentAccessType: - description: Represent the environment specific Feature Management permission. - enum: - - full - - readOnly - - none - type: string - EnvironmentModel: - description: Details of the Environment. - example: - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - color: color - name: name - description: description - order: 0 - reasonRequired: true - properties: - product: - $ref: '#/components/schemas/ProductModel' - environmentId: - description: Identifier of the Environment. - format: uuid - type: string - name: - description: Name of the Environment. - nullable: true - type: string - color: - description: The configured color of the Environment. - nullable: true - type: string - description: - description: Description of the Environment. - nullable: true - type: string - order: - description: The order of the Environment represented on the ConfigCat Dashboard. - format: int32 - type: integer - reasonRequired: - description: Determines whether a mandatory reason must be given every time - when the Feature Flags or Settings in the given Environment are saved. - type: boolean - type: object - EvaluationVersion: - description: "Determines the evaluation version of a Config.\r\nUsing `v2` enables\ - \ the new features of Config V2 (https://configcat.com/docs/advanced/config-v2)." - enum: - - v1 - - v2 - type: string - FeatureFlagLimitations: - description: Subscription limitations regarding Feature flag or Setting values - and targeting. - example: - maxComparisonValueListItemLength: 9 - maxComparisonValueListLength: 7 - maxPercentageOptionCount: 5 - maxConditionPerTargetingRuleCount: 2 - maxComparisonValueLength: 2 - maxStringFlagValueLength: 3 - maxTargetingRuleCount: 5 - properties: - maxPercentageOptionCount: - description: Maximum number of percentage options a Feature Flag or Setting - can have within a targeting rule. - format: int32 - type: integer - maxTargetingRuleCount: - description: Maximum number of targeting rules a Feature Flag or Setting - can have. - format: int32 - type: integer - maxComparisonValueLength: - description: Maximum length of a text comparison value. - format: int32 - type: integer - maxComparisonValueListLength: - description: Maximum item count of a list comparison value. - format: int32 - type: integer - maxComparisonValueListItemLength: - description: Maximum length of a list comparison value's item. - format: int32 - type: integer - maxStringFlagValueLength: - description: Maximum length of a text Setting's value. - format: int32 - type: integer - maxConditionPerTargetingRuleCount: - description: Maximum number of `AND` conditions a Feature Flag or Setting - can have within a targeting rule. - format: int32 - type: integer - type: object - FlagReference: - example: - references: - - file: file - referenceLine: - lineText: lineText - lineNumber: 0 - fileUrl: fileUrl - postLines: - - lineText: lineText - lineNumber: 0 - - lineText: lineText - lineNumber: 0 - preLines: - - lineText: lineText - lineNumber: 0 - - lineText: lineText - lineNumber: 0 - - file: file - referenceLine: - lineText: lineText - lineNumber: 0 - fileUrl: fileUrl - postLines: - - lineText: lineText - lineNumber: 0 - - lineText: lineText - lineNumber: 0 - preLines: - - lineText: lineText - lineNumber: 0 - - lineText: lineText - lineNumber: 0 - settingId: 0 - properties: - settingId: - description: The identifier of the Feature Flag or Setting the code reference - belongs to. - format: int32 - type: integer - references: - description: The actual references to the given Feature Flag or Setting. - items: - $ref: '#/components/schemas/ReferenceLines' - type: array - required: - - references - - settingId - type: object - InitialValue: - example: - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - value: "" - properties: - environmentId: - description: The ID of the Environment where the initial value must be set. - format: uuid - type: string - value: - description: The initial value in the given Environment. It must respect - the setting type. - nullable: true - type: object - IntegrationLinkDetail: - example: - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - environment: - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - color: color - name: name - description: description - order: 0 - reasonRequired: true - readOnly: true - config: - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - description: description - migratedConfigId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - evaluationVersion: v1 - order: 0 - setting: - createdAt: 2000-01-23T04:56:07.000+00:00 - creatorEmail: creatorEmail - hint: hint - name: name - creatorFullName: creatorFullName - isWatching: true - settingType: boolean - key: key - settingId: 0 - order: 6 - status: status - properties: - product: - $ref: '#/components/schemas/ProductModel' - config: - $ref: '#/components/schemas/ConfigModel' - environment: - $ref: '#/components/schemas/EnvironmentModel' - setting: - $ref: '#/components/schemas/SettingDataModel' - readOnly: - type: boolean - status: - nullable: true - type: string - type: object - IntegrationLinkDetailsModel: - example: - allIntegrationLinkCount: 1 - details: - - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - environment: - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - color: color - name: name - description: description - order: 0 - reasonRequired: true - readOnly: true - config: - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - description: description - migratedConfigId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - evaluationVersion: v1 - order: 0 - setting: - createdAt: 2000-01-23T04:56:07.000+00:00 - creatorEmail: creatorEmail - hint: hint - name: name - creatorFullName: creatorFullName - isWatching: true - settingType: boolean - key: key - settingId: 0 - order: 6 - status: status - - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - environment: - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - color: color - name: name - description: description - order: 0 - reasonRequired: true - readOnly: true - config: - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - description: description - migratedConfigId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - evaluationVersion: v1 - order: 0 - setting: - createdAt: 2000-01-23T04:56:07.000+00:00 - creatorEmail: creatorEmail - hint: hint - name: name - creatorFullName: creatorFullName - isWatching: true - settingType: boolean - key: key - settingId: 0 - order: 6 - status: status - properties: - details: - items: - $ref: '#/components/schemas/IntegrationLinkDetail' - nullable: true - readOnly: true - type: array - allIntegrationLinkCount: - format: int32 - type: integer - type: object - IntegrationLinkModel: - example: - integrationLinkType: trello - description: description - key: key - url: url - properties: - key: - nullable: true - type: string - description: - nullable: true - type: string - integrationLinkType: - $ref: '#/components/schemas/IntegrationLinkType' - url: - nullable: true - type: string - type: object - IntegrationLinkType: - enum: - - trello - - jira - - monday - type: string - IntegrationModel: - description: Details of the Integration. - example: - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - integrationType: dataDog - environmentIds: - - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - integrationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - configIds: - - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - parameters: - key: parameters - properties: - product: - $ref: '#/components/schemas/ProductModel' - integrationId: - description: Identifier of the Integration. - format: uuid - type: string - name: - description: Name of the Integration. - nullable: true - type: string - integrationType: - $ref: '#/components/schemas/IntegrationType' - parameters: - additionalProperties: - nullable: true - type: string - description: Parameters of the Integration. - nullable: true - type: object - environmentIds: - description: "List of Environment IDs that are connected with this Integration.\ - \ If the list is empty, all of the Environments are connected." - items: - format: uuid - type: string - nullable: true - type: array - configIds: - description: "List of Config IDs that are connected with this Integration.\ - \ If the list is empty, all of the Configs are connected." - items: - format: uuid - type: string - nullable: true - type: array - type: object - IntegrationType: - enum: - - dataDog - - slack - - amplitude - - mixPanel - - segment - - pubNub - type: string - IntegrationsModel: - example: - integrations: - - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - integrationType: dataDog - environmentIds: - - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - integrationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - configIds: - - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - parameters: - key: parameters - - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - integrationType: dataDog - environmentIds: - - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - integrationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - configIds: - - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - parameters: - key: parameters - properties: - integrations: - description: The Integrations of the Product. - items: - $ref: '#/components/schemas/IntegrationModel' - nullable: true - type: array - type: object - InvitationModel: - example: - permissionGroupId: 0 - createdAt: 2000-01-23T04:56:07.000+00:00 - expired: true - invitationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - email: email - properties: - invitationId: - description: The identifier of the Invitation. - format: uuid - type: string - email: - description: The invited user's email address. - nullable: true - type: string - permissionGroupId: - description: The identifier of the Permission Group the user was invited - to. - format: int64 - type: integer - createdAt: - description: Creation time of the Invitation. - format: date-time - type: string - expired: - description: Determines whether the Invitation is expired. - type: boolean - type: object - InviteMembersRequest: - example: - emails: - - emails - - emails - permissionGroupId: 0 - properties: - emails: - description: List of email addresses to invite. - items: - type: string - type: array - permissionGroupId: - description: Identifier of the Permission Group to where the invited users - should be added. - format: int64 - type: integer - required: - - emails - - permissionGroupId - type: object - JsonPatchOperation: - example: - op: unknown - path: path - from: from - value: "" - properties: - op: - $ref: '#/components/schemas/OperationType' - path: - description: The source path. - minLength: 1 - type: string - from: - description: The target path. - nullable: true - type: string - value: - description: The discrete value. - nullable: true - required: - - op - - path - type: object - KeyGenerationMode: - description: Determines the Feature Flag key generation mode. - enum: - - camelCase - - lowerCase - - upperCase - - pascalCase - - kebabCase - type: string - MeModel: - example: - fullName: fullName - email: email - properties: - email: - nullable: true - readOnly: true - type: string - fullName: - nullable: true - readOnly: true - type: string - type: object - MemberModel: - example: - permissionGroupId: 0 - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - fullName: fullName - userId: userId - email: email - properties: - userId: - description: Identifier of the Member. - nullable: true - type: string - productId: - description: Identifier of the Product where the Member has access. - format: uuid - type: string - permissionGroupId: - description: Identifier of the Member's Permission Group. - format: int64 - type: integer - fullName: - description: Name of the Member. - nullable: true - type: string - email: - description: Email of the Member. - nullable: true - type: string - type: object - ModifyIntegrationRequest: - example: - environmentIds: - - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - configIds: - - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - parameters: - key: parameters - properties: - name: - description: Name of the Integration. - minLength: 1 - type: string - parameters: - additionalProperties: - nullable: true - type: string - description: Parameters of the Integration. - type: object - environmentIds: - description: "List of Environment IDs that are connected with this Integration.\ - \ If the list is empty, all of the Environments are connected." - items: - format: uuid - type: string - type: array - configIds: - description: "List of Config IDs that are connected with this Integration.\ - \ If the list is empty, all of the Configs are connected." - items: - format: uuid - type: string - type: array - required: - - configIds - - environmentIds - - name - - parameters - type: object - OperationType: - enum: - - unknown - - add - - remove - - replace - - move - - copy - - test - type: string - OrganizationAdminModel: - description: Describes an Organization Admin. - example: - twoFactorEnabled: true - fullName: fullName - userId: userId - email: email - properties: - userId: - description: Identifier of the Organization Admin. - nullable: true - type: string - fullName: - description: Name of the Organization Admin. - nullable: true - type: string - email: - description: Email of the OrganizationAdmin. - nullable: true - type: string - twoFactorEnabled: - description: Determines whether 2FA is enabled for the Organization Admin. - type: boolean - type: object - OrganizationInvitationModel: - example: - permissionGroupId: 0 - createdAt: 2000-01-23T04:56:07.000+00:00 - expires: 2000-01-23T04:56:07.000+00:00 - expired: true - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - invitationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - email: email - productName: productName - properties: - invitationId: - description: The identifier of the Invitation. - format: uuid - type: string - email: - description: The invited user's email address. - nullable: true - type: string - productId: - description: The identifier of the Product the user was invited to. - format: uuid - type: string - productName: - description: The name of the Product the user was invited to. - nullable: true - type: string - permissionGroupId: - description: The identifier of the Permission Group the user was invited - to. - format: int64 - type: integer - createdAt: - description: Creation time of the Invitation. - format: date-time - type: string - expired: - description: Determines whether the Invitation is expired. - type: boolean - expires: - description: Expiration time of the Invitation. - format: date-time - type: string - type: object - OrganizationMemberModel: - description: Describes an Organization Member. - example: - twoFactorEnabled: true - permissions: - - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - permissionGroup: - permissionGroupId: 0 - name: name - - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - permissionGroup: - permissionGroupId: 0 - name: name - fullName: fullName - userId: userId - email: email - properties: - userId: - description: Identifier of the Organization Admin. - nullable: true - type: string - fullName: - description: Name of the Organization Admin. - nullable: true - type: string - email: - description: Email of the OrganizationAdmin. - nullable: true - type: string - twoFactorEnabled: - description: Determines whether 2FA is enabled for the Organization Admin. - type: boolean - permissions: - description: The permissions of the Member. - items: - $ref: '#/components/schemas/OrganizationPermissionModel' - nullable: true - type: array - type: object - OrganizationMembersModel: - example: - billingManagers: - - twoFactorEnabled: true - fullName: fullName - userId: userId - email: email - - twoFactorEnabled: true - fullName: fullName - userId: userId - email: email - members: - - twoFactorEnabled: true - permissions: - - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - permissionGroup: - permissionGroupId: 0 - name: name - - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - permissionGroup: - permissionGroupId: 0 - name: name - fullName: fullName - userId: userId - email: email - - twoFactorEnabled: true - permissions: - - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - permissionGroup: - permissionGroupId: 0 - name: name - - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - permissionGroup: - permissionGroupId: 0 - name: name - fullName: fullName - userId: userId - email: email - admins: - - twoFactorEnabled: true - fullName: fullName - userId: userId - email: email - - twoFactorEnabled: true - fullName: fullName - userId: userId - email: email - properties: - admins: - description: List of Organization Admins. - items: - $ref: '#/components/schemas/OrganizationAdminModel' - nullable: true - type: array - billingManagers: - description: List of Billing Managers. - items: - $ref: '#/components/schemas/OrganizationAdminModel' - nullable: true - type: array - members: - description: List of Organization Members. - items: - $ref: '#/components/schemas/OrganizationMemberModel' - nullable: true - type: array - type: object - OrganizationModel: - description: Details of the Organization. - example: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - properties: - organizationId: - description: Identifier of the Organization. - format: uuid - type: string - name: - description: Name of the Organization. - nullable: true - type: string - type: object - OrganizationPermissionGroupModel: - description: Describes the Member's Permission Group within a Product. - example: - permissionGroupId: 0 - name: name - properties: - permissionGroupId: - description: Identifier of the Member's Permission Group. - format: int64 - type: integer - name: - description: Name of the Member's Permission Group. - nullable: true - type: string - type: object - OrganizationPermissionModel: - description: Describes the Member's permission. - example: - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - permissionGroup: - permissionGroupId: 0 - name: name - properties: - product: - $ref: '#/components/schemas/OrganizationProductModel' - permissionGroup: - $ref: '#/components/schemas/OrganizationPermissionGroupModel' - type: object - OrganizationProductModel: - description: Describes the Member's Product. - example: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - properties: - productId: - description: Identifier of the Member's Product. - format: uuid - type: string - name: - description: Name of the Member's Product. - nullable: true - type: string - type: object - PercentageOptionModel: - example: - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - properties: - percentage: - description: A number between 0 and 100 that represents a randomly allocated - fraction of the users. - format: int32 - type: integer - value: - $ref: '#/components/schemas/ValueModel' - required: - - percentage - - value - type: object - PermissionGroupModel: - example: - canViewProductStatistics: true - canDeleteTag: true - environmentAccesses: - - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - color: color - environmentAccessType: null - name: name - description: description - order: 6 - reasonRequired: true - - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - color: color - environmentAccessType: null - name: name - description: description - order: 6 - reasonRequired: true - canManageProductPreferences: true - canManageIntegrations: true - canDeleteSegments: true - accessType: readOnly - canManageMembers: true - canManageWebhook: true - canUseExportImport: true - canViewSdkKey: true - canDeleteSetting: true - canRotateSdkKey: true - canCreateOrUpdateSegments: true - canCreateOrUpdateSetting: true - permissionGroupId: 0 - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - canDeleteConfig: true - canDisable2FA: true - canDeleteEnvironment: true - canCreateOrUpdateConfig: true - canTagSetting: true - canCreateOrUpdateEnvironment: true - name: name - canViewProductAuditLog: true - canCreateOrUpdateTag: true - newEnvironmentAccessType: full - properties: - permissionGroupId: - description: Identifier of the Permission Group. - format: int64 - type: integer - name: - description: Name of the Permission Group. - nullable: true - type: string - canManageMembers: - description: Group members can manage team members. - type: boolean - canCreateOrUpdateConfig: - description: Group members can create/update Configs. - type: boolean - canDeleteConfig: - description: Group members can delete Configs. - type: boolean - canCreateOrUpdateEnvironment: - description: Group members can create/update Environments. - type: boolean - canDeleteEnvironment: - description: Group members can delete Environments. - type: boolean - canCreateOrUpdateSetting: - description: Group members can create/update Feature Flags and Settings. - type: boolean - canTagSetting: - description: Group members can attach/detach Tags to Feature Flags and Settings. - type: boolean - canDeleteSetting: - description: Group members can delete Feature Flags and Settings. - type: boolean - canCreateOrUpdateTag: - description: Group members can create/update Tags. - type: boolean - canDeleteTag: - description: Group members can delete Tags. - type: boolean - canManageWebhook: - description: Group members can create/update/delete Webhooks. - type: boolean - canUseExportImport: - description: Group members can use the export/import feature. - type: boolean - canManageProductPreferences: - description: Group members can update Product preferences. - type: boolean - canManageIntegrations: - description: Group members can add and configure integrations. - type: boolean - canViewSdkKey: - description: Group members has access to SDK keys. - type: boolean - canRotateSdkKey: - description: Group members can rotate SDK keys. - type: boolean - canCreateOrUpdateSegments: - description: Group members can create/update Segments. - type: boolean - canDeleteSegments: - description: Group members can delete Segments. - type: boolean - canViewProductAuditLog: - description: Group members has access to audit logs. - type: boolean - canViewProductStatistics: - description: Group members has access to product statistics. - type: boolean - canDisable2FA: - description: Group members can disable two-factor authentication for other - members. - type: boolean - accessType: - $ref: '#/components/schemas/AccessType' - newEnvironmentAccessType: - $ref: '#/components/schemas/EnvironmentAccessType' - environmentAccesses: - description: List of environment specific permissions. - items: - $ref: '#/components/schemas/EnvironmentAccessModel' - nullable: true - type: array - product: - $ref: '#/components/schemas/ProductModel' - type: object - PreferencesModel: - example: - keyGenerationMode: camelCase - showVariationId: true - mandatorySettingHint: true - reasonRequiredEnvironments: - - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - environmentName: environmentName - reasonRequired: true - - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - environmentName: environmentName - reasonRequired: true - reasonRequired: true - properties: - reasonRequired: - description: Indicates that a mandatory note required for saving and publishing. - type: boolean - keyGenerationMode: - $ref: '#/components/schemas/KeyGenerationMode' - showVariationId: - description: Indicates whether a variation ID's must be shown on the ConfigCat - Dashboard. - type: boolean - reasonRequiredEnvironments: - description: List of Environments where mandatory note must be set before - saving and publishing. - items: - $ref: '#/components/schemas/ReasonRequiredEnvironmentModel' - nullable: true - type: array - mandatorySettingHint: - description: Indicates whether Feature flags and Settings must have a hint. - type: boolean - type: object - PrerequisiteComparator: - description: Prerequisite flag comparison operator used during the evaluation - process. - enum: - - equals - - doesNotEqual - type: string - PrerequisiteFlagConditionModel: - description: Describes a condition that is based on a prerequisite flag. - example: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - properties: - prerequisiteSettingId: - description: The prerequisite flag's identifier. - format: int32 - type: integer - comparator: - $ref: '#/components/schemas/PrerequisiteComparator' - prerequisiteComparisonValue: - $ref: '#/components/schemas/ValueModel' - required: - - comparator - - prerequisiteComparisonValue - - prerequisiteSettingId - type: object - ProductModel: - description: Details of the Product. - example: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - properties: - organization: - $ref: '#/components/schemas/OrganizationModel' - productId: - description: Identifier of the Product. - format: uuid - type: string - name: - description: Name of the Product. - nullable: true - type: string - description: - description: Description of the Product. - nullable: true - type: string - order: - description: "The order of the Product represented on the ConfigCat Dashboard.\r\ - \nDetermined from an ascending sequence of integers." - format: int32 - type: integer - reasonRequired: - description: Determines whether a mandatory reason must be given every time - when the Feature Flags or Settings within a Product are saved. - type: boolean - type: object - ReasonRequiredEnvironmentModel: - example: - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - environmentName: environmentName - reasonRequired: true - properties: - environmentId: - description: Identifier of the Environment. - format: uuid - type: string - reasonRequired: - description: Indicates that a mandatory note is required in this Environment - for saving and publishing. - type: boolean - environmentName: - description: Name of the Environment. - nullable: true - type: string - type: object - ReferenceLine: - description: Determines a code reference line. - example: - lineText: lineText - lineNumber: 0 - properties: - lineText: - description: The content of the reference line. - maxLength: 1000 - minLength: 0 - nullable: true - type: string - lineNumber: - description: The line number. - format: int32 - type: integer - required: - - lineNumber - type: object - ReferenceLines: - example: - file: file - referenceLine: - lineText: lineText - lineNumber: 0 - fileUrl: fileUrl - postLines: - - lineText: lineText - lineNumber: 0 - - lineText: lineText - lineNumber: 0 - preLines: - - lineText: lineText - lineNumber: 0 - - lineText: lineText - lineNumber: 0 - properties: - file: - description: The file's name in where the code reference has been found. - (Appears on the ConfigCat Dashboard) - maxLength: 255 - minLength: 1 - type: string - fileUrl: - description: The file's url. (Used to point to the file on the repository's - website) - maxLength: 1000 - minLength: 0 - nullable: true - type: string - preLines: - description: The lines before the actual reference line. - items: - $ref: '#/components/schemas/ReferenceLine' - nullable: true - type: array - postLines: - description: The lines after the actual reference line. - items: - $ref: '#/components/schemas/ReferenceLine' - nullable: true - type: array - referenceLine: - $ref: '#/components/schemas/ReferenceLine' - required: - - file - - referenceLine - type: object - ReplaceSettingModel: - example: - hint: hint - name: name - tags: - - 0 - - 0 - order: 6 - properties: - hint: - description: "A short description for the setting, shown on the Dashboard\ - \ UI." - maxLength: 1000 - minLength: 0 - nullable: true - type: string - tags: - description: The IDs of the tags which are attached to the setting. - items: - format: int64 - type: integer - nullable: true - type: array - order: - description: "The order of the Setting represented on the ConfigCat Dashboard.\r\ - \nDetermined from an ascending sequence of integers." - format: int32 - nullable: true - type: integer - name: - description: The name of the Feature Flag or Setting. - maxLength: 255 - minLength: 1 - type: string - required: - - name - type: object - RolloutPercentageItemModel: - example: - percentage: 0 - value: "" - properties: - percentage: - description: The percentage value for the rule. - format: int64 - type: integer - value: - description: The value to serve when the user falls in the percentage rule. - It must respect the setting type. - nullable: true - required: - - percentage - type: object - RolloutRuleComparator: - description: The comparison operator the evaluation process must use when it - compares the given user attribute's value with the comparison value. - enum: - - isOneOf - - isNotOneOf - - contains - - doesNotContain - - semVerIsOneOf - - semVerIsNotOneOf - - semVerLess - - semVerLessOrEquals - - semVerGreater - - semVerGreaterOrEquals - - numberEquals - - numberDoesNotEqual - - numberLess - - numberLessOrEquals - - numberGreater - - numberGreaterOrEquals - - sensitiveIsOneOf - - sensitiveIsNotOneOf - type: string - RolloutRuleModel: - example: - comparator: isOneOf - comparisonValue: comparisonValue - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn - value: "" - comparisonAttribute: comparisonAttribute - properties: - comparisonAttribute: - description: The user attribute to compare. - maxLength: 1000 - minLength: 0 - nullable: true - type: string - comparator: - $ref: '#/components/schemas/RolloutRuleComparator' - comparisonValue: - description: The value to compare against. - nullable: true - type: string - value: - description: The value to serve when the comparison matches. It must respect - the setting type. - nullable: true - segmentComparator: - $ref: '#/components/schemas/SegmentComparator' - segmentId: - description: The segment to compare against. - format: uuid - nullable: true - type: string - type: object - SdkKeysModel: - example: - secondary: secondary - primary: primary - properties: - primary: - description: The primary SDK key. - nullable: true - type: string - secondary: - description: The secondary SDK key. - nullable: true - type: string - type: object - SegmentComparator: - description: The segment comparison operator used during the evaluation process. - enum: - - isIn - - isNotIn - type: string - SegmentConditionModel: - description: Describes a condition that is based on a segment. - example: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - properties: - segmentId: - description: The segment's identifier. - format: uuid - type: string - comparator: - $ref: '#/components/schemas/SegmentComparator' - required: - - comparator - - segmentId - type: object - SegmentListModel: - example: - createdAt: 2000-01-23T04:56:07.000+00:00 - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - lastUpdaterEmail: lastUpdaterEmail - creatorEmail: creatorEmail - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - usage: 0 - name: name - description: description - creatorFullName: creatorFullName - lastUpdaterFullName: lastUpdaterFullName - updatedAt: 2000-01-23T04:56:07.000+00:00 - properties: - product: - $ref: '#/components/schemas/ProductModel' - segmentId: - description: Identifier of the Segment. - format: uuid - type: string - name: - description: Name of the Segment. - nullable: true - type: string - description: - description: Description of the Segment. - nullable: true - type: string - creatorEmail: - description: The email of the user who created the Segment. - nullable: true - type: string - creatorFullName: - description: The name of the user who created the Segment. - nullable: true - type: string - createdAt: - description: The date and time when the Segment was created. - format: date-time - type: string - lastUpdaterEmail: - description: The email of the user who last updated the Segment. - nullable: true - type: string - lastUpdaterFullName: - description: The name of the user who last updated the Segment. - nullable: true - type: string - updatedAt: - description: The date and time when the Segment was last updated. - format: date-time - type: string - usage: - description: Determines how many Feature Flags and Settings are using the - Segment. - format: int32 - type: integer - type: object - SegmentModel: - example: - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - comparisonValue: comparisonValue - creatorEmail: creatorEmail - description: description - createdAt: 2000-01-23T04:56:07.000+00:00 - comparator: isOneOf - lastUpdaterEmail: lastUpdaterEmail - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - creatorFullName: creatorFullName - lastUpdaterFullName: lastUpdaterFullName - comparisonAttribute: comparisonAttribute - updatedAt: 2000-01-23T04:56:07.000+00:00 - properties: - product: - $ref: '#/components/schemas/ProductModel' - segmentId: - description: Identifier of the Segment. - format: uuid - type: string - name: - description: Name of the Segment. - nullable: true - type: string - description: - description: Description of the Segment. - nullable: true - type: string - creatorEmail: - description: The email of the user who created the Segment. - nullable: true - type: string - creatorFullName: - description: The name of the user who created the Segment. - nullable: true - type: string - createdAt: - description: The date and time when the Segment was created. - format: date-time - type: string - lastUpdaterEmail: - description: The email of the user who last updated the Segment. - nullable: true - type: string - lastUpdaterFullName: - description: The name of the user who last updated the Segment. - nullable: true - type: string - updatedAt: - description: The date and time when the Segment was last updated. - format: date-time - type: string - comparisonAttribute: - description: The user's attribute the evaluation process must take into - account. - nullable: true - type: string - comparator: - $ref: '#/components/schemas/RolloutRuleComparator' - comparisonValue: - description: The value to compare with the given user attribute's value. - nullable: true - type: string - type: object - SettingDataModel: - description: Metadata of a Feature Flag or Setting. - example: - createdAt: 2000-01-23T04:56:07.000+00:00 - creatorEmail: creatorEmail - hint: hint - name: name - creatorFullName: creatorFullName - isWatching: true - settingType: boolean - key: key - settingId: 0 - order: 6 - properties: - settingId: - description: Identifier of the Feature Flag or Setting. - format: int32 - type: integer - key: - description: Key of the Feature Flag or Setting. - nullable: true - type: string - name: - description: Name of the Feature Flag or Setting. - nullable: true - type: string - hint: - description: Description of the Feature Flag or Setting. - nullable: true - type: string - settingType: - $ref: '#/components/schemas/SettingType' - order: - description: The order of the Feature Flag or Setting represented on the - ConfigCat Dashboard. - format: int32 - type: integer - createdAt: - description: The creation time of the Feature Flag or Setting. - format: date-time - nullable: true - type: string - creatorEmail: - description: The user's email address who created the Feature Flag or Setting. - nullable: true - type: string - creatorFullName: - description: The user's name who created the Feature Flag or Setting. - nullable: true - type: string - isWatching: - type: boolean - type: object - SettingFormulaModel: - example: - targetingRules: - - percentageOptions: - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentageOptions: - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - percentageEvaluationAttribute: percentageEvaluationAttribute - defaultValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - lastUpdaterUserEmail: lastUpdaterUserEmail - readOnly: true - setting: - createdAt: 2000-01-23T04:56:07.000+00:00 - creatorEmail: creatorEmail - hint: hint - name: name - creatorFullName: creatorFullName - isWatching: true - settingType: boolean - key: key - settingId: 0 - order: 6 - lastVersionId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - environment: - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - color: color - name: name - description: description - order: 0 - reasonRequired: true - featureFlagLimitations: - maxComparisonValueListItemLength: 9 - maxComparisonValueListLength: 7 - maxPercentageOptionCount: 5 - maxConditionPerTargetingRuleCount: 2 - maxComparisonValueLength: 2 - maxStringFlagValueLength: 3 - maxTargetingRuleCount: 5 - settingIdsWherePrerequisite: - - 2 - - 2 - integrationLinks: - - integrationLinkType: trello - description: description - key: key - url: url - - integrationLinkType: trello - description: description - key: key - url: url - config: - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - description: description - migratedConfigId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - evaluationVersion: v1 - order: 0 - settingTags: - - color: color - tagId: 1 - name: name - settingTagId: 6 - - color: color - tagId: 1 - name: name - settingTagId: 6 - updatedAt: 2000-01-23T04:56:07.000+00:00 - lastUpdaterUserFullName: lastUpdaterUserFullName - properties: - lastVersionId: - format: uuid - type: string - defaultValue: - $ref: '#/components/schemas/ValueModel' - targetingRules: - description: The targeting rules of the Feature Flag or Setting. - items: - $ref: '#/components/schemas/TargetingRuleModel' - nullable: true - type: array - setting: - $ref: '#/components/schemas/SettingDataModel' - updatedAt: - description: The last updated date and time when the Feature Flag or Setting. - format: date-time - nullable: true - type: string - percentageEvaluationAttribute: - description: "The user attribute used for percentage evaluation. If not\ - \ set, it defaults to the `Identifier` user object attribute." - nullable: true - type: string - lastUpdaterUserEmail: - description: The email of the user who last updated the Feature Flag or - Setting. - nullable: true - type: string - lastUpdaterUserFullName: - description: The name of the user who last updated the Feature Flag or Setting. - nullable: true - type: string - integrationLinks: - description: The integration links attached to the Feature Flag or Setting. - items: - $ref: '#/components/schemas/IntegrationLinkModel' - nullable: true - type: array - settingTags: - description: The tags attached to the Feature Flag or Setting. - items: - $ref: '#/components/schemas/SettingTagModel' - nullable: true - type: array - settingIdsWherePrerequisite: - description: List of Feature Flag and Setting IDs where the actual Feature - Flag or Setting is prerequisite. - items: - format: int32 - type: integer - nullable: true - type: array - config: - $ref: '#/components/schemas/ConfigModel' - environment: - $ref: '#/components/schemas/EnvironmentModel' - readOnly: - type: boolean - featureFlagLimitations: - $ref: '#/components/schemas/FeatureFlagLimitations' - type: object - SettingModel: - description: Metadata of a Feature Flag or Setting. - example: - configName: configName - createdAt: 2000-01-23T04:56:07.000+00:00 - configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - hint: hint - name: name - settingType: boolean - key: key - settingId: 0 - order: 6 - tags: - - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - color: color - tagId: 0 - name: name - - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - color: color - tagId: 0 - name: name - properties: - settingId: - description: Identifier of the Feature Flag or Setting. - format: int32 - type: integer - key: - description: Key of the Feature Flag or Setting. - nullable: true - type: string - name: - description: Name of the Feature Flag or Setting. - nullable: true - type: string - hint: - description: Description of the Feature Flag or Setting. - nullable: true - type: string - order: - description: The order of the Feature Flag or Setting represented on the - ConfigCat Dashboard. - format: int32 - type: integer - settingType: - $ref: '#/components/schemas/SettingType' - configId: - description: Identifier of the Feature Flag's Config. - format: uuid - type: string - configName: - description: Name of the Feature Flag's Config. - nullable: true - type: string - createdAt: - description: The creation time of the Feature Flag or Setting. - format: date-time - nullable: true - type: string - tags: - description: The tags attached to the Feature Flag or Setting. - items: - $ref: '#/components/schemas/TagModel' - nullable: true - type: array - type: object - SettingTagModel: - example: - color: color - tagId: 1 - name: name - settingTagId: 6 - properties: - settingTagId: - format: int64 - type: integer - tagId: - format: int64 - type: integer - name: - nullable: true - type: string - color: - nullable: true - type: string - type: object - SettingType: - description: The type of the Feature Flag or Setting. - enum: - - boolean - - string - - int - - double - type: string - SettingValueModel: - example: - rolloutRules: - - comparator: isOneOf - comparisonValue: comparisonValue - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn - value: "" - comparisonAttribute: comparisonAttribute - - comparator: isOneOf - comparisonValue: comparisonValue - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn - value: "" - comparisonAttribute: comparisonAttribute - rolloutPercentageItems: - - percentage: 0 - value: "" - - percentage: 0 - value: "" - lastUpdaterUserEmail: lastUpdaterUserEmail - readOnly: true - setting: - createdAt: 2000-01-23T04:56:07.000+00:00 - creatorEmail: creatorEmail - hint: hint - name: name - creatorFullName: creatorFullName - isWatching: true - settingType: boolean - key: key - settingId: 0 - order: 6 - environment: - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - color: color - name: name - description: description - order: 0 - reasonRequired: true - featureFlagLimitations: - maxComparisonValueListItemLength: 9 - maxComparisonValueListLength: 7 - maxPercentageOptionCount: 5 - maxConditionPerTargetingRuleCount: 2 - maxComparisonValueLength: 2 - maxStringFlagValueLength: 3 - maxTargetingRuleCount: 5 - value: "" - integrationLinks: - - integrationLinkType: trello - description: description - key: key - url: url - - integrationLinkType: trello - description: description - key: key - url: url - config: - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - description: description - migratedConfigId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - evaluationVersion: v1 - order: 0 - settingTags: - - color: color - tagId: 1 - name: name - settingTagId: 6 - - color: color - tagId: 1 - name: name - settingTagId: 6 - updatedAt: 2000-01-23T04:56:07.000+00:00 - lastUpdaterUserFullName: lastUpdaterUserFullName - properties: - rolloutRules: - description: The targeting rule collection. - items: - $ref: '#/components/schemas/RolloutRuleModel' - nullable: true - type: array - rolloutPercentageItems: - description: The percentage rule collection. - items: - $ref: '#/components/schemas/RolloutPercentageItemModel' - nullable: true - type: array - value: - description: The value to serve. It must respect the setting type. - nullable: true - setting: - $ref: '#/components/schemas/SettingDataModel' - updatedAt: - description: The last updated date and time when the Feature Flag or Setting. - format: date-time - nullable: true - type: string - lastUpdaterUserEmail: - description: The email of the user who last updated the Feature Flag or - Setting. - nullable: true - type: string - lastUpdaterUserFullName: - description: The name of the user who last updated the Feature Flag or Setting. - nullable: true - type: string - integrationLinks: - description: The integration links attached to the Feature Flag or Setting. - items: - $ref: '#/components/schemas/IntegrationLinkModel' - nullable: true - type: array - settingTags: - description: The tags attached to the Feature Flag or Setting. - items: - $ref: '#/components/schemas/SettingTagModel' - nullable: true - type: array - config: - $ref: '#/components/schemas/ConfigModel' - environment: - $ref: '#/components/schemas/EnvironmentModel' - featureFlagLimitations: - $ref: '#/components/schemas/FeatureFlagLimitations' - readOnly: - type: boolean - type: object - TagModel: - example: - product: - productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - organization: - organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - name: name - description: description - order: 0 - reasonRequired: true - color: color - tagId: 0 - name: name - properties: - product: - $ref: '#/components/schemas/ProductModel' - tagId: - description: Identifier of the Tag. - format: int64 - type: integer - name: - description: Name of the Tag. - nullable: true - type: string - color: - description: The configured color of the Tag. - nullable: true - type: string - type: object - TargetingRuleModel: - example: - percentageOptions: - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - properties: - conditions: - description: "The list of conditions that are combined with logical AND\ - \ operators.\r\nIt can be one of the following:\r\n- User condition\r\n\ - - Segment condition\r\n- Prerequisite flag condition" - items: - $ref: '#/components/schemas/ConditionModel' - nullable: true - type: array - percentageOptions: - description: The percentage options from where the evaluation process will - choose a value based on the flag's percentage evaluation attribute. - items: - $ref: '#/components/schemas/PercentageOptionModel' - nullable: true - type: array - value: - $ref: '#/components/schemas/ValueModel' - type: object - UpdateConfigRequest: - example: - name: name - description: description - order: 0 - properties: - name: - description: The name of the Config. - maxLength: 255 - minLength: 0 - nullable: true - type: string - description: - description: The description of the Config. - maxLength: 1000 - minLength: 0 - nullable: true - type: string - order: - description: "The order of the Config represented on the ConfigCat Dashboard.\r\ - \nDetermined from an ascending sequence of integers." - format: int32 - nullable: true - type: integer - type: object - UpdateEnvironmentModel: - example: - color: color - name: name - description: description - order: 0 - properties: - name: - description: The name of the Environment. - maxLength: 255 - minLength: 0 - nullable: true - type: string - color: - description: The color of the Environment. RGB or HTML color codes are allowed. - maxLength: 255 - minLength: 0 - nullable: true - type: string - description: - description: The description of the Environment. - maxLength: 1000 - minLength: 0 - nullable: true - type: string - order: - description: "The order of the Environment represented on the ConfigCat\ - \ Dashboard.\r\nDetermined from an ascending sequence of integers." - format: int32 - nullable: true - type: integer - type: object - UpdateEvaluationFormulaModel: - example: - targetingRules: - - percentageOptions: - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentageOptions: - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - percentageEvaluationAttribute: percentageEvaluationAttribute - defaultValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - properties: - defaultValue: - $ref: '#/components/schemas/ValueModel' - targetingRules: - description: The targeting rules of the Feature Flag or Setting. - items: - $ref: '#/components/schemas/TargetingRuleModel' - nullable: true - type: array - percentageEvaluationAttribute: - description: "The user attribute used for percentage evaluation. If not\ - \ set, it defaults to the `Identifier` user object attribute." - maxLength: 1000 - nullable: true - type: string - required: - - defaultValue - type: object - UpdateEvaluationFormulaWithIdModel: - example: - targetingRules: - - percentageOptions: - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentageOptions: - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - percentageEvaluationAttribute: percentageEvaluationAttribute - defaultValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - settingId: 0 - properties: - defaultValue: - $ref: '#/components/schemas/ValueModel' - targetingRules: - description: The targeting rules of the Feature Flag or Setting. - items: - $ref: '#/components/schemas/TargetingRuleModel' - nullable: true - type: array - percentageEvaluationAttribute: - description: "The user attribute used for percentage evaluation. If not\ - \ set, it defaults to the `Identifier` user object attribute." - maxLength: 1000 - nullable: true - type: string - settingId: - description: The identifier of the feature flag or setting. - format: int32 - type: integer - required: - - defaultValue - type: object - UpdateEvaluationFormulasModel: - example: - updateFormulas: - - targetingRules: - - percentageOptions: - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentageOptions: - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - percentageEvaluationAttribute: percentageEvaluationAttribute - defaultValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - settingId: 0 - - targetingRules: - - percentageOptions: - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentageOptions: - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - - percentage: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - conditions: - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - - segmentCondition: - comparator: isIn - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - userCondition: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - prerequisiteFlagCondition: - comparator: equals - prerequisiteComparisonValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - prerequisiteSettingId: 5 - value: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - percentageEvaluationAttribute: percentageEvaluationAttribute - defaultValue: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - settingId: 0 - properties: - updateFormulas: - description: Evaluation descriptors of each updated Feature Flag and Setting. - items: - $ref: '#/components/schemas/UpdateEvaluationFormulaWithIdModel' - nullable: true - type: array - type: object - UpdateMemberPermissionsRequest: - example: - removeFromPermissionGroupsWhereIdNotSet: true - isBillingManager: true - permissionGroupIds: - - 0 - - 0 - isAdmin: true - properties: - permissionGroupIds: - description: List of Permission Group identifiers to where the Member should - be added. - items: - format: int64 - type: integer - nullable: true - type: array - isAdmin: - description: Indicates that the member must be Organization Admin. - nullable: true - type: boolean - isBillingManager: - description: Indicates that the member must be Billing Manager. - nullable: true - type: boolean - removeFromPermissionGroupsWhereIdNotSet: - description: "When `true`, the member will be removed from those Permission\ - \ Groups that are not listed in the `permissionGroupIds` field." - type: boolean - type: object - UpdatePermissionGroupRequest: - example: - canViewProductStatistics: true - canDeleteTag: true - environmentAccesses: - - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - environmentAccessType: null - - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - environmentAccessType: null - canManageProductPreferences: true - canManageIntegrations: true - canDeleteSegments: true - accessType: readOnly - canManageMembers: true - canManageWebhook: true - canUseExportImport: true - canViewSdkKey: true - canDeleteSetting: true - canRotateSdkKey: true - canCreateOrUpdateSegments: true - canCreateOrUpdateSetting: true - canDeleteConfig: true - canDisable2FA: true - canDeleteEnvironment: true - canCreateOrUpdateConfig: true - canTagSetting: true - canCreateOrUpdateEnvironment: true - name: name - canViewProductAuditLog: true - canCreateOrUpdateTag: true - newEnvironmentAccessType: full - properties: - name: - description: Name of the Permission Group. - maxLength: 255 - minLength: 0 - nullable: true - type: string - canManageMembers: - description: Group members can manage team members. - nullable: true - type: boolean - canCreateOrUpdateConfig: - description: Group members can create/update Configs. - nullable: true - type: boolean - canDeleteConfig: - description: Group members can delete Configs. - nullable: true - type: boolean - canCreateOrUpdateEnvironment: - description: Group members can create/update Environments. - nullable: true - type: boolean - canDeleteEnvironment: - description: Group members can delete Environments. - nullable: true - type: boolean - canCreateOrUpdateSetting: - description: Group members can create/update Feature Flags and Settings. - nullable: true - type: boolean - canTagSetting: - description: Group members can attach/detach Tags to Feature Flags and Settings. - nullable: true - type: boolean - canDeleteSetting: - description: Group members can delete Feature Flags and Settings. - nullable: true - type: boolean - canCreateOrUpdateTag: - description: Group members can create/update Tags. - nullable: true - type: boolean - canDeleteTag: - description: Group members can delete Tags. - nullable: true - type: boolean - canManageWebhook: - description: Group members can create/update/delete Webhooks. - nullable: true - type: boolean - canUseExportImport: - description: Group members can use the export/import feature. - nullable: true - type: boolean - canManageProductPreferences: - description: Group members can update Product preferences. - nullable: true - type: boolean - canManageIntegrations: - description: Group members can add and configure integrations. - nullable: true - type: boolean - canViewSdkKey: - description: Group members has access to SDK keys. - nullable: true - type: boolean - canRotateSdkKey: - description: Group members can rotate SDK keys. - nullable: true - type: boolean - canCreateOrUpdateSegments: - description: Group members can create/update Segments. - nullable: true - type: boolean - canDeleteSegments: - description: Group members can delete Segments. - nullable: true - type: boolean - canViewProductAuditLog: - description: Group members has access to audit logs. - nullable: true - type: boolean - canViewProductStatistics: - description: Group members has access to product statistics. - nullable: true - type: boolean - canDisable2FA: - description: Group members can disable two-factor authentication for other - members. - nullable: true - type: boolean - accessType: - $ref: '#/components/schemas/AccessType' - newEnvironmentAccessType: - $ref: '#/components/schemas/EnvironmentAccessType' - environmentAccesses: - description: List of environment specific permissions. - items: - $ref: '#/components/schemas/CreateOrUpdateEnvironmentAccessModel' - nullable: true - type: array - type: object - UpdatePreferencesRequest: - example: - keyGenerationMode: camelCase - showVariationId: true - mandatorySettingHint: true - reasonRequiredEnvironments: - - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - reasonRequired: true - - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - reasonRequired: true - reasonRequired: true - properties: - reasonRequired: - description: Indicates that a mandatory note is required for saving and - publishing. - nullable: true - type: boolean - keyGenerationMode: - $ref: '#/components/schemas/KeyGenerationMode' - showVariationId: - description: Indicates whether a variation ID's must be shown on the ConfigCat - Dashboard. - nullable: true - type: boolean - mandatorySettingHint: - description: Indicates whether Feature flags and Settings must have a hint. - nullable: true - type: boolean - reasonRequiredEnvironments: - description: List of Environments where mandatory note must be set before - saving and publishing. - items: - $ref: '#/components/schemas/UpdateReasonRequiredEnvironmentModel' - nullable: true - type: array - type: object - UpdateProductRequest: - example: - name: name - description: description - order: 0 - properties: - name: - description: The name of the Product. - maxLength: 1000 - minLength: 0 - nullable: true - type: string - description: - description: The description of the Product. - maxLength: 1000 - minLength: 0 - nullable: true - type: string - order: - description: "The order of the Product represented on the ConfigCat Dashboard.\r\ - \nDetermined from an ascending sequence of integers." - format: int32 - nullable: true - type: integer - type: object - UpdateReasonRequiredEnvironmentModel: - example: - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - reasonRequired: true - properties: - environmentId: - description: Identifier of the Environment. - format: uuid - type: string - reasonRequired: - description: Indicates that a mandatory note is required in this Environment - for saving and publishing. - type: boolean - type: object - UpdateSegmentModel: - example: - comparator: isOneOf - comparisonValue: comparisonValue - name: name - description: description - comparisonAttribute: comparisonAttribute - properties: - name: - maxLength: 255 - minLength: 0 - nullable: true - type: string - description: - maxLength: 1000 - minLength: 0 - nullable: true - type: string - comparisonAttribute: - maxLength: 1000 - minLength: 0 - nullable: true - type: string - comparator: - $ref: '#/components/schemas/RolloutRuleComparator' - comparisonValue: - nullable: true - type: string - type: object - UpdateSettingValueModel: - example: - rolloutRules: - - comparator: isOneOf - comparisonValue: comparisonValue - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn - value: "" - comparisonAttribute: comparisonAttribute - - comparator: isOneOf - comparisonValue: comparisonValue - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn - value: "" - comparisonAttribute: comparisonAttribute - rolloutPercentageItems: - - percentage: 0 - value: "" - - percentage: 0 - value: "" - value: "" - properties: - rolloutRules: - description: The targeting rule collection. - items: - $ref: '#/components/schemas/RolloutRuleModel' - nullable: true - type: array - rolloutPercentageItems: - description: The percentage rule collection. - items: - $ref: '#/components/schemas/RolloutPercentageItemModel' - nullable: true - type: array - value: - description: The value to serve. It must respect the setting type. - nullable: true - type: object - UpdateSettingValueWithSettingIdModel: - example: - rolloutRules: - - comparator: isOneOf - comparisonValue: comparisonValue - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn - value: "" - comparisonAttribute: comparisonAttribute - - comparator: isOneOf - comparisonValue: comparisonValue - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn - value: "" - comparisonAttribute: comparisonAttribute - rolloutPercentageItems: - - percentage: 0 - value: "" - - percentage: 0 - value: "" - value: "" - settingId: 0 - properties: - rolloutRules: - description: The targeting rule collection. - items: - $ref: '#/components/schemas/RolloutRuleModel' - nullable: true - type: array - rolloutPercentageItems: - description: The percentage rule collection. - items: - $ref: '#/components/schemas/RolloutPercentageItemModel' - nullable: true - type: array - value: - description: The value to serve. It must respect the setting type. - nullable: true - settingId: - description: The id of the Setting. - format: int32 - type: integer - type: object - UpdateSettingValuesWithIdModel: - example: - settingValues: - - rolloutRules: - - comparator: isOneOf - comparisonValue: comparisonValue - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn - value: "" - comparisonAttribute: comparisonAttribute - - comparator: isOneOf - comparisonValue: comparisonValue - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn - value: "" - comparisonAttribute: comparisonAttribute - rolloutPercentageItems: - - percentage: 0 - value: "" - - percentage: 0 - value: "" - value: "" - settingId: 0 - - rolloutRules: - - comparator: isOneOf - comparisonValue: comparisonValue - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn - value: "" - comparisonAttribute: comparisonAttribute - - comparator: isOneOf - comparisonValue: comparisonValue - segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - segmentComparator: isIn - value: "" - comparisonAttribute: comparisonAttribute - rolloutPercentageItems: - - percentage: 0 - value: "" - - percentage: 0 - value: "" - value: "" - settingId: 0 - properties: - settingValues: - description: The values to update. - items: - $ref: '#/components/schemas/UpdateSettingValueWithSettingIdModel' - nullable: true - type: array - type: object - UpdateTagModel: - example: - color: color - name: name - properties: - name: - description: Name of the Tag. - maxLength: 255 - minLength: 0 - nullable: true - type: string - color: - description: "Color of the Tag. Possible values: `panther`, `whale`, `salmon`,\ - \ `lizard`, `canary`, `koala`, or any HTML color code." - maxLength: 255 - minLength: 0 - nullable: true - type: string - type: object - UserComparator: - description: The comparison operator which defines the relation between the - comparison attribute and the comparison value. - enum: - - isOneOf - - isNotOneOf - - containsAnyOf - - doesNotContainAnyOf - - semVerIsOneOf - - semVerIsNotOneOf - - semVerLess - - semVerLessOrEquals - - semVerGreater - - semVerGreaterOrEquals - - numberEquals - - numberDoesNotEqual - - numberLess - - numberLessOrEquals - - numberGreater - - numberGreaterOrEquals - - sensitiveIsOneOf - - sensitiveIsNotOneOf - - dateTimeBefore - - dateTimeAfter - - sensitiveTextEquals - - sensitiveTextDoesNotEqual - - sensitiveTextStartsWithAnyOf - - sensitiveTextNotStartsWithAnyOf - - sensitiveTextEndsWithAnyOf - - sensitiveTextNotEndsWithAnyOf - - sensitiveArrayContainsAnyOf - - sensitiveArrayDoesNotContainAnyOf - - textEquals - - textDoesNotEqual - - textStartsWithAnyOf - - textNotStartsWithAnyOf - - textEndsWithAnyOf - - textNotEndsWithAnyOf - - arrayContainsAnyOf - - arrayDoesNotContainAnyOf - type: string - UserConditionModel: - description: Describes a condition that is based on user attributes. - example: - comparator: isOneOf - comparisonValue: - listValue: - - hint: hint - value: value - - hint: hint - value: value - stringValue: stringValue - doubleValue: 1.4658129805029452 - comparisonAttribute: comparisonAttribute - properties: - comparisonAttribute: - description: "The User Object attribute that the condition is based on.\ - \ Can be \"User ID\", \"Email\", \"Country\" or any custom attribute." - maxLength: 1000 - minLength: 1 - type: string - comparator: - $ref: '#/components/schemas/UserComparator' - comparisonValue: - $ref: '#/components/schemas/ComparisonValueModel' - required: - - comparator - - comparisonAttribute - - comparisonValue - type: object - UserModel: - example: - twoFactorEnabled: true - fullName: fullName - userId: userId - email: email - properties: - userId: - description: Identifier of the Member. - nullable: true - type: string - fullName: - description: Name of the Member. - nullable: true - type: string - email: - description: Email of the Member. - nullable: true - type: string - twoFactorEnabled: - description: Determines whether 2FA is enabled for the Member. - type: boolean - type: object - ValueModel: - description: Represents the value of a Feature Flag or Setting. - example: - stringValue: stringValue - intValue: 0 - boolValue: true - doubleValue: 6.027456183070403 - properties: - boolValue: - description: The served value in case of a boolean Feature Flag. - nullable: true - type: boolean - stringValue: - description: The served value in case of a text Setting. - nullable: true - type: string - intValue: - description: The served value in case of a whole number Setting. - format: int32 - nullable: true - type: integer - doubleValue: - description: The served value in case of a decimal number Setting. - format: double - nullable: true - type: number - type: object - WebHookHttpMethod: - enum: - - get - - post - type: string - WebHookRequest: - example: - webHookHeaders: - - isSecure: true - value: value - key: key - - isSecure: true - value: value - key: key - httpMethod: get - url: url - content: content - properties: - url: - description: The URL of the Webhook. - maxLength: 1000 - minLength: 7 - type: string - content: - description: The HTTP body content. - maxLength: 15000 - minLength: 0 - nullable: true - type: string - httpMethod: - $ref: '#/components/schemas/WebHookHttpMethod' - webHookHeaders: - description: List of HTTP headers. - items: - $ref: '#/components/schemas/WebhookHeaderModel' - nullable: true - type: array - required: - - url - type: object - WebhookConfig: - description: The Config where the applied changes will invoke the Webhook. - example: - configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - properties: - name: - description: The Config's name. - nullable: true - type: string - configId: - description: The Config's identifier. - format: uuid - type: string - type: object - WebhookEnvironment: - description: The Environment where the applied changes will invoke the Webhook. - example: - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - properties: - name: - description: The Environment's name. - nullable: true - type: string - environmentId: - description: The Environment's identifier. - format: uuid - type: string - type: object - WebhookHeaderModel: - example: - isSecure: true - value: value - key: key - properties: - key: - description: The HTTP header key. - maxLength: 255 - minLength: 1 - type: string - value: - description: The HTTP header value. - maxLength: 1000 - minLength: 1 - type: string - isSecure: - description: Indicates whether the header value is sensitive. - type: boolean - required: - - key - - value - type: object - WebhookModel: - example: - webHookHeaders: - - isSecure: true - value: value - key: key - - isSecure: true - value: value - key: key - environment: - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - webhookId: 0 - httpMethod: get - config: - configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - name: name - url: url - content: content - properties: - webhookId: - description: The identifier of the Webhook. - format: int32 - type: integer - url: - description: The URL of the Webhook. - nullable: true - type: string - httpMethod: - $ref: '#/components/schemas/WebHookHttpMethod' - content: - description: The HTTP body content. - nullable: true - type: string - webHookHeaders: - description: List of HTTP headers that the Webhook must send. - items: - $ref: '#/components/schemas/WebhookHeaderModel' - nullable: true - type: array - config: - $ref: '#/components/schemas/WebhookConfig' - environment: - $ref: '#/components/schemas/WebhookEnvironment' - type: object - WebhookSigningKeysModel: - example: - key1: key1 - key2: key2 - properties: - key1: - description: The first signing key. - nullable: true - type: string - key2: - description: The second signing key. - nullable: true - type: string - type: object - securitySchemes: - Basic: - description: |- - To authenticate with the API you have to fill the `Authorization` HTTP request header with your Public API credentials. - - You can create your credentials on the Public API credentials management page. - scheme: basic - type: http -x-tagGroups: -- name: Feature Flag values V2 - tags: - - Feature Flag & Setting values using SDK Key V2 - - Feature Flag & Setting values V2 -- name: Feature Flag values (legacy) - tags: - - Feature Flag & Setting values using SDK Key - - Feature Flag & Setting values -- name: Feature Flag metadata - tags: - - Feature Flags & Settings - - Tags -- name: General - tags: - - Products - - Configs - - Environments - - Segments - - SDK Keys - - Webhooks - - Integrations - - Code References -- name: Membership - tags: - - Organizations - - Members - - Permission Groups -- name: Diagnostics - tags: - - Audit logs - - Me - diff --git a/build.gradle b/build.gradle index 7e2293b..ce7d421 100644 --- a/build.gradle +++ b/build.gradle @@ -22,7 +22,7 @@ plugins { } group = 'com.configcat' -version = '1.1.1' +version = '2.0.0' sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 diff --git a/docs/AccessType.md b/docs/AccessType.md deleted file mode 100644 index c0f13ef..0000000 --- a/docs/AccessType.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# AccessType - -## Enum - - -* `READ_ONLY` (value: `"readOnly"`) - -* `FULL` (value: `"full"`) - -* `CUSTOM` (value: `"custom"`) - - - diff --git a/docs/AddOrUpdateIntegrationLinkModel.md b/docs/AddOrUpdateIntegrationLinkModel.md deleted file mode 100644 index 1c5c89e..0000000 --- a/docs/AddOrUpdateIntegrationLinkModel.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# AddOrUpdateIntegrationLinkModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**description** | **String** | | [optional] | -|**url** | **String** | | [optional] | - - - diff --git a/docs/AddOrUpdateJiraIntegrationLinkModel.md b/docs/AddOrUpdateJiraIntegrationLinkModel.md deleted file mode 100644 index 2933b2b..0000000 --- a/docs/AddOrUpdateJiraIntegrationLinkModel.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# AddOrUpdateJiraIntegrationLinkModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**jiraJwtToken** | **String** | | | -|**clientKey** | **String** | | | -|**description** | **String** | | [optional] | -|**url** | **String** | | [optional] | - - - diff --git a/docs/AuditLogItemModel.md b/docs/AuditLogItemModel.md deleted file mode 100644 index 059b8b8..0000000 --- a/docs/AuditLogItemModel.md +++ /dev/null @@ -1,24 +0,0 @@ - - -# AuditLogItemModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**auditLogId** | **Long** | | [optional] | -|**auditLogDateTime** | **OffsetDateTime** | | [optional] | -|**auditLogTypeEnum** | **AuditLogType** | | [optional] | -|**changeSetId** | **UUID** | | [optional] | -|**truncated** | **Boolean** | | [optional] | -|**auditLogType** | **String** | | [optional] | -|**userEmail** | **String** | | [optional] | -|**userName** | **String** | | [optional] | -|**where** | **String** | | [optional] | -|**why** | **String** | | [optional] | -|**actionTarget** | **String** | | [optional] | -|**details** | **String** | | [optional] | - - - diff --git a/docs/AuditLogType.md b/docs/AuditLogType.md deleted file mode 100644 index 0c205d6..0000000 --- a/docs/AuditLogType.md +++ /dev/null @@ -1,187 +0,0 @@ - - -# AuditLogType - -## Enum - - -* `PRODUCT_CREATED` (value: `"productCreated"`) - -* `PRODUCT_CHANGED` (value: `"productChanged"`) - -* `PRODUCT_OWNERSHIP_TRANSFERRED` (value: `"productOwnershipTransferred"`) - -* `PRODUCT_DELETED` (value: `"productDeleted"`) - -* `PRODUCTS_REORDERED` (value: `"productsReordered"`) - -* `TEAM_MEMBER_INVITED` (value: `"teamMemberInvited"`) - -* `TEAM_MEMBER_INVITATION_REVOKED` (value: `"teamMemberInvitationRevoked"`) - -* `TEAM_MEMBER_JOINED` (value: `"teamMemberJoined"`) - -* `TEAM_MEMBER_PERMISSION_GROUP_CHANGED` (value: `"teamMemberPermissionGroupChanged"`) - -* `TEAM_MEMBER_REMOVED` (value: `"teamMemberRemoved"`) - -* `TEAM_MEMBER_LEFT` (value: `"teamMemberLeft"`) - -* `TEAM_MEMBER_INVITATION_CHANGED` (value: `"teamMemberInvitationChanged"`) - -* `TEAM_MEMBER_INVITATION_RESENT` (value: `"teamMemberInvitationResent"`) - -* `TEAM_MEMBER_INVITATION_REJECTED` (value: `"teamMemberInvitationRejected"`) - -* `CONFIG_CREATED` (value: `"configCreated"`) - -* `CONFIG_CHANGED` (value: `"configChanged"`) - -* `CONFIG_DELETED` (value: `"configDeleted"`) - -* `CONFIGS_REORDERED` (value: `"configsReordered"`) - -* `ENVIRONMENT_CREATED` (value: `"environmentCreated"`) - -* `ENVIRONMENT_CHANGED` (value: `"environmentChanged"`) - -* `ENVIRONMENT_DELETED` (value: `"environmentDeleted"`) - -* `ENVIRONMENTS_REORDERED` (value: `"environmentsReordered"`) - -* `SETTING_CREATED` (value: `"settingCreated"`) - -* `SETTING_CHANGED` (value: `"settingChanged"`) - -* `SETTING_DELETED` (value: `"settingDeleted"`) - -* `SETTINGS_REORDERED` (value: `"settingsReordered"`) - -* `SETTING_VALUE_CHANGED` (value: `"settingValueChanged"`) - -* `WEB_HOOK_CREATED` (value: `"webHookCreated"`) - -* `WEB_HOOK_CHANGED` (value: `"webHookChanged"`) - -* `WEB_HOOK_DELETED` (value: `"webHookDeleted"`) - -* `PERMISSION_GROUP_CREATED` (value: `"permissionGroupCreated"`) - -* `PERMISSION_GROUP_CHANGED` (value: `"permissionGroupChanged"`) - -* `PERMISSION_GROUP_DELETED` (value: `"permissionGroupDeleted"`) - -* `PERMISSION_GROUP_DEFAULT` (value: `"permissionGroupDefault"`) - -* `API_KEY_ADDED` (value: `"apiKeyAdded"`) - -* `API_KEY_REMOVED` (value: `"apiKeyRemoved"`) - -* `INTEGRATION_ADDED` (value: `"integrationAdded"`) - -* `INTEGRATION_CHANGED` (value: `"integrationChanged"`) - -* `INTEGRATION_REMOVED` (value: `"integrationRemoved"`) - -* `API_KEY_CONNECTED` (value: `"apiKeyConnected"`) - -* `INTEGRATION_LINK_ADDED` (value: `"integrationLinkAdded"`) - -* `INTEGRATION_LINK_REMOVED` (value: `"integrationLinkRemoved"`) - -* `ORGANIZATION_ADDED` (value: `"organizationAdded"`) - -* `ORGANIZATION_REMOVED` (value: `"organizationRemoved"`) - -* `ORGANIZATION_CHANGED` (value: `"organizationChanged"`) - -* `ORGANIZATION_SUBSCRIPTION_TYPE_CHANGED` (value: `"organizationSubscriptionTypeChanged"`) - -* `ORGANIZATION_ADMIN_CHANGED` (value: `"organizationAdminChanged"`) - -* `ORGANIZATION_ADMIN_LEFT` (value: `"organizationAdminLeft"`) - -* `TWO_FACTOR_DISABLED_FOR_MEMBER` (value: `"twoFactorDisabledForMember"`) - -* `TAG_ADDED` (value: `"tagAdded"`) - -* `TAG_CHANGED` (value: `"tagChanged"`) - -* `TAG_REMOVED` (value: `"tagRemoved"`) - -* `SETTING_TAG_ADDED` (value: `"settingTagAdded"`) - -* `SETTING_TAG_REMOVED` (value: `"settingTagRemoved"`) - -* `PUBLIC_API_ACCESS_TOKEN_ADDED` (value: `"publicApiAccessTokenAdded"`) - -* `PUBLIC_API_ACCESS_TOKEN_REMOVED` (value: `"publicApiAccessTokenRemoved"`) - -* `DOMAIN_ADDED` (value: `"domainAdded"`) - -* `DOMAIN_VERIFIED` (value: `"domainVerified"`) - -* `DOMAIN_REMOVED` (value: `"domainRemoved"`) - -* `DOMAIN_SAML_CONFIGURED` (value: `"domainSamlConfigured"`) - -* `DOMAIN_SAML_DELETED` (value: `"domainSamlDeleted"`) - -* `AUTO_PROVISIONING_CONFIGURATION_CHANGED` (value: `"autoProvisioningConfigurationChanged"`) - -* `SAML_IDP_CONFIGURATION_ADDED` (value: `"samlIdpConfigurationAdded"`) - -* `SAML_IDP_CONFIGURATION_REMOVED` (value: `"samlIdpConfigurationRemoved"`) - -* `SAML_IDP_CONFIGURATION_UPDATED` (value: `"samlIdpConfigurationUpdated"`) - -* `AUTO_PROVISIONING_ENABLED_CHANGED` (value: `"autoProvisioningEnabledChanged"`) - -* `ORGANIZATION_MEMBER_JOINED` (value: `"organizationMemberJoined"`) - -* `ORGANIZATION_MEMBER_PRODUCT_JOIN_REQUESTED` (value: `"organizationMemberProductJoinRequested"`) - -* `ORGANIZATION_MEMBER_PRODUCT_JOIN_REQUEST_REJECTED` (value: `"organizationMemberProductJoinRequestRejected"`) - -* `ORGANIZATION_MEMBER_PRODUCT_JOIN_REQUEST_APPROVED` (value: `"organizationMemberProductJoinRequestApproved"`) - -* `ORGANIZATION_MEMBER_REMOVED` (value: `"organizationMemberRemoved"`) - -* `CODE_REFERENCES_UPLOADED` (value: `"codeReferencesUploaded"`) - -* `CODE_REFERENCE_DELETED` (value: `"codeReferenceDeleted"`) - -* `CODE_REFERENCE_STALE_BRANCH_DELETED` (value: `"codeReferenceStaleBranchDeleted"`) - -* `SEGMENT_CREATED` (value: `"segmentCreated"`) - -* `SEGMENT_CHANGED` (value: `"segmentChanged"`) - -* `SEGMENT_DELETED` (value: `"segmentDeleted"`) - -* `WEBHOOK_SIGNING_KEY_DELETED` (value: `"webhookSigningKeyDeleted"`) - -* `WEBHOOK_SIGNING_KEY_CREATED` (value: `"webhookSigningKeyCreated"`) - -* `USER_PROVISIONING_CONFIGURATION_CHANGED` (value: `"userProvisioningConfigurationChanged"`) - -* `SYNC_GROUP_PROVISIONING_RULE_CHANGED` (value: `"syncGroupProvisioningRuleChanged"`) - -* `SYNC_GROUPS_REORDERED` (value: `"syncGroupsReordered"`) - -* `SYNC_USER_PROVISIONING_ENABLED` (value: `"syncUserProvisioningEnabled"`) - -* `SYNC_USER_PROVISIONING_DISABLED` (value: `"syncUserProvisioningDisabled"`) - -* `USER_EMAIL_CHANGED` (value: `"userEmailChanged"`) - -* `USER_FULL_NAME_CHANGED` (value: `"userFullNameChanged"`) - -* `USER_DISABLED` (value: `"userDisabled"`) - -* `AWS_CONNECTED` (value: `"awsConnected"`) - -* `AWS_DISCONNECTED` (value: `"awsDisconnected"`) - - - diff --git a/docs/AuditLogsApi.md b/docs/AuditLogsApi.md deleted file mode 100644 index 0b61b06..0000000 --- a/docs/AuditLogsApi.md +++ /dev/null @@ -1,246 +0,0 @@ -# AuditLogsApi - -All URIs are relative to *https://api.configcat.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**getAuditlogs**](AuditLogsApi.md#getAuditlogs) | **GET** /v1/products/{productId}/auditlogs | List Audit log items for Product | -| [**getDeletedSettings**](AuditLogsApi.md#getDeletedSettings) | **GET** /v1/configs/{configId}/deleted-settings | List Deleted Settings | -| [**getOrganizationAuditlogs**](AuditLogsApi.md#getOrganizationAuditlogs) | **GET** /v1/organizations/{organizationId}/auditlogs | List Audit log items for Organization | - - - -# **getAuditlogs** -> List<AuditLogItemModel> getAuditlogs(productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime) - -List Audit log items for Product - -This endpoint returns the list of Audit log items for a given Product and the result can be optionally filtered by Config and/or Environment. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.AuditLogsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - AuditLogsApi apiInstance = new AuditLogsApi(defaultClient); - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. - UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. - UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. - AuditLogType auditLogType = AuditLogType.fromValue("productCreated"); // AuditLogType | Filter Audit logs by Audit log type. - OffsetDateTime fromUtcDateTime = OffsetDateTime.now(); // OffsetDateTime | Filter Audit logs by starting UTC date. - OffsetDateTime toUtcDateTime = OffsetDateTime.now(); // OffsetDateTime | Filter Audit logs by ending UTC date. - try { - List result = apiInstance.getAuditlogs(productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AuditLogsApi#getAuditlogs"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **UUID**| The identifier of the Product. | | -| **configId** | **UUID**| The identifier of the Config. | [optional] | -| **environmentId** | **UUID**| The identifier of the Environment. | [optional] | -| **auditLogType** | [**AuditLogType**](.md)| Filter Audit logs by Audit log type. | [optional] [enum: productCreated, productChanged, productOwnershipTransferred, productDeleted, productsReordered, teamMemberInvited, teamMemberInvitationRevoked, teamMemberJoined, teamMemberPermissionGroupChanged, teamMemberRemoved, teamMemberLeft, teamMemberInvitationChanged, teamMemberInvitationResent, teamMemberInvitationRejected, configCreated, configChanged, configDeleted, configsReordered, environmentCreated, environmentChanged, environmentDeleted, environmentsReordered, settingCreated, settingChanged, settingDeleted, settingsReordered, settingValueChanged, webHookCreated, webHookChanged, webHookDeleted, permissionGroupCreated, permissionGroupChanged, permissionGroupDeleted, permissionGroupDefault, apiKeyAdded, apiKeyRemoved, integrationAdded, integrationChanged, integrationRemoved, apiKeyConnected, integrationLinkAdded, integrationLinkRemoved, organizationAdded, organizationRemoved, organizationChanged, organizationSubscriptionTypeChanged, organizationAdminChanged, organizationAdminLeft, twoFactorDisabledForMember, tagAdded, tagChanged, tagRemoved, settingTagAdded, settingTagRemoved, publicApiAccessTokenAdded, publicApiAccessTokenRemoved, domainAdded, domainVerified, domainRemoved, domainSamlConfigured, domainSamlDeleted, autoProvisioningConfigurationChanged, samlIdpConfigurationAdded, samlIdpConfigurationRemoved, samlIdpConfigurationUpdated, autoProvisioningEnabledChanged, organizationMemberJoined, organizationMemberProductJoinRequested, organizationMemberProductJoinRequestRejected, organizationMemberProductJoinRequestApproved, organizationMemberRemoved, codeReferencesUploaded, codeReferenceDeleted, codeReferenceStaleBranchDeleted, segmentCreated, segmentChanged, segmentDeleted, webhookSigningKeyDeleted, webhookSigningKeyCreated, userProvisioningConfigurationChanged, syncGroupProvisioningRuleChanged, syncGroupsReordered, syncUserProvisioningEnabled, syncUserProvisioningDisabled, userEmailChanged, userFullNameChanged, userDisabled, awsConnected, awsDisconnected] | -| **fromUtcDateTime** | **OffsetDateTime**| Filter Audit logs by starting UTC date. | [optional] | -| **toUtcDateTime** | **OffsetDateTime**| Filter Audit logs by ending UTC date. | [optional] | - -### Return type - -[**List<AuditLogItemModel>**](AuditLogItemModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getDeletedSettings** -> List<SettingModel> getDeletedSettings(configId) - -List Deleted Settings - -This endpoint returns the list of Feature Flags and Settings that were deleted from the given Config. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.AuditLogsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - AuditLogsApi apiInstance = new AuditLogsApi(defaultClient); - UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. - try { - List result = apiInstance.getDeletedSettings(configId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AuditLogsApi#getDeletedSettings"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **configId** | **UUID**| The identifier of the Config. | | - -### Return type - -[**List<SettingModel>**](SettingModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getOrganizationAuditlogs** -> List<AuditLogItemModel> getOrganizationAuditlogs(organizationId, productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime) - -List Audit log items for Organization - -This endpoint returns the list of Audit log items for a given Organization and the result can be optionally filtered by Product and/or Config and/or Environment. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.AuditLogsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - AuditLogsApi apiInstance = new AuditLogsApi(defaultClient); - UUID organizationId = UUID.randomUUID(); // UUID | The identifier of the Organization. - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. - UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. - UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. - AuditLogType auditLogType = AuditLogType.fromValue("productCreated"); // AuditLogType | Filter Audit logs by Audit log type. - OffsetDateTime fromUtcDateTime = OffsetDateTime.now(); // OffsetDateTime | Filter Audit logs by starting UTC date. - OffsetDateTime toUtcDateTime = OffsetDateTime.now(); // OffsetDateTime | Filter Audit logs by ending UTC date. - try { - List result = apiInstance.getOrganizationAuditlogs(organizationId, productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AuditLogsApi#getOrganizationAuditlogs"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **organizationId** | **UUID**| The identifier of the Organization. | | -| **productId** | **UUID**| The identifier of the Product. | [optional] | -| **configId** | **UUID**| The identifier of the Config. | [optional] | -| **environmentId** | **UUID**| The identifier of the Environment. | [optional] | -| **auditLogType** | [**AuditLogType**](.md)| Filter Audit logs by Audit log type. | [optional] [enum: productCreated, productChanged, productOwnershipTransferred, productDeleted, productsReordered, teamMemberInvited, teamMemberInvitationRevoked, teamMemberJoined, teamMemberPermissionGroupChanged, teamMemberRemoved, teamMemberLeft, teamMemberInvitationChanged, teamMemberInvitationResent, teamMemberInvitationRejected, configCreated, configChanged, configDeleted, configsReordered, environmentCreated, environmentChanged, environmentDeleted, environmentsReordered, settingCreated, settingChanged, settingDeleted, settingsReordered, settingValueChanged, webHookCreated, webHookChanged, webHookDeleted, permissionGroupCreated, permissionGroupChanged, permissionGroupDeleted, permissionGroupDefault, apiKeyAdded, apiKeyRemoved, integrationAdded, integrationChanged, integrationRemoved, apiKeyConnected, integrationLinkAdded, integrationLinkRemoved, organizationAdded, organizationRemoved, organizationChanged, organizationSubscriptionTypeChanged, organizationAdminChanged, organizationAdminLeft, twoFactorDisabledForMember, tagAdded, tagChanged, tagRemoved, settingTagAdded, settingTagRemoved, publicApiAccessTokenAdded, publicApiAccessTokenRemoved, domainAdded, domainVerified, domainRemoved, domainSamlConfigured, domainSamlDeleted, autoProvisioningConfigurationChanged, samlIdpConfigurationAdded, samlIdpConfigurationRemoved, samlIdpConfigurationUpdated, autoProvisioningEnabledChanged, organizationMemberJoined, organizationMemberProductJoinRequested, organizationMemberProductJoinRequestRejected, organizationMemberProductJoinRequestApproved, organizationMemberRemoved, codeReferencesUploaded, codeReferenceDeleted, codeReferenceStaleBranchDeleted, segmentCreated, segmentChanged, segmentDeleted, webhookSigningKeyDeleted, webhookSigningKeyCreated, userProvisioningConfigurationChanged, syncGroupProvisioningRuleChanged, syncGroupsReordered, syncUserProvisioningEnabled, syncUserProvisioningDisabled, userEmailChanged, userFullNameChanged, userDisabled, awsConnected, awsDisconnected] | -| **fromUtcDateTime** | **OffsetDateTime**| Filter Audit logs by starting UTC date. | [optional] | -| **toUtcDateTime** | **OffsetDateTime**| Filter Audit logs by ending UTC date. | [optional] | - -### Return type - -[**List<AuditLogItemModel>**](AuditLogItemModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - diff --git a/docs/CodeReferenceModel.md b/docs/CodeReferenceModel.md deleted file mode 100644 index c9726f1..0000000 --- a/docs/CodeReferenceModel.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# CodeReferenceModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**branch** | **String** | The source control branch on where the scan was performed. (Source of the branch selector on the ConfigCat Dashboard) | [optional] | -|**references** | [**List<ReferenceLines>**](ReferenceLines.md) | The actual references to the given Feature Flag or Setting. | [optional] | -|**commitUrl** | **String** | The related commit's URL. | [optional] | -|**commitHash** | **String** | The related commit's hash. | [optional] | -|**syncedAt** | **OffsetDateTime** | The date and time when the reference report was uploaded. | [optional] | -|**repository** | **String** | The source control repository that contains the scanned code. | [optional] | -|**codeReferenceId** | **UUID** | The identifier of the reference report. | [optional] | -|**uploader** | **String** | The code reference scanning tool's name. | [optional] | - - - diff --git a/docs/CodeReferenceRequest.md b/docs/CodeReferenceRequest.md deleted file mode 100644 index 912c806..0000000 --- a/docs/CodeReferenceRequest.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# CodeReferenceRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**configId** | **UUID** | The Config's identifier the scanning was performed against. | | -|**repository** | **String** | The source control repository that contains the scanned code. (Source of the repository selector on the ConfigCat Dashboard) | | -|**branch** | **String** | The source control branch on where the scan was performed. (Source of the branch selector on the ConfigCat Dashboard) | | -|**commitUrl** | **String** | The related commit's URL. (Appears on the ConfigCat Dashboard) | [optional] | -|**commitHash** | **String** | The related commit's hash. (Appears on the ConfigCat Dashboard) | [optional] | -|**uploader** | **String** | The scanning tool's name. (Appears on the ConfigCat Dashboard) | [optional] | -|**activeBranches** | **List<String>** | The currently active branches of the repository. Each previously uploaded report that belongs to a non-reported active branch is being deleted. | [optional] | -|**flagReferences** | [**List<FlagReference>**](FlagReference.md) | The actual code reference collection. | [optional] | - - - diff --git a/docs/CodeReferencesApi.md b/docs/CodeReferencesApi.md deleted file mode 100644 index a2e8ea0..0000000 --- a/docs/CodeReferencesApi.md +++ /dev/null @@ -1,222 +0,0 @@ -# CodeReferencesApi - -All URIs are relative to *https://api.configcat.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**v1CodeReferencesDeleteReportsPost**](CodeReferencesApi.md#v1CodeReferencesDeleteReportsPost) | **POST** /v1/code-references/delete-reports | Delete Reference reports | -| [**v1CodeReferencesPost**](CodeReferencesApi.md#v1CodeReferencesPost) | **POST** /v1/code-references | Upload References | -| [**v1SettingsSettingIdCodeReferencesGet**](CodeReferencesApi.md#v1SettingsSettingIdCodeReferencesGet) | **GET** /v1/settings/{settingId}/code-references | Get References for Feature Flag or Setting | - - - -# **v1CodeReferencesDeleteReportsPost** -> v1CodeReferencesDeleteReportsPost(deleteRepositoryReportsRequest) - -Delete Reference reports - - - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.CodeReferencesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - CodeReferencesApi apiInstance = new CodeReferencesApi(defaultClient); - DeleteRepositoryReportsRequest deleteRepositoryReportsRequest = new DeleteRepositoryReportsRequest(); // DeleteRepositoryReportsRequest | - try { - apiInstance.v1CodeReferencesDeleteReportsPost(deleteRepositoryReportsRequest); - } catch (ApiException e) { - System.err.println("Exception when calling CodeReferencesApi#v1CodeReferencesDeleteReportsPost"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **deleteRepositoryReportsRequest** | [**DeleteRepositoryReportsRequest**](DeleteRepositoryReportsRequest.md)| | | - -### Return type - -null (empty response body) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **v1CodeReferencesPost** -> v1CodeReferencesPost(codeReferenceRequest) - -Upload References - - - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.CodeReferencesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - CodeReferencesApi apiInstance = new CodeReferencesApi(defaultClient); - CodeReferenceRequest codeReferenceRequest = new CodeReferenceRequest(); // CodeReferenceRequest | - try { - apiInstance.v1CodeReferencesPost(codeReferenceRequest); - } catch (ApiException e) { - System.err.println("Exception when calling CodeReferencesApi#v1CodeReferencesPost"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **codeReferenceRequest** | [**CodeReferenceRequest**](CodeReferenceRequest.md)| | | - -### Return type - -null (empty response body) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **v1SettingsSettingIdCodeReferencesGet** -> List<CodeReferenceModel> v1SettingsSettingIdCodeReferencesGet(settingId) - -Get References for Feature Flag or Setting - - - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.CodeReferencesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - CodeReferencesApi apiInstance = new CodeReferencesApi(defaultClient); - Integer settingId = 56; // Integer | The identifier of the Feature Flag or Setting. - try { - List result = apiInstance.v1SettingsSettingIdCodeReferencesGet(settingId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling CodeReferencesApi#v1SettingsSettingIdCodeReferencesGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **settingId** | **Integer**| The identifier of the Feature Flag or Setting. | | - -### Return type - -[**List<CodeReferenceModel>**](CodeReferenceModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - diff --git a/docs/ComparisonValueListModel.md b/docs/ComparisonValueListModel.md deleted file mode 100644 index f66975b..0000000 --- a/docs/ComparisonValueListModel.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# ComparisonValueListModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**value** | **String** | The actual comparison value. | | -|**hint** | **String** | An optional hint for the comparison value. | [optional] | - - - diff --git a/docs/ComparisonValueModel.md b/docs/ComparisonValueModel.md deleted file mode 100644 index af7a8ad..0000000 --- a/docs/ComparisonValueModel.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# ComparisonValueModel - -The value that the user object's attribute is compared to. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**stringValue** | **String** | The string representation of the comparison value. | [optional] | -|**doubleValue** | **Double** | The number representation of the comparison value. | [optional] | -|**listValue** | [**List<ComparisonValueListModel>**](ComparisonValueListModel.md) | The list representation of the comparison value. | [optional] | - - - diff --git a/docs/ConditionModel.md b/docs/ConditionModel.md deleted file mode 100644 index 9d5f8df..0000000 --- a/docs/ConditionModel.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# ConditionModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**userCondition** | [**UserConditionModel**](UserConditionModel.md) | | [optional] | -|**segmentCondition** | [**SegmentConditionModel**](SegmentConditionModel.md) | | [optional] | -|**prerequisiteFlagCondition** | [**PrerequisiteFlagConditionModel**](PrerequisiteFlagConditionModel.md) | | [optional] | - - - diff --git a/docs/ConfigModel.md b/docs/ConfigModel.md deleted file mode 100644 index c50cf67..0000000 --- a/docs/ConfigModel.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# ConfigModel - -Details of the Config. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**product** | [**ProductModel**](ProductModel.md) | | [optional] | -|**configId** | **UUID** | Identifier of the Config. | [optional] | -|**name** | **String** | Name of the Config. | [optional] | -|**description** | **String** | Description of the Config. | [optional] | -|**order** | **Integer** | The order of the Config represented on the ConfigCat Dashboard. | [optional] | -|**migratedConfigId** | **UUID** | | [optional] | -|**evaluationVersion** | **EvaluationVersion** | | [optional] | - - - diff --git a/docs/ConfigSettingFormulaModel.md b/docs/ConfigSettingFormulaModel.md deleted file mode 100644 index 58f3dac..0000000 --- a/docs/ConfigSettingFormulaModel.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# ConfigSettingFormulaModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**lastVersionId** | **UUID** | | [optional] | -|**defaultValue** | [**ValueModel**](ValueModel.md) | | [optional] | -|**targetingRules** | [**List<TargetingRuleModel>**](TargetingRuleModel.md) | The targeting rules of the Feature Flag or Setting. | [optional] | -|**setting** | [**SettingDataModel**](SettingDataModel.md) | | [optional] | -|**updatedAt** | **OffsetDateTime** | The last updated date and time when the Feature Flag or Setting. | [optional] | -|**percentageEvaluationAttribute** | **String** | The user attribute used for percentage evaluation. If not set, it defaults to the `Identifier` user object attribute. | [optional] | -|**lastUpdaterUserEmail** | **String** | The email of the user who last updated the Feature Flag or Setting. | [optional] | -|**lastUpdaterUserFullName** | **String** | The name of the user who last updated the Feature Flag or Setting. | [optional] | -|**integrationLinks** | [**List<IntegrationLinkModel>**](IntegrationLinkModel.md) | The integration links attached to the Feature Flag or Setting. | [optional] | -|**settingTags** | [**List<SettingTagModel>**](SettingTagModel.md) | The tags attached to the Feature Flag or Setting. | [optional] | -|**settingIdsWherePrerequisite** | **List<Integer>** | List of Feature Flag and Setting IDs where the actual Feature Flag or Setting is prerequisite. | [optional] | - - - diff --git a/docs/ConfigSettingFormulasModel.md b/docs/ConfigSettingFormulasModel.md deleted file mode 100644 index 2928d39..0000000 --- a/docs/ConfigSettingFormulasModel.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# ConfigSettingFormulasModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**config** | [**ConfigModel**](ConfigModel.md) | | [optional] | -|**environment** | [**EnvironmentModel**](EnvironmentModel.md) | | [optional] | -|**readOnly** | **Boolean** | | [optional] | -|**settingFormulas** | [**List<ConfigSettingFormulaModel>**](ConfigSettingFormulaModel.md) | Evaluation descriptors of each updated Feature Flag and Setting. | [optional] | -|**featureFlagLimitations** | [**FeatureFlagLimitations**](FeatureFlagLimitations.md) | | [optional] | - - - diff --git a/docs/ConfigSettingValueModel.md b/docs/ConfigSettingValueModel.md deleted file mode 100644 index eb5f4be..0000000 --- a/docs/ConfigSettingValueModel.md +++ /dev/null @@ -1,21 +0,0 @@ - - -# ConfigSettingValueModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rolloutRules** | [**List<RolloutRuleModel>**](RolloutRuleModel.md) | The targeting rule collection. | [optional] | -|**rolloutPercentageItems** | [**List<RolloutPercentageItemModel>**](RolloutPercentageItemModel.md) | The percentage rule collection. | [optional] | -|**value** | **Object** | The value to serve. It must respect the setting type. | [optional] | -|**setting** | [**SettingDataModel**](SettingDataModel.md) | | [optional] | -|**updatedAt** | **OffsetDateTime** | The last updated date and time when the Feature Flag or Setting. | [optional] | -|**lastUpdaterUserEmail** | **String** | The email of the user who last updated the Feature Flag or Setting. | [optional] | -|**lastUpdaterUserFullName** | **String** | The name of the user who last updated the Feature Flag or Setting. | [optional] | -|**integrationLinks** | [**List<IntegrationLinkModel>**](IntegrationLinkModel.md) | The integration links attached to the Feature Flag or Setting. | [optional] | -|**settingTags** | [**List<SettingTagModel>**](SettingTagModel.md) | The tags attached to the Feature Flag or Setting. | [optional] | - - - diff --git a/docs/ConfigSettingValuesModel.md b/docs/ConfigSettingValuesModel.md deleted file mode 100644 index 7ef6f5d..0000000 --- a/docs/ConfigSettingValuesModel.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# ConfigSettingValuesModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**config** | [**ConfigModel**](ConfigModel.md) | | [optional] | -|**environment** | [**EnvironmentModel**](EnvironmentModel.md) | | [optional] | -|**readOnly** | **Boolean** | | [optional] | -|**settingValues** | [**List<ConfigSettingValueModel>**](ConfigSettingValueModel.md) | | [optional] | -|**featureFlagLimitations** | [**FeatureFlagLimitations**](FeatureFlagLimitations.md) | | [optional] | - - - diff --git a/docs/ConfigsApi.md b/docs/ConfigsApi.md deleted file mode 100644 index 5cb3740..0000000 --- a/docs/ConfigsApi.md +++ /dev/null @@ -1,371 +0,0 @@ -# ConfigsApi - -All URIs are relative to *https://api.configcat.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**createConfig**](ConfigsApi.md#createConfig) | **POST** /v1/products/{productId}/configs | Create Config | -| [**deleteConfig**](ConfigsApi.md#deleteConfig) | **DELETE** /v1/configs/{configId} | Delete Config | -| [**getConfig**](ConfigsApi.md#getConfig) | **GET** /v1/configs/{configId} | Get Config | -| [**getConfigs**](ConfigsApi.md#getConfigs) | **GET** /v1/products/{productId}/configs | List Configs | -| [**updateConfig**](ConfigsApi.md#updateConfig) | **PUT** /v1/configs/{configId} | Update Config | - - - -# **createConfig** -> ConfigModel createConfig(productId, createConfigRequest) - -Create Config - -This endpoint creates a new Config in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.ConfigsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - ConfigsApi apiInstance = new ConfigsApi(defaultClient); - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. - CreateConfigRequest createConfigRequest = new CreateConfigRequest(); // CreateConfigRequest | - try { - ConfigModel result = apiInstance.createConfig(productId, createConfigRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ConfigsApi#createConfig"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **UUID**| The identifier of the Product. | | -| **createConfigRequest** | [**CreateConfigRequest**](CreateConfigRequest.md)| | | - -### Return type - -[**ConfigModel**](ConfigModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **201** | When the creation was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **deleteConfig** -> deleteConfig(configId) - -Delete Config - -This endpoint removes a Config identified by the `configId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.ConfigsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - ConfigsApi apiInstance = new ConfigsApi(defaultClient); - UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. - try { - apiInstance.deleteConfig(configId); - } catch (ApiException e) { - System.err.println("Exception when calling ConfigsApi#deleteConfig"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **configId** | **UUID**| The identifier of the Config. | | - -### Return type - -null (empty response body) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **204** | When the delete was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getConfig** -> ConfigModel getConfig(configId) - -Get Config - -This endpoint returns the metadata of a Config identified by the `configId`. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.ConfigsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - ConfigsApi apiInstance = new ConfigsApi(defaultClient); - UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. - try { - ConfigModel result = apiInstance.getConfig(configId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ConfigsApi#getConfig"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **configId** | **UUID**| The identifier of the Config. | | - -### Return type - -[**ConfigModel**](ConfigModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When everything is ok, the config data returned. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getConfigs** -> List<ConfigModel> getConfigs(productId) - -List Configs - -This endpoint returns the list of the Configs that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.ConfigsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - ConfigsApi apiInstance = new ConfigsApi(defaultClient); - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. - try { - List result = apiInstance.getConfigs(productId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ConfigsApi#getConfigs"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **UUID**| The identifier of the Product. | | - -### Return type - -[**List<ConfigModel>**](ConfigModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **updateConfig** -> ConfigModel updateConfig(configId, updateConfigRequest) - -Update Config - -This endpoint updates a Config identified by the `configId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.ConfigsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - ConfigsApi apiInstance = new ConfigsApi(defaultClient); - UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. - UpdateConfigRequest updateConfigRequest = new UpdateConfigRequest(); // UpdateConfigRequest | - try { - ConfigModel result = apiInstance.updateConfig(configId, updateConfigRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ConfigsApi#updateConfig"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **configId** | **UUID**| The identifier of the Config. | | -| **updateConfigRequest** | [**UpdateConfigRequest**](UpdateConfigRequest.md)| | | - -### Return type - -[**ConfigModel**](ConfigModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - diff --git a/docs/ConnectRequest.md b/docs/ConnectRequest.md deleted file mode 100644 index 30c565a..0000000 --- a/docs/ConnectRequest.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# ConnectRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**clientKey** | **String** | | | -|**jiraJwtToken** | **String** | | | - - - diff --git a/docs/CreateConfigRequest.md b/docs/CreateConfigRequest.md deleted file mode 100644 index 475189d..0000000 --- a/docs/CreateConfigRequest.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# CreateConfigRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | The name of the Config. | | -|**description** | **String** | The description of the Config. | [optional] | -|**order** | **Integer** | The order of the Config represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | -|**evaluationVersion** | **EvaluationVersion** | | [optional] | - - - diff --git a/docs/CreateEnvironmentModel.md b/docs/CreateEnvironmentModel.md deleted file mode 100644 index 2cc0476..0000000 --- a/docs/CreateEnvironmentModel.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# CreateEnvironmentModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | The name of the Environment. | | -|**color** | **String** | The color of the Environment. RGB or HTML color codes are allowed. | [optional] | -|**description** | **String** | The description of the Environment. | [optional] | -|**order** | **Integer** | The order of the Environment represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | - - - diff --git a/docs/CreateIntegrationModel.md b/docs/CreateIntegrationModel.md deleted file mode 100644 index f2c2d78..0000000 --- a/docs/CreateIntegrationModel.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# CreateIntegrationModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**integrationType** | **IntegrationType** | | | -|**name** | **String** | Name of the Integration. | | -|**parameters** | **Map<String, String>** | Parameters of the Integration. | | -|**environmentIds** | **List<UUID>** | List of Environment IDs that are connected with this Integration. If the list is empty, all of the Environments are connected. | | -|**configIds** | **List<UUID>** | List of Config IDs that are connected with this Integration. If the list is empty, all of the Configs are connected. | | - - - diff --git a/docs/CreateOrUpdateEnvironmentAccessModel.md b/docs/CreateOrUpdateEnvironmentAccessModel.md deleted file mode 100644 index 1bd23a1..0000000 --- a/docs/CreateOrUpdateEnvironmentAccessModel.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# CreateOrUpdateEnvironmentAccessModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**environmentId** | **UUID** | Identifier of the Environment. | [optional] | -|**environmentAccessType** | **EnvironmentAccessType** | | [optional] | - - - diff --git a/docs/CreatePermissionGroupRequest.md b/docs/CreatePermissionGroupRequest.md deleted file mode 100644 index af04058..0000000 --- a/docs/CreatePermissionGroupRequest.md +++ /dev/null @@ -1,37 +0,0 @@ - - -# CreatePermissionGroupRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | Name of the Permission Group. | | -|**canManageMembers** | **Boolean** | Group members can manage team members. | [optional] | -|**canCreateOrUpdateConfig** | **Boolean** | Group members can create/update Configs. | [optional] | -|**canDeleteConfig** | **Boolean** | Group members can delete Configs. | [optional] | -|**canCreateOrUpdateEnvironment** | **Boolean** | Group members can create/update Environments. | [optional] | -|**canDeleteEnvironment** | **Boolean** | Group members can delete Environments. | [optional] | -|**canCreateOrUpdateSetting** | **Boolean** | Group members can create/update Feature Flags and Settings. | [optional] | -|**canTagSetting** | **Boolean** | Group members can attach/detach Tags to Feature Flags and Settings. | [optional] | -|**canDeleteSetting** | **Boolean** | Group members can delete Feature Flags and Settings. | [optional] | -|**canCreateOrUpdateTag** | **Boolean** | Group members can create/update Tags. | [optional] | -|**canDeleteTag** | **Boolean** | Group members can delete Tags. | [optional] | -|**canManageWebhook** | **Boolean** | Group members can create/update/delete Webhooks. | [optional] | -|**canUseExportImport** | **Boolean** | Group members can use the export/import feature. | [optional] | -|**canManageProductPreferences** | **Boolean** | Group members can update Product preferences. | [optional] | -|**canManageIntegrations** | **Boolean** | Group members can add and configure integrations. | [optional] | -|**canViewSdkKey** | **Boolean** | Group members has access to SDK keys. | [optional] | -|**canRotateSdkKey** | **Boolean** | Group members can rotate SDK keys. | [optional] | -|**canCreateOrUpdateSegments** | **Boolean** | Group members can create/update Segments. | [optional] | -|**canDeleteSegments** | **Boolean** | Group members can delete Segments. | [optional] | -|**canViewProductAuditLog** | **Boolean** | Group members has access to audit logs. | [optional] | -|**canViewProductStatistics** | **Boolean** | Group members has access to product statistics. | [optional] | -|**accessType** | **AccessType** | | [optional] | -|**newEnvironmentAccessType** | **EnvironmentAccessType** | | [optional] | -|**environmentAccesses** | [**List<CreateOrUpdateEnvironmentAccessModel>**](CreateOrUpdateEnvironmentAccessModel.md) | List of environment specific permissions. | [optional] | -|**canDisable2FA** | **Boolean** | Group members can disable two-factor authentication for other members. | [optional] | - - - diff --git a/docs/CreateProductRequest.md b/docs/CreateProductRequest.md deleted file mode 100644 index 41c750c..0000000 --- a/docs/CreateProductRequest.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# CreateProductRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | The name of the Product. | | -|**description** | **String** | The description of the Product. | [optional] | -|**order** | **Integer** | The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | - - - diff --git a/docs/CreateSegmentModel.md b/docs/CreateSegmentModel.md deleted file mode 100644 index a382243..0000000 --- a/docs/CreateSegmentModel.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# CreateSegmentModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | Name of the Segment. | | -|**description** | **String** | Description of the Segment. | [optional] | -|**comparisonAttribute** | **String** | The user's attribute the evaluation process must take into account. | | -|**comparator** | **RolloutRuleComparator** | | | -|**comparisonValue** | **String** | The value to compare with the given user attribute's value. | | - - - diff --git a/docs/CreateSettingInitialValues.md b/docs/CreateSettingInitialValues.md deleted file mode 100644 index 7de962e..0000000 --- a/docs/CreateSettingInitialValues.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# CreateSettingInitialValues - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**hint** | **String** | A short description for the setting, shown on the Dashboard UI. | [optional] | -|**tags** | **List<Long>** | The IDs of the tags which are attached to the setting. | [optional] | -|**order** | **Integer** | The order of the Setting represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | -|**key** | **String** | The key of the Feature Flag or Setting. | | -|**name** | **String** | The name of the Feature Flag or Setting. | | -|**settingType** | **SettingType** | | | -|**initialValues** | [**List<InitialValue>**](InitialValue.md) | Optional, initial value of the Feature Flag or Setting in the given Environments. | [optional] | - - - diff --git a/docs/CreateTagModel.md b/docs/CreateTagModel.md deleted file mode 100644 index dbe3d41..0000000 --- a/docs/CreateTagModel.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# CreateTagModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | Name of the Tag. | | -|**color** | **String** | Color of the Tag. Possible values: `panther`, `whale`, `salmon`, `lizard`, `canary`, `koala`, or any HTML color code. | [optional] | - - - diff --git a/docs/DeleteIntegrationLinkModel.md b/docs/DeleteIntegrationLinkModel.md deleted file mode 100644 index 2eea6d9..0000000 --- a/docs/DeleteIntegrationLinkModel.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# DeleteIntegrationLinkModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**hasRemainingIntegrationLink** | **Boolean** | | [optional] | - - - diff --git a/docs/DeleteRepositoryReportsRequest.md b/docs/DeleteRepositoryReportsRequest.md deleted file mode 100644 index c37de90..0000000 --- a/docs/DeleteRepositoryReportsRequest.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# DeleteRepositoryReportsRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**configId** | **UUID** | The Config's identifier from where the reports should be deleted. | | -|**repository** | **String** | The source control repository which's reports should be deleted. | | -|**branch** | **String** | If it's set, only this branch's reports belonging to the given repository will be deleted. | [optional] | -|**settingId** | **Integer** | If it's set, only this setting's reports belonging to the given repository will be deleted. | [optional] | - - - diff --git a/docs/EnvironmentAccessModel.md b/docs/EnvironmentAccessModel.md deleted file mode 100644 index e2f787c..0000000 --- a/docs/EnvironmentAccessModel.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# EnvironmentAccessModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**environmentId** | **UUID** | Identifier of the Environment. | [optional] | -|**name** | **String** | Name of the Environment. | [optional] | -|**color** | **String** | Color of the Environment. | [optional] | -|**description** | **String** | Description of the Environment. | [optional] | -|**order** | **Integer** | The order of the Environment represented on the ConfigCat Dashboard. | [optional] | -|**reasonRequired** | **Boolean** | Determines whether a mandatory reason must be given every time when the Feature Flags or Settings in the given Environment are saved. | [optional] | -|**environmentAccessType** | **EnvironmentAccessType** | | [optional] | - - - diff --git a/docs/EnvironmentAccessType.md b/docs/EnvironmentAccessType.md deleted file mode 100644 index 367506c..0000000 --- a/docs/EnvironmentAccessType.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# EnvironmentAccessType - -## Enum - - -* `FULL` (value: `"full"`) - -* `READ_ONLY` (value: `"readOnly"`) - -* `NONE` (value: `"none"`) - - - diff --git a/docs/EnvironmentModel.md b/docs/EnvironmentModel.md deleted file mode 100644 index adae610..0000000 --- a/docs/EnvironmentModel.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# EnvironmentModel - -Details of the Environment. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**product** | [**ProductModel**](ProductModel.md) | | [optional] | -|**environmentId** | **UUID** | Identifier of the Environment. | [optional] | -|**name** | **String** | Name of the Environment. | [optional] | -|**color** | **String** | The configured color of the Environment. | [optional] | -|**description** | **String** | Description of the Environment. | [optional] | -|**order** | **Integer** | The order of the Environment represented on the ConfigCat Dashboard. | [optional] | -|**reasonRequired** | **Boolean** | Determines whether a mandatory reason must be given every time when the Feature Flags or Settings in the given Environment are saved. | [optional] | - - - diff --git a/docs/EnvironmentsApi.md b/docs/EnvironmentsApi.md deleted file mode 100644 index caade43..0000000 --- a/docs/EnvironmentsApi.md +++ /dev/null @@ -1,373 +0,0 @@ -# EnvironmentsApi - -All URIs are relative to *https://api.configcat.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**createEnvironment**](EnvironmentsApi.md#createEnvironment) | **POST** /v1/products/{productId}/environments | Create Environment | -| [**deleteEnvironment**](EnvironmentsApi.md#deleteEnvironment) | **DELETE** /v1/environments/{environmentId} | Delete Environment | -| [**getEnvironment**](EnvironmentsApi.md#getEnvironment) | **GET** /v1/environments/{environmentId} | Get Environment | -| [**getEnvironments**](EnvironmentsApi.md#getEnvironments) | **GET** /v1/products/{productId}/environments | List Environments | -| [**updateEnvironment**](EnvironmentsApi.md#updateEnvironment) | **PUT** /v1/environments/{environmentId} | Update Environment | - - - -# **createEnvironment** -> EnvironmentModel createEnvironment(productId, createEnvironmentModel) - -Create Environment - -This endpoint creates a new Environment in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.EnvironmentsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - EnvironmentsApi apiInstance = new EnvironmentsApi(defaultClient); - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. - CreateEnvironmentModel createEnvironmentModel = new CreateEnvironmentModel(); // CreateEnvironmentModel | - try { - EnvironmentModel result = apiInstance.createEnvironment(productId, createEnvironmentModel); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling EnvironmentsApi#createEnvironment"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **UUID**| The identifier of the Product. | | -| **createEnvironmentModel** | [**CreateEnvironmentModel**](CreateEnvironmentModel.md)| | | - -### Return type - -[**EnvironmentModel**](EnvironmentModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **201** | When the creation was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **deleteEnvironment** -> deleteEnvironment(environmentId, cleanupAuditLogs) - -Delete Environment - -This endpoint removes an Environment identified by the `environmentId` parameter. If the `cleanupAuditLogs` flag is set to true, it also deletes the audit log records related to the environment (except for the `Created a new environment` and `Deleted an environment` records). - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.EnvironmentsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - EnvironmentsApi apiInstance = new EnvironmentsApi(defaultClient); - UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. - Boolean cleanupAuditLogs = true; // Boolean | An optional flag which indicates whether the audit log records related to the environment should be deleted or not. - try { - apiInstance.deleteEnvironment(environmentId, cleanupAuditLogs); - } catch (ApiException e) { - System.err.println("Exception when calling EnvironmentsApi#deleteEnvironment"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **environmentId** | **UUID**| The identifier of the Environment. | | -| **cleanupAuditLogs** | **Boolean**| An optional flag which indicates whether the audit log records related to the environment should be deleted or not. | [optional] | - -### Return type - -null (empty response body) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **204** | When the delete was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getEnvironment** -> EnvironmentModel getEnvironment(environmentId) - -Get Environment - -This endpoint returns the metadata of an Environment identified by the `environmentId`. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.EnvironmentsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - EnvironmentsApi apiInstance = new EnvironmentsApi(defaultClient); - UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. - try { - EnvironmentModel result = apiInstance.getEnvironment(environmentId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling EnvironmentsApi#getEnvironment"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **environmentId** | **UUID**| The identifier of the Environment. | | - -### Return type - -[**EnvironmentModel**](EnvironmentModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When everything is ok, the environment data returned. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getEnvironments** -> List<EnvironmentModel> getEnvironments(productId) - -List Environments - -This endpoint returns the list of the Environments that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.EnvironmentsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - EnvironmentsApi apiInstance = new EnvironmentsApi(defaultClient); - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. - try { - List result = apiInstance.getEnvironments(productId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling EnvironmentsApi#getEnvironments"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **UUID**| The identifier of the Product. | | - -### Return type - -[**List<EnvironmentModel>**](EnvironmentModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **updateEnvironment** -> EnvironmentModel updateEnvironment(environmentId, updateEnvironmentModel) - -Update Environment - -This endpoint updates an Environment identified by the `environmentId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.EnvironmentsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - EnvironmentsApi apiInstance = new EnvironmentsApi(defaultClient); - UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. - UpdateEnvironmentModel updateEnvironmentModel = new UpdateEnvironmentModel(); // UpdateEnvironmentModel | - try { - EnvironmentModel result = apiInstance.updateEnvironment(environmentId, updateEnvironmentModel); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling EnvironmentsApi#updateEnvironment"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **environmentId** | **UUID**| The identifier of the Environment. | | -| **updateEnvironmentModel** | [**UpdateEnvironmentModel**](UpdateEnvironmentModel.md)| | | - -### Return type - -[**EnvironmentModel**](EnvironmentModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - diff --git a/docs/EvaluationVersion.md b/docs/EvaluationVersion.md deleted file mode 100644 index dc44b6f..0000000 --- a/docs/EvaluationVersion.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# EvaluationVersion - -## Enum - - -* `V1` (value: `"v1"`) - -* `V2` (value: `"v2"`) - - - diff --git a/docs/FeatureFlagLimitations.md b/docs/FeatureFlagLimitations.md deleted file mode 100644 index 8ce451f..0000000 --- a/docs/FeatureFlagLimitations.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# FeatureFlagLimitations - -Subscription limitations regarding Feature flag or Setting values and targeting. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**maxPercentageOptionCount** | **Integer** | Maximum number of percentage options a Feature Flag or Setting can have within a targeting rule. | [optional] | -|**maxTargetingRuleCount** | **Integer** | Maximum number of targeting rules a Feature Flag or Setting can have. | [optional] | -|**maxComparisonValueLength** | **Integer** | Maximum length of a text comparison value. | [optional] | -|**maxComparisonValueListLength** | **Integer** | Maximum item count of a list comparison value. | [optional] | -|**maxComparisonValueListItemLength** | **Integer** | Maximum length of a list comparison value's item. | [optional] | -|**maxStringFlagValueLength** | **Integer** | Maximum length of a text Setting's value. | [optional] | -|**maxConditionPerTargetingRuleCount** | **Integer** | Maximum number of `AND` conditions a Feature Flag or Setting can have within a targeting rule. | [optional] | - - - diff --git a/docs/FeatureFlagSettingValuesApi.md b/docs/FeatureFlagSettingValuesApi.md deleted file mode 100644 index 4df7cb4..0000000 --- a/docs/FeatureFlagSettingValuesApi.md +++ /dev/null @@ -1,391 +0,0 @@ -# FeatureFlagSettingValuesApi - -All URIs are relative to *https://api.configcat.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**getSettingValue**](FeatureFlagSettingValuesApi.md#getSettingValue) | **GET** /v1/environments/{environmentId}/settings/{settingId}/value | Get value | -| [**getSettingValues**](FeatureFlagSettingValuesApi.md#getSettingValues) | **GET** /v1/configs/{configId}/environments/{environmentId}/values | Get values | -| [**postSettingValues**](FeatureFlagSettingValuesApi.md#postSettingValues) | **POST** /v1/configs/{configId}/environments/{environmentId}/values | Post values | -| [**replaceSettingValue**](FeatureFlagSettingValuesApi.md#replaceSettingValue) | **PUT** /v1/environments/{environmentId}/settings/{settingId}/value | Replace value | -| [**updateSettingValue**](FeatureFlagSettingValuesApi.md#updateSettingValue) | **PATCH** /v1/environments/{environmentId}/settings/{settingId}/value | Update value | - - - -# **getSettingValue** -> SettingValueModel getSettingValue(environmentId, settingId) - -Get value - -This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the `environmentId` parameter. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview). - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - FeatureFlagSettingValuesApi apiInstance = new FeatureFlagSettingValuesApi(defaultClient); - UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. - Integer settingId = 56; // Integer | The id of the Setting. - try { - SettingValueModel result = apiInstance.getSettingValue(environmentId, settingId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FeatureFlagSettingValuesApi#getSettingValue"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **environmentId** | **UUID**| The identifier of the Environment. | | -| **settingId** | **Integer**| The id of the Setting. | | - -### Return type - -[**SettingValueModel**](SettingValueModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When everything is ok, the setting value data returned. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getSettingValues** -> ConfigSettingValuesModel getSettingValues(configId, environmentId) - -Get values - -This endpoint returns the value of a specified Config's Feature Flags or Settings identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - FeatureFlagSettingValuesApi apiInstance = new FeatureFlagSettingValuesApi(defaultClient); - UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. - UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. - try { - ConfigSettingValuesModel result = apiInstance.getSettingValues(configId, environmentId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FeatureFlagSettingValuesApi#getSettingValues"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **configId** | **UUID**| The identifier of the Config. | | -| **environmentId** | **UUID**| The identifier of the Environment. | | - -### Return type - -[**ConfigSettingValuesModel**](ConfigSettingValuesModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When everything is ok, the setting values returned. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **postSettingValues** -> ConfigSettingValuesModel postSettingValues(configId, environmentId, updateSettingValuesWithIdModel, reason) - -Post values - -This endpoint replaces the values of a specified Config's Feature Flags or Settings identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"settingValues\": [ { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false, \"settingId\": 1 } ] } ``` If we send a replace request body as below: ```json { \"settingValues\": [ { \"value\": true, \"settingId\": 1 } ] } ``` Then besides that the default value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"settingValues\": [ { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true, \"setting\": { \"settingId\": 1 } } ] } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - FeatureFlagSettingValuesApi apiInstance = new FeatureFlagSettingValuesApi(defaultClient); - UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. - UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. - UpdateSettingValuesWithIdModel updateSettingValuesWithIdModel = new UpdateSettingValuesWithIdModel(); // UpdateSettingValuesWithIdModel | - String reason = "reason_example"; // String | The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. - try { - ConfigSettingValuesModel result = apiInstance.postSettingValues(configId, environmentId, updateSettingValuesWithIdModel, reason); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FeatureFlagSettingValuesApi#postSettingValues"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **configId** | **UUID**| The identifier of the Config. | | -| **environmentId** | **UUID**| The identifier of the Environment. | | -| **updateSettingValuesWithIdModel** | [**UpdateSettingValuesWithIdModel**](UpdateSettingValuesWithIdModel.md)| | | -| **reason** | **String**| The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. | [optional] | - -### Return type - -[**ConfigSettingValuesModel**](ConfigSettingValuesModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When everything is ok, the updated setting values returned. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **replaceSettingValue** -> SettingValueModel replaceSettingValue(environmentId, settingId, updateSettingValueModel, reason) - -Replace value - -This endpoint replaces the whole value of a Feature Flag or Setting in a specified Environment. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send a replace request body as below: ```json { \"value\": true } ``` Then besides that the default value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - FeatureFlagSettingValuesApi apiInstance = new FeatureFlagSettingValuesApi(defaultClient); - UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. - Integer settingId = 56; // Integer | The id of the Setting. - UpdateSettingValueModel updateSettingValueModel = new UpdateSettingValueModel(); // UpdateSettingValueModel | - String reason = "reason_example"; // String | The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. - try { - SettingValueModel result = apiInstance.replaceSettingValue(environmentId, settingId, updateSettingValueModel, reason); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FeatureFlagSettingValuesApi#replaceSettingValue"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **environmentId** | **UUID**| The identifier of the Environment. | | -| **settingId** | **Integer**| The id of the Setting. | | -| **updateSettingValueModel** | [**UpdateSettingValueModel**](UpdateSettingValueModel.md)| | | -| **reason** | **String**| The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. | [optional] | - -### Return type - -[**SettingValueModel**](SettingValueModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **updateSettingValue** -> SettingValueModel updateSettingValue(environmentId, settingId, jsonPatchOperation, reason) - -Update value - -This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/value\", \"value\": true } ] ``` Only the default value is going to be set to `true` and all the Percentage Rules are remaining unchanged. So we get a response like this: ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": true } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - FeatureFlagSettingValuesApi apiInstance = new FeatureFlagSettingValuesApi(defaultClient); - UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. - Integer settingId = 56; // Integer | The id of the Setting. - List jsonPatchOperation = Arrays.asList(); // List | - String reason = "reason_example"; // String | The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. - try { - SettingValueModel result = apiInstance.updateSettingValue(environmentId, settingId, jsonPatchOperation, reason); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FeatureFlagSettingValuesApi#updateSettingValue"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **environmentId** | **UUID**| The identifier of the Environment. | | -| **settingId** | **Integer**| The id of the Setting. | | -| **jsonPatchOperation** | [**List<JsonPatchOperation>**](JsonPatchOperation.md)| | | -| **reason** | **String**| The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. | [optional] | - -### Return type - -[**SettingValueModel**](SettingValueModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When the patch was successful. | - | -| **204** | When no change applied on the resource. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - diff --git a/docs/FeatureFlagSettingValuesUsingSdkKeyApi.md b/docs/FeatureFlagSettingValuesUsingSdkKeyApi.md deleted file mode 100644 index 669056c..0000000 --- a/docs/FeatureFlagSettingValuesUsingSdkKeyApi.md +++ /dev/null @@ -1,239 +0,0 @@ -# FeatureFlagSettingValuesUsingSdkKeyApi - -All URIs are relative to *https://api.configcat.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**getSettingValueBySdkkey**](FeatureFlagSettingValuesUsingSdkKeyApi.md#getSettingValueBySdkkey) | **GET** /v1/settings/{settingKeyOrId}/value | Get value | -| [**replaceSettingValueBySdkkey**](FeatureFlagSettingValuesUsingSdkKeyApi.md#replaceSettingValueBySdkkey) | **PUT** /v1/settings/{settingKeyOrId}/value | Replace value | -| [**updateSettingValueBySdkkey**](FeatureFlagSettingValuesUsingSdkKeyApi.md#updateSettingValueBySdkkey) | **PATCH** /v1/settings/{settingKeyOrId}/value | Update value | - - - -# **getSettingValueBySdkkey** -> SettingValueModel getSettingValueBySdkkey(settingKeyOrId, X_CONFIGCAT_SDKKEY) - -Get value - -This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesUsingSdkKeyApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - FeatureFlagSettingValuesUsingSdkKeyApi apiInstance = new FeatureFlagSettingValuesUsingSdkKeyApi(defaultClient); - String settingKeyOrId = "settingKeyOrId_example"; // String | The key or id of the Setting. - String X_CONFIGCAT_SDKKEY = "X_CONFIGCAT_SDKKEY_example"; // String | The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) - try { - SettingValueModel result = apiInstance.getSettingValueBySdkkey(settingKeyOrId, X_CONFIGCAT_SDKKEY); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FeatureFlagSettingValuesUsingSdkKeyApi#getSettingValueBySdkkey"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **settingKeyOrId** | **String**| The key or id of the Setting. | | -| **X_CONFIGCAT_SDKKEY** | **String**| The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) | [optional] | - -### Return type - -[**SettingValueModel**](SettingValueModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **replaceSettingValueBySdkkey** -> SettingValueModel replaceSettingValueBySdkkey(settingKeyOrId, updateSettingValueModel, reason, X_CONFIGCAT_SDKKEY) - -Replace value - -This endpoint replaces the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send a replace request body as below: ```json { \"value\": true } ``` Then besides that the default served value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true } ``` - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesUsingSdkKeyApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - FeatureFlagSettingValuesUsingSdkKeyApi apiInstance = new FeatureFlagSettingValuesUsingSdkKeyApi(defaultClient); - String settingKeyOrId = "settingKeyOrId_example"; // String | The key or id of the Setting. - UpdateSettingValueModel updateSettingValueModel = new UpdateSettingValueModel(); // UpdateSettingValueModel | - String reason = "reason_example"; // String | The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. - String X_CONFIGCAT_SDKKEY = "X_CONFIGCAT_SDKKEY_example"; // String | The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) - try { - SettingValueModel result = apiInstance.replaceSettingValueBySdkkey(settingKeyOrId, updateSettingValueModel, reason, X_CONFIGCAT_SDKKEY); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FeatureFlagSettingValuesUsingSdkKeyApi#replaceSettingValueBySdkkey"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **settingKeyOrId** | **String**| The key or id of the Setting. | | -| **updateSettingValueModel** | [**UpdateSettingValueModel**](UpdateSettingValueModel.md)| | | -| **reason** | **String**| The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. | [optional] | -| **X_CONFIGCAT_SDKKEY** | **String**| The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) | [optional] | - -### Return type - -[**SettingValueModel**](SettingValueModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **updateSettingValueBySdkkey** -> SettingValueModel updateSettingValueBySdkkey(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY) - -Update value - -This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/value\", \"value\": true } ] ``` Only the default served value is going to be set to `true` and all the Percentage Rules are remaining unchanged. So we get a response like this: ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": true } ``` - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesUsingSdkKeyApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - FeatureFlagSettingValuesUsingSdkKeyApi apiInstance = new FeatureFlagSettingValuesUsingSdkKeyApi(defaultClient); - String settingKeyOrId = "settingKeyOrId_example"; // String | The key or id of the Setting. - List jsonPatchOperation = Arrays.asList(); // List | - String reason = "reason_example"; // String | The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. - String X_CONFIGCAT_SDKKEY = "X_CONFIGCAT_SDKKEY_example"; // String | The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) - try { - SettingValueModel result = apiInstance.updateSettingValueBySdkkey(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FeatureFlagSettingValuesUsingSdkKeyApi#updateSettingValueBySdkkey"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **settingKeyOrId** | **String**| The key or id of the Setting. | | -| **jsonPatchOperation** | [**List<JsonPatchOperation>**](JsonPatchOperation.md)| | | -| **reason** | **String**| The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. | [optional] | -| **X_CONFIGCAT_SDKKEY** | **String**| The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) | [optional] | - -### Return type - -[**SettingValueModel**](SettingValueModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **204** | When no change applied on the resource. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - diff --git a/docs/FeatureFlagSettingValuesUsingSdkKeyV2Api.md b/docs/FeatureFlagSettingValuesUsingSdkKeyV2Api.md deleted file mode 100644 index b81bc51..0000000 --- a/docs/FeatureFlagSettingValuesUsingSdkKeyV2Api.md +++ /dev/null @@ -1,239 +0,0 @@ -# FeatureFlagSettingValuesUsingSdkKeyV2Api - -All URIs are relative to *https://api.configcat.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**getSettingValueBySdkkeyV2**](FeatureFlagSettingValuesUsingSdkKeyV2Api.md#getSettingValueBySdkkeyV2) | **GET** /v2/settings/{settingKeyOrId}/value | Get value | -| [**replaceSettingValueBySdkkeyV2**](FeatureFlagSettingValuesUsingSdkKeyV2Api.md#replaceSettingValueBySdkkeyV2) | **PUT** /v2/settings/{settingKeyOrId}/value | Replace value | -| [**updateSettingValueBySdkkeyV2**](FeatureFlagSettingValuesUsingSdkKeyV2Api.md#updateSettingValueBySdkkeyV2) | **PATCH** /v2/settings/{settingKeyOrId}/value | Update value | - - - -# **getSettingValueBySdkkeyV2** -> SettingFormulaModel getSettingValueBySdkkeyV2(settingKeyOrId, X_CONFIGCAT_SDKKEY) - -Get value - -This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. The most important fields in the response are the `defaultValue`, `targetingRules`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used at the [percentage evaluation](https://configcat.com/docs/advanced/targeting/#anatomy-of-the-percentage-based-targeting) of the Feature Flag or Setting. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesUsingSdkKeyV2Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - FeatureFlagSettingValuesUsingSdkKeyV2Api apiInstance = new FeatureFlagSettingValuesUsingSdkKeyV2Api(defaultClient); - String settingKeyOrId = "settingKeyOrId_example"; // String | The key or id of the Setting. - String X_CONFIGCAT_SDKKEY = "X_CONFIGCAT_SDKKEY_example"; // String | The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) - try { - SettingFormulaModel result = apiInstance.getSettingValueBySdkkeyV2(settingKeyOrId, X_CONFIGCAT_SDKKEY); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FeatureFlagSettingValuesUsingSdkKeyV2Api#getSettingValueBySdkkeyV2"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **settingKeyOrId** | **String**| The key or id of the Setting. | | -| **X_CONFIGCAT_SDKKEY** | **String**| The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) | [optional] | - -### Return type - -[**SettingFormulaModel**](SettingFormulaModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **replaceSettingValueBySdkkeyV2** -> SettingFormulaModel replaceSettingValueBySdkkeyV2(settingKeyOrId, updateEvaluationFormulaModel, reason, X_CONFIGCAT_SDKKEY) - -Replace value - -This endpoint replaces the value and the Targeting Rules of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other field that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send a replace request body as below: ```json { \"defaultValue\": { \"boolValue\": true } } ``` Then besides that the default served value is set to `true`, all the Targeting Rules are deleted. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": true }, \"targetingRules\": [] } ``` - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesUsingSdkKeyV2Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - FeatureFlagSettingValuesUsingSdkKeyV2Api apiInstance = new FeatureFlagSettingValuesUsingSdkKeyV2Api(defaultClient); - String settingKeyOrId = "settingKeyOrId_example"; // String | The key or id of the Setting. - UpdateEvaluationFormulaModel updateEvaluationFormulaModel = new UpdateEvaluationFormulaModel(); // UpdateEvaluationFormulaModel | - String reason = "reason_example"; // String | The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. - String X_CONFIGCAT_SDKKEY = "X_CONFIGCAT_SDKKEY_example"; // String | The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) - try { - SettingFormulaModel result = apiInstance.replaceSettingValueBySdkkeyV2(settingKeyOrId, updateEvaluationFormulaModel, reason, X_CONFIGCAT_SDKKEY); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FeatureFlagSettingValuesUsingSdkKeyV2Api#replaceSettingValueBySdkkeyV2"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **settingKeyOrId** | **String**| The key or id of the Setting. | | -| **updateEvaluationFormulaModel** | [**UpdateEvaluationFormulaModel**](UpdateEvaluationFormulaModel.md)| | | -| **reason** | **String**| The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. | [optional] | -| **X_CONFIGCAT_SDKKEY** | **String**| The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) | [optional] | - -### Return type - -[**SettingFormulaModel**](SettingFormulaModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **updateSettingValueBySdkkeyV2** -> SettingFormulaModel updateSettingValueBySdkkeyV2(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY) - -Update value - -This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/targetingRules/0/value/boolValue\", \"value\": true } ] ``` Only the first Targeting Rule's `value` is going to be set to `false` and all the other fields are remaining unchanged. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": false } } ] } ``` - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesUsingSdkKeyV2Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - FeatureFlagSettingValuesUsingSdkKeyV2Api apiInstance = new FeatureFlagSettingValuesUsingSdkKeyV2Api(defaultClient); - String settingKeyOrId = "settingKeyOrId_example"; // String | The key or id of the Setting. - List jsonPatchOperation = Arrays.asList(); // List | - String reason = "reason_example"; // String | The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. - String X_CONFIGCAT_SDKKEY = "X_CONFIGCAT_SDKKEY_example"; // String | The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) - try { - SettingFormulaModel result = apiInstance.updateSettingValueBySdkkeyV2(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FeatureFlagSettingValuesUsingSdkKeyV2Api#updateSettingValueBySdkkeyV2"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **settingKeyOrId** | **String**| The key or id of the Setting. | | -| **jsonPatchOperation** | [**List<JsonPatchOperation>**](JsonPatchOperation.md)| | | -| **reason** | **String**| The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. | [optional] | -| **X_CONFIGCAT_SDKKEY** | **String**| The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) | [optional] | - -### Return type - -[**SettingFormulaModel**](SettingFormulaModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **204** | When no change applied on the resource. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - diff --git a/docs/FeatureFlagSettingValuesV2Api.md b/docs/FeatureFlagSettingValuesV2Api.md deleted file mode 100644 index c26e24e..0000000 --- a/docs/FeatureFlagSettingValuesV2Api.md +++ /dev/null @@ -1,391 +0,0 @@ -# FeatureFlagSettingValuesV2Api - -All URIs are relative to *https://api.configcat.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**getSettingValueV2**](FeatureFlagSettingValuesV2Api.md#getSettingValueV2) | **GET** /v2/environments/{environmentId}/settings/{settingId}/value | Get value | -| [**getSettingValuesV2**](FeatureFlagSettingValuesV2Api.md#getSettingValuesV2) | **GET** /v2/configs/{configId}/environments/{environmentId}/values | Get values | -| [**postSettingValuesV2**](FeatureFlagSettingValuesV2Api.md#postSettingValuesV2) | **POST** /v2/configs/{configId}/environments/{environmentId}/values | Post values | -| [**replaceSettingValueV2**](FeatureFlagSettingValuesV2Api.md#replaceSettingValueV2) | **PUT** /v2/environments/{environmentId}/settings/{settingId}/value | Replace value | -| [**updateSettingValueV2**](FeatureFlagSettingValuesV2Api.md#updateSettingValueV2) | **PATCH** /v2/environments/{environmentId}/settings/{settingId}/value | Update value | - - - -# **getSettingValueV2** -> SettingFormulaModel getSettingValueV2(environmentId, settingId) - -Get value - -This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the `environmentId` parameter. The most important fields in the response are the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used for [percentage evaluation](https://configcat.com/docs/targeting/percentage-options/) of the Feature Flag or Setting. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesV2Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - FeatureFlagSettingValuesV2Api apiInstance = new FeatureFlagSettingValuesV2Api(defaultClient); - UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. - Integer settingId = 56; // Integer | The id of the Setting. - try { - SettingFormulaModel result = apiInstance.getSettingValueV2(environmentId, settingId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FeatureFlagSettingValuesV2Api#getSettingValueV2"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **environmentId** | **UUID**| The identifier of the Environment. | | -| **settingId** | **Integer**| The id of the Setting. | | - -### Return type - -[**SettingFormulaModel**](SettingFormulaModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When everything is ok, the setting value data returned. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getSettingValuesV2** -> ConfigSettingFormulasModel getSettingValuesV2(configId, environmentId) - -Get values - -This endpoint returns all Feature Flag and Setting values of a Config identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. The most important fields in the response are the `defaultValue`, `targetingRules`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used for [percentage evaluation](https://configcat.com/docs/targeting/percentage-options/) of the Feature Flag or Setting. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesV2Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - FeatureFlagSettingValuesV2Api apiInstance = new FeatureFlagSettingValuesV2Api(defaultClient); - UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. - UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. - try { - ConfigSettingFormulasModel result = apiInstance.getSettingValuesV2(configId, environmentId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FeatureFlagSettingValuesV2Api#getSettingValuesV2"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **configId** | **UUID**| The identifier of the Config. | | -| **environmentId** | **UUID**| The identifier of the Environment. | | - -### Return type - -[**ConfigSettingFormulasModel**](ConfigSettingFormulasModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When everything is ok, the setting values returned. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **postSettingValuesV2** -> ConfigSettingFormulasModel postSettingValuesV2(configId, environmentId, updateEvaluationFormulasModel, reason) - -Post values - -This endpoint batch updates the Feature Flags and Settings of a Config identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. Only those Feature Flags and Settings are updated which are part of the request, all the others are left untouched. **Important:** As this endpoint is doing a complete replace on those Feature Flags and Settings, which are set in the request. It's important to set every other field that you don't want to change in its original state. Not listing a field means that it will reset. For example: We have the following resource of a Feature Flag. ```json { \"settingFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ], \"settingId\": 1 } ] } ``` If we send a batch replace request body as below: ```json { \"updateFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"settingId\": 1 } ] } ``` Then besides that the default value is set to `true`, all Targeting Rules of the related Feature Flag are deleted. So we get a response like this: ```json { \"settingFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [], \"setting\": { \"settingId\": 1 } } ] } ``` - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesV2Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - FeatureFlagSettingValuesV2Api apiInstance = new FeatureFlagSettingValuesV2Api(defaultClient); - UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. - UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. - UpdateEvaluationFormulasModel updateEvaluationFormulasModel = new UpdateEvaluationFormulasModel(); // UpdateEvaluationFormulasModel | - String reason = "reason_example"; // String | The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. - try { - ConfigSettingFormulasModel result = apiInstance.postSettingValuesV2(configId, environmentId, updateEvaluationFormulasModel, reason); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FeatureFlagSettingValuesV2Api#postSettingValuesV2"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **configId** | **UUID**| The identifier of the Config. | | -| **environmentId** | **UUID**| The identifier of the Environment. | | -| **updateEvaluationFormulasModel** | [**UpdateEvaluationFormulasModel**](UpdateEvaluationFormulasModel.md)| | | -| **reason** | **String**| The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. | [optional] | - -### Return type - -[**ConfigSettingFormulasModel**](ConfigSettingFormulasModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When everything is ok, the updated setting values returned. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **replaceSettingValueV2** -> SettingFormulaModel replaceSettingValueV2(environmentId, settingId, updateEvaluationFormulaModel, reason) - -Replace value - -This endpoint replaces the value and the Targeting Rules of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other field that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send a replace request body as below: ```json { \"defaultValue\": { \"boolValue\": true } } ``` Then besides that the default served value is set to `true`, all the Targeting Rules are deleted. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": true }, \"targetingRules\": [] } ``` - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesV2Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - FeatureFlagSettingValuesV2Api apiInstance = new FeatureFlagSettingValuesV2Api(defaultClient); - UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. - Integer settingId = 56; // Integer | The id of the Setting. - UpdateEvaluationFormulaModel updateEvaluationFormulaModel = new UpdateEvaluationFormulaModel(); // UpdateEvaluationFormulaModel | - String reason = "reason_example"; // String | The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. - try { - SettingFormulaModel result = apiInstance.replaceSettingValueV2(environmentId, settingId, updateEvaluationFormulaModel, reason); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FeatureFlagSettingValuesV2Api#replaceSettingValueV2"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **environmentId** | **UUID**| The identifier of the Environment. | | -| **settingId** | **Integer**| The id of the Setting. | | -| **updateEvaluationFormulaModel** | [**UpdateEvaluationFormulaModel**](UpdateEvaluationFormulaModel.md)| | | -| **reason** | **String**| The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. | [optional] | - -### Return type - -[**SettingFormulaModel**](SettingFormulaModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **updateSettingValueV2** -> SettingFormulaModel updateSettingValueV2(environmentId, settingId, jsonPatchOperation, reason) - -Update value - -This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/targetingRules/0/value/boolValue\", \"value\": true } ] ``` Only the first Targeting Rule's `value` is going to be set to `false` and all the other fields are remaining unchanged. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": false } } ] } ``` - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesV2Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - FeatureFlagSettingValuesV2Api apiInstance = new FeatureFlagSettingValuesV2Api(defaultClient); - UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. - Integer settingId = 56; // Integer | The id of the Setting. - List jsonPatchOperation = Arrays.asList(); // List | - String reason = "reason_example"; // String | The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. - try { - SettingFormulaModel result = apiInstance.updateSettingValueV2(environmentId, settingId, jsonPatchOperation, reason); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FeatureFlagSettingValuesV2Api#updateSettingValueV2"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **environmentId** | **UUID**| The identifier of the Environment. | | -| **settingId** | **Integer**| The id of the Setting. | | -| **jsonPatchOperation** | [**List<JsonPatchOperation>**](JsonPatchOperation.md)| | | -| **reason** | **String**| The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. | [optional] | - -### Return type - -[**SettingFormulaModel**](SettingFormulaModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When the patch was successful. | - | -| **204** | When no change applied on the resource. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - diff --git a/docs/FeatureFlagsSettingsApi.md b/docs/FeatureFlagsSettingsApi.md deleted file mode 100644 index ae72c05..0000000 --- a/docs/FeatureFlagsSettingsApi.md +++ /dev/null @@ -1,445 +0,0 @@ -# FeatureFlagsSettingsApi - -All URIs are relative to *https://api.configcat.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**createSetting**](FeatureFlagsSettingsApi.md#createSetting) | **POST** /v1/configs/{configId}/settings | Create Flag | -| [**deleteSetting**](FeatureFlagsSettingsApi.md#deleteSetting) | **DELETE** /v1/settings/{settingId} | Delete Flag | -| [**getSetting**](FeatureFlagsSettingsApi.md#getSetting) | **GET** /v1/settings/{settingId} | Get Flag | -| [**getSettings**](FeatureFlagsSettingsApi.md#getSettings) | **GET** /v1/configs/{configId}/settings | List Flags | -| [**replaceSetting**](FeatureFlagsSettingsApi.md#replaceSetting) | **PUT** /v1/settings/{settingId} | Replace Flag | -| [**updateSetting**](FeatureFlagsSettingsApi.md#updateSetting) | **PATCH** /v1/settings/{settingId} | Update Flag | - - - -# **createSetting** -> SettingModel createSetting(configId, createSettingInitialValues) - -Create Flag - -This endpoint creates a new Feature Flag or Setting in a specified Config identified by the `configId` parameter. **Important:** The `key` attribute must be unique within the given Config. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.FeatureFlagsSettingsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - FeatureFlagsSettingsApi apiInstance = new FeatureFlagsSettingsApi(defaultClient); - UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. - CreateSettingInitialValues createSettingInitialValues = new CreateSettingInitialValues(); // CreateSettingInitialValues | - try { - SettingModel result = apiInstance.createSetting(configId, createSettingInitialValues); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FeatureFlagsSettingsApi#createSetting"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **configId** | **UUID**| The identifier of the Config. | | -| **createSettingInitialValues** | [**CreateSettingInitialValues**](CreateSettingInitialValues.md)| | | - -### Return type - -[**SettingModel**](SettingModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **201** | When the creation was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **deleteSetting** -> deleteSetting(settingId) - -Delete Flag - -This endpoint removes a Feature Flag or Setting from a specified Config, identified by the `configId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.FeatureFlagsSettingsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - FeatureFlagsSettingsApi apiInstance = new FeatureFlagsSettingsApi(defaultClient); - Integer settingId = 56; // Integer | The identifier of the Setting. - try { - apiInstance.deleteSetting(settingId); - } catch (ApiException e) { - System.err.println("Exception when calling FeatureFlagsSettingsApi#deleteSetting"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **settingId** | **Integer**| The identifier of the Setting. | | - -### Return type - -null (empty response body) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **204** | When the delete was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getSetting** -> SettingModel getSetting(settingId) - -Get Flag - -This endpoint returns the metadata attributes of a Feature Flag or Setting identified by the `settingId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.FeatureFlagsSettingsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - FeatureFlagsSettingsApi apiInstance = new FeatureFlagsSettingsApi(defaultClient); - Integer settingId = 56; // Integer | The identifier of the Setting. - try { - SettingModel result = apiInstance.getSetting(settingId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FeatureFlagsSettingsApi#getSetting"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **settingId** | **Integer**| The identifier of the Setting. | | - -### Return type - -[**SettingModel**](SettingModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When everything is ok, the setting data returned. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getSettings** -> List<SettingModel> getSettings(configId) - -List Flags - -This endpoint returns the list of the Feature Flags and Settings defined in a specified Config, identified by the `configId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.FeatureFlagsSettingsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - FeatureFlagsSettingsApi apiInstance = new FeatureFlagsSettingsApi(defaultClient); - UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. - try { - List result = apiInstance.getSettings(configId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FeatureFlagsSettingsApi#getSettings"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **configId** | **UUID**| The identifier of the Config. | | - -### Return type - -[**List<SettingModel>**](SettingModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **replaceSetting** -> SettingModel replaceSetting(settingId, replaceSettingModel) - -Replace Flag - -This endpoint replaces the whole value of a Feature Flag or Setting identified by the `settingId` parameter. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.FeatureFlagsSettingsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - FeatureFlagsSettingsApi apiInstance = new FeatureFlagsSettingsApi(defaultClient); - Integer settingId = 56; // Integer | The identifier of the Setting. - ReplaceSettingModel replaceSettingModel = new ReplaceSettingModel(); // ReplaceSettingModel | - try { - SettingModel result = apiInstance.replaceSetting(settingId, replaceSettingModel); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FeatureFlagsSettingsApi#replaceSetting"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **settingId** | **Integer**| The identifier of the Setting. | | -| **replaceSettingModel** | [**ReplaceSettingModel**](ReplaceSettingModel.md)| | | - -### Return type - -[**SettingModel**](SettingModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When the replace was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **updateSetting** -> SettingModel updateSetting(settingId, jsonPatchOperation) - -Update Flag - -This endpoint updates the metadata of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Config. Only the `name`, `hint` and `tags` attributes are modifiable by this endpoint. The `tags` attribute is a simple collection of the [tag IDs](#operation/get-tags) attached to the given setting. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. For example: We have the following resource. ```json { \"settingId\": 5345, \"key\": \"myGrandFeature\", \"name\": \"Tihs is a naem with soem typos.\", \"hint\": \"This flag controls my grandioso feature.\", \"settingType\": \"boolean\", \"tags\": [ { \"tagId\": 0, \"name\": \"sample tag\", \"color\": \"whale\" } ] } ``` If we send an update request body as below (it changes the `name` and adds the already existing tag with the id `2`): ```json [ { \"op\": \"replace\", \"path\": \"/name\", \"value\": \"This is the name without typos.\" }, { \"op\": \"add\", \"path\": \"/tags/-\", \"value\": 2 } ] ``` Only the `name` and `tags` are updated and all the other attributes remain unchanged. So we get a response like this: ```json { \"settingId\": 5345, \"key\": \"myGrandFeature\", \"name\": \"This is the name without typos.\", \"hint\": \"This flag controls my grandioso feature.\", \"settingType\": \"boolean\", \"tags\": [ { \"tagId\": 0, \"name\": \"sample tag\", \"color\": \"whale\" }, { \"tagId\": 2, \"name\": \"another tag\", \"color\": \"koala\" } ] } ``` - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.FeatureFlagsSettingsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - FeatureFlagsSettingsApi apiInstance = new FeatureFlagsSettingsApi(defaultClient); - Integer settingId = 56; // Integer | The identifier of the Setting. - List jsonPatchOperation = Arrays.asList(); // List | - try { - SettingModel result = apiInstance.updateSetting(settingId, jsonPatchOperation); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FeatureFlagsSettingsApi#updateSetting"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **settingId** | **Integer**| The identifier of the Setting. | | -| **jsonPatchOperation** | [**List<JsonPatchOperation>**](JsonPatchOperation.md)| | | - -### Return type - -[**SettingModel**](SettingModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When the update was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - diff --git a/docs/FlagReference.md b/docs/FlagReference.md deleted file mode 100644 index 8a2c6be..0000000 --- a/docs/FlagReference.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# FlagReference - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**settingId** | **Integer** | The identifier of the Feature Flag or Setting the code reference belongs to. | | -|**references** | [**List<ReferenceLines>**](ReferenceLines.md) | The actual references to the given Feature Flag or Setting. | | - - - diff --git a/docs/InitialValue.md b/docs/InitialValue.md deleted file mode 100644 index 042536b..0000000 --- a/docs/InitialValue.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# InitialValue - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**environmentId** | **UUID** | The ID of the Environment where the initial value must be set. | [optional] | -|**value** | **Object** | The initial value in the given Environment. It must respect the setting type. | [optional] | - - - diff --git a/docs/IntegrationLinkDetail.md b/docs/IntegrationLinkDetail.md deleted file mode 100644 index 9a3637e..0000000 --- a/docs/IntegrationLinkDetail.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# IntegrationLinkDetail - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**product** | [**ProductModel**](ProductModel.md) | | [optional] | -|**config** | [**ConfigModel**](ConfigModel.md) | | [optional] | -|**environment** | [**EnvironmentModel**](EnvironmentModel.md) | | [optional] | -|**setting** | [**SettingDataModel**](SettingDataModel.md) | | [optional] | -|**readOnly** | **Boolean** | | [optional] | -|**status** | **String** | | [optional] | - - - diff --git a/docs/IntegrationLinkDetailsModel.md b/docs/IntegrationLinkDetailsModel.md deleted file mode 100644 index 1fa8991..0000000 --- a/docs/IntegrationLinkDetailsModel.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# IntegrationLinkDetailsModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**details** | [**List<IntegrationLinkDetail>**](IntegrationLinkDetail.md) | | [optional] [readonly] | -|**allIntegrationLinkCount** | **Integer** | | [optional] | - - - diff --git a/docs/IntegrationLinkModel.md b/docs/IntegrationLinkModel.md deleted file mode 100644 index d81537c..0000000 --- a/docs/IntegrationLinkModel.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# IntegrationLinkModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**key** | **String** | | [optional] | -|**description** | **String** | | [optional] | -|**integrationLinkType** | **IntegrationLinkType** | | [optional] | -|**url** | **String** | | [optional] | - - - diff --git a/docs/IntegrationLinkType.md b/docs/IntegrationLinkType.md deleted file mode 100644 index 20d1589..0000000 --- a/docs/IntegrationLinkType.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# IntegrationLinkType - -## Enum - - -* `TRELLO` (value: `"trello"`) - -* `JIRA` (value: `"jira"`) - -* `MONDAY` (value: `"monday"`) - - - diff --git a/docs/IntegrationLinksApi.md b/docs/IntegrationLinksApi.md deleted file mode 100644 index 1e44563..0000000 --- a/docs/IntegrationLinksApi.md +++ /dev/null @@ -1,383 +0,0 @@ -# IntegrationLinksApi - -All URIs are relative to *https://api.configcat.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**addOrUpdateIntegrationLink**](IntegrationLinksApi.md#addOrUpdateIntegrationLink) | **POST** /v1/environments/{environmentId}/settings/{settingId}/integrationLinks/{integrationLinkType}/{key} | Add or update Integration link | -| [**deleteIntegrationLink**](IntegrationLinksApi.md#deleteIntegrationLink) | **DELETE** /v1/environments/{environmentId}/settings/{settingId}/integrationLinks/{integrationLinkType}/{key} | Delete Integration link | -| [**getIntegrationLinkDetails**](IntegrationLinksApi.md#getIntegrationLinkDetails) | **GET** /v1/integrationLink/{integrationLinkType}/{key}/details | Get Integration link | -| [**jiraAddOrUpdateIntegrationLink**](IntegrationLinksApi.md#jiraAddOrUpdateIntegrationLink) | **POST** /v1/jira/environments/{environmentId}/settings/{settingId}/integrationLinks/{key} | | -| [**jiraConnect**](IntegrationLinksApi.md#jiraConnect) | **POST** /v1/jira/connect | | - - - -# **addOrUpdateIntegrationLink** -> IntegrationLinkModel addOrUpdateIntegrationLink(environmentId, settingId, integrationLinkType, key, addOrUpdateIntegrationLinkModel) - -Add or update Integration link - - - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.IntegrationLinksApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - IntegrationLinksApi apiInstance = new IntegrationLinksApi(defaultClient); - UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. - Integer settingId = 56; // Integer | The id of the Setting. - IntegrationLinkType integrationLinkType = IntegrationLinkType.fromValue("trello"); // IntegrationLinkType | The integration link's type. - String key = "key_example"; // String | The key of the integration link. - AddOrUpdateIntegrationLinkModel addOrUpdateIntegrationLinkModel = new AddOrUpdateIntegrationLinkModel(); // AddOrUpdateIntegrationLinkModel | - try { - IntegrationLinkModel result = apiInstance.addOrUpdateIntegrationLink(environmentId, settingId, integrationLinkType, key, addOrUpdateIntegrationLinkModel); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling IntegrationLinksApi#addOrUpdateIntegrationLink"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **environmentId** | **UUID**| The identifier of the Environment. | | -| **settingId** | **Integer**| The id of the Setting. | | -| **integrationLinkType** | [**IntegrationLinkType**](.md)| The integration link's type. | [enum: trello, jira, monday] | -| **key** | **String**| The key of the integration link. | | -| **addOrUpdateIntegrationLinkModel** | [**AddOrUpdateIntegrationLinkModel**](AddOrUpdateIntegrationLinkModel.md)| | [optional] | - -### Return type - -[**IntegrationLinkModel**](IntegrationLinkModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When everything is ok, the integration link data returned. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **deleteIntegrationLink** -> DeleteIntegrationLinkModel deleteIntegrationLink(environmentId, settingId, integrationLinkType, key) - -Delete Integration link - - - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.IntegrationLinksApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - IntegrationLinksApi apiInstance = new IntegrationLinksApi(defaultClient); - UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. - Integer settingId = 56; // Integer | The id of the Setting. - IntegrationLinkType integrationLinkType = IntegrationLinkType.fromValue("trello"); // IntegrationLinkType | The integration's type. - String key = "key_example"; // String | The key of the integration link. - try { - DeleteIntegrationLinkModel result = apiInstance.deleteIntegrationLink(environmentId, settingId, integrationLinkType, key); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling IntegrationLinksApi#deleteIntegrationLink"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **environmentId** | **UUID**| The identifier of the Environment. | | -| **settingId** | **Integer**| The id of the Setting. | | -| **integrationLinkType** | [**IntegrationLinkType**](.md)| The integration's type. | [enum: trello, jira, monday] | -| **key** | **String**| The key of the integration link. | | - -### Return type - -[**DeleteIntegrationLinkModel**](DeleteIntegrationLinkModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When everything is ok. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getIntegrationLinkDetails** -> IntegrationLinkDetailsModel getIntegrationLinkDetails(integrationLinkType, key) - -Get Integration link - - - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.IntegrationLinksApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - IntegrationLinksApi apiInstance = new IntegrationLinksApi(defaultClient); - IntegrationLinkType integrationLinkType = IntegrationLinkType.fromValue("trello"); // IntegrationLinkType | The integration link's type. - String key = "key_example"; // String | The key of the integration link. - try { - IntegrationLinkDetailsModel result = apiInstance.getIntegrationLinkDetails(integrationLinkType, key); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling IntegrationLinksApi#getIntegrationLinkDetails"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **integrationLinkType** | [**IntegrationLinkType**](.md)| The integration link's type. | [enum: trello, jira, monday] | -| **key** | **String**| The key of the integration link. | | - -### Return type - -[**IntegrationLinkDetailsModel**](IntegrationLinkDetailsModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When everything is ok, the details for the integration link returned. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **jiraAddOrUpdateIntegrationLink** -> IntegrationLinkModel jiraAddOrUpdateIntegrationLink(environmentId, settingId, key, addOrUpdateJiraIntegrationLinkModel) - - - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.IntegrationLinksApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - IntegrationLinksApi apiInstance = new IntegrationLinksApi(defaultClient); - UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. - Integer settingId = 56; // Integer | The id of the Setting. - String key = "key_example"; // String | The key of the integration link. - AddOrUpdateJiraIntegrationLinkModel addOrUpdateJiraIntegrationLinkModel = new AddOrUpdateJiraIntegrationLinkModel(); // AddOrUpdateJiraIntegrationLinkModel | - try { - IntegrationLinkModel result = apiInstance.jiraAddOrUpdateIntegrationLink(environmentId, settingId, key, addOrUpdateJiraIntegrationLinkModel); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling IntegrationLinksApi#jiraAddOrUpdateIntegrationLink"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **environmentId** | **UUID**| The identifier of the Environment. | | -| **settingId** | **Integer**| The id of the Setting. | | -| **key** | **String**| The key of the integration link. | | -| **addOrUpdateJiraIntegrationLinkModel** | [**AddOrUpdateJiraIntegrationLinkModel**](AddOrUpdateJiraIntegrationLinkModel.md)| | [optional] | - -### Return type - -[**IntegrationLinkModel**](IntegrationLinkModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When everything is ok, the integration link data returned. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **jiraConnect** -> jiraConnect(connectRequest) - - - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.IntegrationLinksApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - IntegrationLinksApi apiInstance = new IntegrationLinksApi(defaultClient); - ConnectRequest connectRequest = new ConnectRequest(); // ConnectRequest | - try { - apiInstance.jiraConnect(connectRequest); - } catch (ApiException e) { - System.err.println("Exception when calling IntegrationLinksApi#jiraConnect"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **connectRequest** | [**ConnectRequest**](ConnectRequest.md)| | [optional] | - -### Return type - -null (empty response body) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - diff --git a/docs/IntegrationModel.md b/docs/IntegrationModel.md deleted file mode 100644 index 46fbccf..0000000 --- a/docs/IntegrationModel.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# IntegrationModel - -Details of the Integration. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**product** | [**ProductModel**](ProductModel.md) | | [optional] | -|**integrationId** | **UUID** | Identifier of the Integration. | [optional] | -|**name** | **String** | Name of the Integration. | [optional] | -|**integrationType** | **IntegrationType** | | [optional] | -|**parameters** | **Map<String, String>** | Parameters of the Integration. | [optional] | -|**environmentIds** | **List<UUID>** | List of Environment IDs that are connected with this Integration. If the list is empty, all of the Environments are connected. | [optional] | -|**configIds** | **List<UUID>** | List of Config IDs that are connected with this Integration. If the list is empty, all of the Configs are connected. | [optional] | - - - diff --git a/docs/IntegrationType.md b/docs/IntegrationType.md deleted file mode 100644 index 534f4ce..0000000 --- a/docs/IntegrationType.md +++ /dev/null @@ -1,21 +0,0 @@ - - -# IntegrationType - -## Enum - - -* `DATA_DOG` (value: `"dataDog"`) - -* `SLACK` (value: `"slack"`) - -* `AMPLITUDE` (value: `"amplitude"`) - -* `MIX_PANEL` (value: `"mixPanel"`) - -* `SEGMENT` (value: `"segment"`) - -* `PUB_NUB` (value: `"pubNub"`) - - - diff --git a/docs/IntegrationsApi.md b/docs/IntegrationsApi.md deleted file mode 100644 index c072e4d..0000000 --- a/docs/IntegrationsApi.md +++ /dev/null @@ -1,371 +0,0 @@ -# IntegrationsApi - -All URIs are relative to *https://api.configcat.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**createIntegration**](IntegrationsApi.md#createIntegration) | **POST** /v1/products/{productId}/integrations | Create Integration | -| [**deleteIntegration**](IntegrationsApi.md#deleteIntegration) | **DELETE** /v1/integrations/{integrationId} | Delete Integration | -| [**getIntegration**](IntegrationsApi.md#getIntegration) | **GET** /v1/integrations/{integrationId} | Get Integration | -| [**getIntegrations**](IntegrationsApi.md#getIntegrations) | **GET** /v1/products/{productId}/integrations | List Integrations | -| [**updateIntegration**](IntegrationsApi.md#updateIntegration) | **PUT** /v1/integrations/{integrationId} | Update Integration | - - - -# **createIntegration** -> IntegrationModel createIntegration(productId, createIntegrationModel) - -Create Integration - -This endpoint creates a new Integration in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. The Parameters dictionary differs for each IntegrationType: - Datadog - `apikey`: Required. Datadog API key. - `site`: Datadog site. Available values: `Us`, `Eu`, `Us1Fed`, `Us3`, `Us5`. Default: `Us`. - Slack Connecting the Slack integration through the Public Management API will not post messages with the ConfigCat Feature Flags Slack app but with an incoming webhook. - `incoming_webhook.url`: Required. The [incoming webhook URL](https://api.slack.com/messaging/webhooks) where the integration should post messages. - Amplitude - `apiKey`: Required. Amplitude API Key. - `secretKey`: Required. Amplitude Secret Key. - Mixpanel - `serviceAccountUserName`: Required. Mixpanel Service Account Username. - `serviceAccountSecret`: Required. Mixpanel Service Account Secret. - `projectId`: Required. Mixpanel Project ID. - `server`: Mixpanel Server. Available values: `StandardServer`, `EUResidencyServer`. Default: `StandardServer`. - Twilio Segment - `writeKey`: Required. Twilio Segment Write Key. - `server`: Twilio Segment Server. Available values: `Us`, `Eu`. Default: `Us`. - PubNub (work in progress) - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.IntegrationsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - IntegrationsApi apiInstance = new IntegrationsApi(defaultClient); - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. - CreateIntegrationModel createIntegrationModel = new CreateIntegrationModel(); // CreateIntegrationModel | - try { - IntegrationModel result = apiInstance.createIntegration(productId, createIntegrationModel); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling IntegrationsApi#createIntegration"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **UUID**| The identifier of the Product. | | -| **createIntegrationModel** | [**CreateIntegrationModel**](CreateIntegrationModel.md)| | | - -### Return type - -[**IntegrationModel**](IntegrationModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **201** | When the creation was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **deleteIntegration** -> deleteIntegration(integrationId) - -Delete Integration - -This endpoint removes a Integration identified by the `integrationId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.IntegrationsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - IntegrationsApi apiInstance = new IntegrationsApi(defaultClient); - UUID integrationId = UUID.randomUUID(); // UUID | The identifier of the Integration. - try { - apiInstance.deleteIntegration(integrationId); - } catch (ApiException e) { - System.err.println("Exception when calling IntegrationsApi#deleteIntegration"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **integrationId** | **UUID**| The identifier of the Integration. | | - -### Return type - -null (empty response body) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **204** | When the delete was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getIntegration** -> IntegrationModel getIntegration(integrationId) - -Get Integration - -This endpoint returns the metadata of an Integration identified by the `integrationId`. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.IntegrationsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - IntegrationsApi apiInstance = new IntegrationsApi(defaultClient); - UUID integrationId = UUID.randomUUID(); // UUID | The identifier of the Integration. - try { - IntegrationModel result = apiInstance.getIntegration(integrationId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling IntegrationsApi#getIntegration"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **integrationId** | **UUID**| The identifier of the Integration. | | - -### Return type - -[**IntegrationModel**](IntegrationModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When everything is ok, the integration data returned. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getIntegrations** -> IntegrationsModel getIntegrations(productId) - -List Integrations - -This endpoint returns the list of the Integrations that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.IntegrationsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - IntegrationsApi apiInstance = new IntegrationsApi(defaultClient); - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. - try { - IntegrationsModel result = apiInstance.getIntegrations(productId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling IntegrationsApi#getIntegrations"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **UUID**| The identifier of the Product. | | - -### Return type - -[**IntegrationsModel**](IntegrationsModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **updateIntegration** -> IntegrationModel updateIntegration(integrationId, modifyIntegrationRequest) - -Update Integration - -This endpoint updates a Config identified by the `integrationId` parameter. The Parameters dictionary differs for each IntegrationType: - Datadog - `apikey`: Required. Datadog API key. - `site`: Datadog site. Available values: `Us`, `Eu`, `Us1Fed`, `Us3`, `Us5`. Default: `Us`. - Slack Connecting the Slack integration through the Public Management API will not post messages with the ConfigCat Feature Flags Slack app but with an incoming webhook. - `incoming_webhook.url`: Required. The [incoming webhook URL](https://api.slack.com/messaging/webhooks) where the integration should post messages. - Amplitude - `apiKey`: Required. Amplitude API Key. - `secretKey`: Required. Amplitude Secret Key. - Mixpanel - `serviceAccountUserName`: Required. Mixpanel Service Account Username. - `serviceAccountSecret`: Required. Mixpanel Service Account Secret. - `projectId`: Required. Mixpanel Project ID. - `server`: Mixpanel Server. Available values: `StandardServer`, `EUResidencyServer`. Default: `StandardServer`. - Twilio Segment - `writeKey`: Required. Twilio Segment Write Key. - `server`: Twilio Segment Server. Available values: `Us`, `Eu`. Default: `Us`. - PubNub (work in progress) - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.IntegrationsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - IntegrationsApi apiInstance = new IntegrationsApi(defaultClient); - UUID integrationId = UUID.randomUUID(); // UUID | The identifier of the Integration. - ModifyIntegrationRequest modifyIntegrationRequest = new ModifyIntegrationRequest(); // ModifyIntegrationRequest | - try { - IntegrationModel result = apiInstance.updateIntegration(integrationId, modifyIntegrationRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling IntegrationsApi#updateIntegration"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **integrationId** | **UUID**| The identifier of the Integration. | | -| **modifyIntegrationRequest** | [**ModifyIntegrationRequest**](ModifyIntegrationRequest.md)| | | - -### Return type - -[**IntegrationModel**](IntegrationModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - diff --git a/docs/IntegrationsModel.md b/docs/IntegrationsModel.md deleted file mode 100644 index 7073544..0000000 --- a/docs/IntegrationsModel.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# IntegrationsModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**integrations** | [**List<IntegrationModel>**](IntegrationModel.md) | The Integrations of the Product. | [optional] | - - - diff --git a/docs/InvitationModel.md b/docs/InvitationModel.md deleted file mode 100644 index ec60c30..0000000 --- a/docs/InvitationModel.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# InvitationModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**invitationId** | **UUID** | The identifier of the Invitation. | [optional] | -|**email** | **String** | The invited user's email address. | [optional] | -|**permissionGroupId** | **Long** | The identifier of the Permission Group the user was invited to. | [optional] | -|**createdAt** | **OffsetDateTime** | Creation time of the Invitation. | [optional] | -|**expired** | **Boolean** | Determines whether the Invitation is expired. | [optional] | - - - diff --git a/docs/InviteMembersRequest.md b/docs/InviteMembersRequest.md deleted file mode 100644 index eef8258..0000000 --- a/docs/InviteMembersRequest.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# InviteMembersRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**emails** | **List<String>** | List of email addresses to invite. | | -|**permissionGroupId** | **Long** | Identifier of the Permission Group to where the invited users should be added. | | - - - diff --git a/docs/JsonPatchOperation.md b/docs/JsonPatchOperation.md deleted file mode 100644 index cf7d095..0000000 --- a/docs/JsonPatchOperation.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# JsonPatchOperation - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**op** | **OperationType** | | | -|**path** | **String** | The source path. | | -|**from** | **String** | The target path. | [optional] | -|**value** | **Object** | The discrete value. | [optional] | - - - diff --git a/docs/KeyGenerationMode.md b/docs/KeyGenerationMode.md deleted file mode 100644 index 93ad49c..0000000 --- a/docs/KeyGenerationMode.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# KeyGenerationMode - -## Enum - - -* `CAMEL_CASE` (value: `"camelCase"`) - -* `LOWER_CASE` (value: `"lowerCase"`) - -* `UPPER_CASE` (value: `"upperCase"`) - -* `PASCAL_CASE` (value: `"pascalCase"`) - -* `KEBAB_CASE` (value: `"kebabCase"`) - - - diff --git a/docs/MeApi.md b/docs/MeApi.md deleted file mode 100644 index ede15ee..0000000 --- a/docs/MeApi.md +++ /dev/null @@ -1,74 +0,0 @@ -# MeApi - -All URIs are relative to *https://api.configcat.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**getMe**](MeApi.md#getMe) | **GET** /v1/me | Get authenticated user details | - - - -# **getMe** -> MeModel getMe() - -Get authenticated user details - - - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.MeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - MeApi apiInstance = new MeApi(defaultClient); - try { - MeModel result = apiInstance.getMe(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling MeApi#getMe"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**MeModel**](MeModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - diff --git a/docs/MeModel.md b/docs/MeModel.md deleted file mode 100644 index 3a50428..0000000 --- a/docs/MeModel.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# MeModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**email** | **String** | | [optional] [readonly] | -|**fullName** | **String** | | [optional] [readonly] | - - - diff --git a/docs/MemberModel.md b/docs/MemberModel.md deleted file mode 100644 index 0989c85..0000000 --- a/docs/MemberModel.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# MemberModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**userId** | **String** | Identifier of the Member. | [optional] | -|**productId** | **UUID** | Identifier of the Product where the Member has access. | [optional] | -|**permissionGroupId** | **Long** | Identifier of the Member's Permission Group. | [optional] | -|**fullName** | **String** | Name of the Member. | [optional] | -|**email** | **String** | Email of the Member. | [optional] | - - - diff --git a/docs/MembersApi.md b/docs/MembersApi.md deleted file mode 100644 index 28bbb68..0000000 --- a/docs/MembersApi.md +++ /dev/null @@ -1,733 +0,0 @@ -# MembersApi - -All URIs are relative to *https://api.configcat.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**addMemberToGroup**](MembersApi.md#addMemberToGroup) | **POST** /v1/organizations/{organizationId}/members/{userId} | Update Member Permissions | -| [**deleteInvitation**](MembersApi.md#deleteInvitation) | **DELETE** /v1/invitations/{invitationId} | Delete Invitation | -| [**deleteOrganizationMember**](MembersApi.md#deleteOrganizationMember) | **DELETE** /v1/organizations/{organizationId}/members/{userId} | Delete Member from Organization | -| [**deleteProductMember**](MembersApi.md#deleteProductMember) | **DELETE** /v1/products/{productId}/members/{userId} | Delete Member from Product | -| [**getOrganizationMembers**](MembersApi.md#getOrganizationMembers) | **GET** /v1/organizations/{organizationId}/members | List Organization Members | -| [**getOrganizationMembersV2**](MembersApi.md#getOrganizationMembersV2) | **GET** /v2/organizations/{organizationId}/members | List Organization Members | -| [**getPendingInvitations**](MembersApi.md#getPendingInvitations) | **GET** /v1/products/{productId}/invitations | List Pending Invitations in Product | -| [**getPendingInvitationsOrg**](MembersApi.md#getPendingInvitationsOrg) | **GET** /v1/organizations/{organizationId}/invitations | List Pending Invitations in Organization | -| [**getProductMembers**](MembersApi.md#getProductMembers) | **GET** /v1/products/{productId}/members | List Product Members | -| [**inviteMember**](MembersApi.md#inviteMember) | **POST** /v1/products/{productId}/members/invite | Invite Member | - - - -# **addMemberToGroup** -> addMemberToGroup(organizationId, userId, updateMemberPermissionsRequest) - -Update Member Permissions - -This endpoint updates the permissions of a Member identified by the `userId`. This endpoint can also be used to move a Member between Permission Groups within a Product. Only a single Permission Group can be set per Product. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.MembersApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - MembersApi apiInstance = new MembersApi(defaultClient); - UUID organizationId = UUID.randomUUID(); // UUID | The identifier of the Organization. - String userId = "userId_example"; // String | The identifier of the Member. - UpdateMemberPermissionsRequest updateMemberPermissionsRequest = new UpdateMemberPermissionsRequest(); // UpdateMemberPermissionsRequest | - try { - apiInstance.addMemberToGroup(organizationId, userId, updateMemberPermissionsRequest); - } catch (ApiException e) { - System.err.println("Exception when calling MembersApi#addMemberToGroup"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **organizationId** | **UUID**| The identifier of the Organization. | | -| **userId** | **String**| The identifier of the Member. | | -| **updateMemberPermissionsRequest** | [**UpdateMemberPermissionsRequest**](UpdateMemberPermissionsRequest.md)| | | - -### Return type - -null (empty response body) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When the update was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **deleteInvitation** -> deleteInvitation(invitationId) - -Delete Invitation - -This endpoint removes an Invitation identified by the `invitationId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.MembersApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - MembersApi apiInstance = new MembersApi(defaultClient); - UUID invitationId = UUID.randomUUID(); // UUID | The identifier of the Invitation. - try { - apiInstance.deleteInvitation(invitationId); - } catch (ApiException e) { - System.err.println("Exception when calling MembersApi#deleteInvitation"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **invitationId** | **UUID**| The identifier of the Invitation. | | - -### Return type - -null (empty response body) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **204** | When the delete was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **deleteOrganizationMember** -> deleteOrganizationMember(organizationId, userId) - -Delete Member from Organization - -This endpoint removes a Member identified by the `userId` from the given Organization identified by the `organizationId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.MembersApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - MembersApi apiInstance = new MembersApi(defaultClient); - UUID organizationId = UUID.randomUUID(); // UUID | The identifier of the Organization. - String userId = "userId_example"; // String | The identifier of the Member. - try { - apiInstance.deleteOrganizationMember(organizationId, userId); - } catch (ApiException e) { - System.err.println("Exception when calling MembersApi#deleteOrganizationMember"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **organizationId** | **UUID**| The identifier of the Organization. | | -| **userId** | **String**| The identifier of the Member. | | - -### Return type - -null (empty response body) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **204** | When the delete was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **deleteProductMember** -> deleteProductMember(productId, userId) - -Delete Member from Product - -This endpoint removes a Member identified by the `userId` from the given Product identified by the `productId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.MembersApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - MembersApi apiInstance = new MembersApi(defaultClient); - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. - String userId = "userId_example"; // String | The identifier of the Member. - try { - apiInstance.deleteProductMember(productId, userId); - } catch (ApiException e) { - System.err.println("Exception when calling MembersApi#deleteProductMember"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **UUID**| The identifier of the Product. | | -| **userId** | **String**| The identifier of the Member. | | - -### Return type - -null (empty response body) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **204** | When the delete was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getOrganizationMembers** -> List<UserModel> getOrganizationMembers(organizationId) - -List Organization Members - -This endpoint returns the list of Members that belongs to the given Organization, identified by the `organizationId` parameter. The results may vary based on the access level of the user who calls the endpoint: - When it's called with Organization Admin privileges, the result will contain each member in the Organization. - When it's called without Organization Admin privileges, the result will contain each Organization Admin along with members of those products where the caller has `Team members and permission groups` (`canManageMembers`) permission. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.MembersApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - MembersApi apiInstance = new MembersApi(defaultClient); - UUID organizationId = UUID.randomUUID(); // UUID | The identifier of the Organization. - try { - List result = apiInstance.getOrganizationMembers(organizationId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling MembersApi#getOrganizationMembers"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **organizationId** | **UUID**| The identifier of the Organization. | | - -### Return type - -[**List<UserModel>**](UserModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getOrganizationMembersV2** -> OrganizationMembersModel getOrganizationMembersV2(organizationId) - -List Organization Members - -This endpoint returns the list of Members that belongs to the given Organization, identified by the `organizationId` parameter. The results may vary based on the access level of the user who calls the endpoint: - When it's called with Organization Admin privileges, the result will contain each member in the Organization. - When it's called without Organization Admin privileges, the result will contain each Organization Admin along with members of those products where the caller has `Team members and permission groups` (`canManageMembers`) permission. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.MembersApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - MembersApi apiInstance = new MembersApi(defaultClient); - UUID organizationId = UUID.randomUUID(); // UUID | The identifier of the Organization. - try { - OrganizationMembersModel result = apiInstance.getOrganizationMembersV2(organizationId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling MembersApi#getOrganizationMembersV2"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **organizationId** | **UUID**| The identifier of the Organization. | | - -### Return type - -[**OrganizationMembersModel**](OrganizationMembersModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getPendingInvitations** -> List<InvitationModel> getPendingInvitations(productId) - -List Pending Invitations in Product - -This endpoint returns the list of pending invitations within the given Product identified by the `productId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.MembersApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - MembersApi apiInstance = new MembersApi(defaultClient); - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. - try { - List result = apiInstance.getPendingInvitations(productId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling MembersApi#getPendingInvitations"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **UUID**| The identifier of the Product. | | - -### Return type - -[**List<InvitationModel>**](InvitationModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getPendingInvitationsOrg** -> List<OrganizationInvitationModel> getPendingInvitationsOrg(organizationId) - -List Pending Invitations in Organization - -This endpoint returns the list of pending invitations within the given Organization identified by the `organizationId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.MembersApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - MembersApi apiInstance = new MembersApi(defaultClient); - UUID organizationId = UUID.randomUUID(); // UUID | The identifier of the Organization. - try { - List result = apiInstance.getPendingInvitationsOrg(organizationId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling MembersApi#getPendingInvitationsOrg"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **organizationId** | **UUID**| The identifier of the Organization. | | - -### Return type - -[**List<OrganizationInvitationModel>**](OrganizationInvitationModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getProductMembers** -> List<MemberModel> getProductMembers(productId) - -List Product Members - -This endpoint returns the list of Members that belongs to the given Product, identified by the `productId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.MembersApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - MembersApi apiInstance = new MembersApi(defaultClient); - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. - try { - List result = apiInstance.getProductMembers(productId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling MembersApi#getProductMembers"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **UUID**| The identifier of the Product. | | - -### Return type - -[**List<MemberModel>**](MemberModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **inviteMember** -> inviteMember(productId, inviteMembersRequest) - -Invite Member - -This endpoint invites a Member into the given Product identified by the `productId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.MembersApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - MembersApi apiInstance = new MembersApi(defaultClient); - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. - InviteMembersRequest inviteMembersRequest = new InviteMembersRequest(); // InviteMembersRequest | - try { - apiInstance.inviteMember(productId, inviteMembersRequest); - } catch (ApiException e) { - System.err.println("Exception when calling MembersApi#inviteMember"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **UUID**| The identifier of the Product. | | -| **inviteMembersRequest** | [**InviteMembersRequest**](InviteMembersRequest.md)| | | - -### Return type - -null (empty response body) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When the invite was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - diff --git a/docs/ModifyIntegrationRequest.md b/docs/ModifyIntegrationRequest.md deleted file mode 100644 index 9710ef7..0000000 --- a/docs/ModifyIntegrationRequest.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# ModifyIntegrationRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | Name of the Integration. | | -|**parameters** | **Map<String, String>** | Parameters of the Integration. | | -|**environmentIds** | **List<UUID>** | List of Environment IDs that are connected with this Integration. If the list is empty, all of the Environments are connected. | | -|**configIds** | **List<UUID>** | List of Config IDs that are connected with this Integration. If the list is empty, all of the Configs are connected. | | - - - diff --git a/docs/OperationType.md b/docs/OperationType.md deleted file mode 100644 index 23dc720..0000000 --- a/docs/OperationType.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# OperationType - -## Enum - - -* `UNKNOWN` (value: `"unknown"`) - -* `ADD` (value: `"add"`) - -* `REMOVE` (value: `"remove"`) - -* `REPLACE` (value: `"replace"`) - -* `MOVE` (value: `"move"`) - -* `COPY` (value: `"copy"`) - -* `TEST` (value: `"test"`) - - - diff --git a/docs/OrganizationAdminModel.md b/docs/OrganizationAdminModel.md deleted file mode 100644 index c610689..0000000 --- a/docs/OrganizationAdminModel.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# OrganizationAdminModel - -Describes an Organization Admin. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**userId** | **String** | Identifier of the Organization Admin. | [optional] | -|**fullName** | **String** | Name of the Organization Admin. | [optional] | -|**email** | **String** | Email of the OrganizationAdmin. | [optional] | -|**twoFactorEnabled** | **Boolean** | Determines whether 2FA is enabled for the Organization Admin. | [optional] | - - - diff --git a/docs/OrganizationInvitationModel.md b/docs/OrganizationInvitationModel.md deleted file mode 100644 index b7c7bf4..0000000 --- a/docs/OrganizationInvitationModel.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# OrganizationInvitationModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**invitationId** | **UUID** | The identifier of the Invitation. | [optional] | -|**email** | **String** | The invited user's email address. | [optional] | -|**productId** | **UUID** | The identifier of the Product the user was invited to. | [optional] | -|**productName** | **String** | The name of the Product the user was invited to. | [optional] | -|**permissionGroupId** | **Long** | The identifier of the Permission Group the user was invited to. | [optional] | -|**createdAt** | **OffsetDateTime** | Creation time of the Invitation. | [optional] | -|**expired** | **Boolean** | Determines whether the Invitation is expired. | [optional] | -|**expires** | **OffsetDateTime** | Expiration time of the Invitation. | [optional] | - - - diff --git a/docs/OrganizationMemberModel.md b/docs/OrganizationMemberModel.md deleted file mode 100644 index 6492d3d..0000000 --- a/docs/OrganizationMemberModel.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# OrganizationMemberModel - -Describes an Organization Member. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**userId** | **String** | Identifier of the Organization Admin. | [optional] | -|**fullName** | **String** | Name of the Organization Admin. | [optional] | -|**email** | **String** | Email of the OrganizationAdmin. | [optional] | -|**twoFactorEnabled** | **Boolean** | Determines whether 2FA is enabled for the Organization Admin. | [optional] | -|**permissions** | [**List<OrganizationPermissionModel>**](OrganizationPermissionModel.md) | The permissions of the Member. | [optional] | - - - diff --git a/docs/OrganizationMembersModel.md b/docs/OrganizationMembersModel.md deleted file mode 100644 index 365435a..0000000 --- a/docs/OrganizationMembersModel.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# OrganizationMembersModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**admins** | [**List<OrganizationAdminModel>**](OrganizationAdminModel.md) | List of Organization Admins. | [optional] | -|**billingManagers** | [**List<OrganizationAdminModel>**](OrganizationAdminModel.md) | List of Billing Managers. | [optional] | -|**members** | [**List<OrganizationMemberModel>**](OrganizationMemberModel.md) | List of Organization Members. | [optional] | - - - diff --git a/docs/OrganizationModel.md b/docs/OrganizationModel.md deleted file mode 100644 index 42e9872..0000000 --- a/docs/OrganizationModel.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# OrganizationModel - -Details of the Organization. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**organizationId** | **UUID** | Identifier of the Organization. | [optional] | -|**name** | **String** | Name of the Organization. | [optional] | - - - diff --git a/docs/OrganizationPermissionGroupModel.md b/docs/OrganizationPermissionGroupModel.md deleted file mode 100644 index 9a1bf93..0000000 --- a/docs/OrganizationPermissionGroupModel.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# OrganizationPermissionGroupModel - -Describes the Member's Permission Group within a Product. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**permissionGroupId** | **Long** | Identifier of the Member's Permission Group. | [optional] | -|**name** | **String** | Name of the Member's Permission Group. | [optional] | - - - diff --git a/docs/OrganizationPermissionModel.md b/docs/OrganizationPermissionModel.md deleted file mode 100644 index 3521045..0000000 --- a/docs/OrganizationPermissionModel.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# OrganizationPermissionModel - -Describes the Member's permission. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**product** | [**OrganizationProductModel**](OrganizationProductModel.md) | | [optional] | -|**permissionGroup** | [**OrganizationPermissionGroupModel**](OrganizationPermissionGroupModel.md) | | [optional] | - - - diff --git a/docs/OrganizationProductModel.md b/docs/OrganizationProductModel.md deleted file mode 100644 index c42e97f..0000000 --- a/docs/OrganizationProductModel.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# OrganizationProductModel - -Describes the Member's Product. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**productId** | **UUID** | Identifier of the Member's Product. | [optional] | -|**name** | **String** | Name of the Member's Product. | [optional] | - - - diff --git a/docs/OrganizationsApi.md b/docs/OrganizationsApi.md deleted file mode 100644 index 17c722b..0000000 --- a/docs/OrganizationsApi.md +++ /dev/null @@ -1,74 +0,0 @@ -# OrganizationsApi - -All URIs are relative to *https://api.configcat.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**getOrganizations**](OrganizationsApi.md#getOrganizations) | **GET** /v1/organizations | List Organizations | - - - -# **getOrganizations** -> List<OrganizationModel> getOrganizations() - -List Organizations - -This endpoint returns the list of the Organizations that belongs to the user. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.OrganizationsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - OrganizationsApi apiInstance = new OrganizationsApi(defaultClient); - try { - List result = apiInstance.getOrganizations(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling OrganizationsApi#getOrganizations"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**List<OrganizationModel>**](OrganizationModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - diff --git a/docs/PercentageOptionModel.md b/docs/PercentageOptionModel.md deleted file mode 100644 index 6511953..0000000 --- a/docs/PercentageOptionModel.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# PercentageOptionModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**percentage** | **Integer** | A number between 0 and 100 that represents a randomly allocated fraction of the users. | | -|**value** | [**ValueModel**](ValueModel.md) | | | - - - diff --git a/docs/PermissionGroupModel.md b/docs/PermissionGroupModel.md deleted file mode 100644 index 0cff1be..0000000 --- a/docs/PermissionGroupModel.md +++ /dev/null @@ -1,39 +0,0 @@ - - -# PermissionGroupModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**permissionGroupId** | **Long** | Identifier of the Permission Group. | [optional] | -|**name** | **String** | Name of the Permission Group. | [optional] | -|**canManageMembers** | **Boolean** | Group members can manage team members. | [optional] | -|**canCreateOrUpdateConfig** | **Boolean** | Group members can create/update Configs. | [optional] | -|**canDeleteConfig** | **Boolean** | Group members can delete Configs. | [optional] | -|**canCreateOrUpdateEnvironment** | **Boolean** | Group members can create/update Environments. | [optional] | -|**canDeleteEnvironment** | **Boolean** | Group members can delete Environments. | [optional] | -|**canCreateOrUpdateSetting** | **Boolean** | Group members can create/update Feature Flags and Settings. | [optional] | -|**canTagSetting** | **Boolean** | Group members can attach/detach Tags to Feature Flags and Settings. | [optional] | -|**canDeleteSetting** | **Boolean** | Group members can delete Feature Flags and Settings. | [optional] | -|**canCreateOrUpdateTag** | **Boolean** | Group members can create/update Tags. | [optional] | -|**canDeleteTag** | **Boolean** | Group members can delete Tags. | [optional] | -|**canManageWebhook** | **Boolean** | Group members can create/update/delete Webhooks. | [optional] | -|**canUseExportImport** | **Boolean** | Group members can use the export/import feature. | [optional] | -|**canManageProductPreferences** | **Boolean** | Group members can update Product preferences. | [optional] | -|**canManageIntegrations** | **Boolean** | Group members can add and configure integrations. | [optional] | -|**canViewSdkKey** | **Boolean** | Group members has access to SDK keys. | [optional] | -|**canRotateSdkKey** | **Boolean** | Group members can rotate SDK keys. | [optional] | -|**canCreateOrUpdateSegments** | **Boolean** | Group members can create/update Segments. | [optional] | -|**canDeleteSegments** | **Boolean** | Group members can delete Segments. | [optional] | -|**canViewProductAuditLog** | **Boolean** | Group members has access to audit logs. | [optional] | -|**canViewProductStatistics** | **Boolean** | Group members has access to product statistics. | [optional] | -|**canDisable2FA** | **Boolean** | Group members can disable two-factor authentication for other members. | [optional] | -|**accessType** | **AccessType** | | [optional] | -|**newEnvironmentAccessType** | **EnvironmentAccessType** | | [optional] | -|**environmentAccesses** | [**List<EnvironmentAccessModel>**](EnvironmentAccessModel.md) | List of environment specific permissions. | [optional] | -|**product** | [**ProductModel**](ProductModel.md) | | [optional] | - - - diff --git a/docs/PermissionGroupsApi.md b/docs/PermissionGroupsApi.md deleted file mode 100644 index 581fccb..0000000 --- a/docs/PermissionGroupsApi.md +++ /dev/null @@ -1,371 +0,0 @@ -# PermissionGroupsApi - -All URIs are relative to *https://api.configcat.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**createPermissionGroup**](PermissionGroupsApi.md#createPermissionGroup) | **POST** /v1/products/{productId}/permissions | Create Permission Group | -| [**deletePermissionGroup**](PermissionGroupsApi.md#deletePermissionGroup) | **DELETE** /v1/permissions/{permissionGroupId} | Delete Permission Group | -| [**getPermissionGroup**](PermissionGroupsApi.md#getPermissionGroup) | **GET** /v1/permissions/{permissionGroupId} | Get Permission Group | -| [**getPermissionGroups**](PermissionGroupsApi.md#getPermissionGroups) | **GET** /v1/products/{productId}/permissions | List Permission Groups | -| [**updatePermissionGroup**](PermissionGroupsApi.md#updatePermissionGroup) | **PUT** /v1/permissions/{permissionGroupId} | Update Permission Group | - - - -# **createPermissionGroup** -> PermissionGroupModel createPermissionGroup(productId, createPermissionGroupRequest) - -Create Permission Group - -This endpoint creates a new Permission Group in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.PermissionGroupsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - PermissionGroupsApi apiInstance = new PermissionGroupsApi(defaultClient); - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. - CreatePermissionGroupRequest createPermissionGroupRequest = new CreatePermissionGroupRequest(); // CreatePermissionGroupRequest | - try { - PermissionGroupModel result = apiInstance.createPermissionGroup(productId, createPermissionGroupRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling PermissionGroupsApi#createPermissionGroup"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **UUID**| The identifier of the Product. | | -| **createPermissionGroupRequest** | [**CreatePermissionGroupRequest**](CreatePermissionGroupRequest.md)| | | - -### Return type - -[**PermissionGroupModel**](PermissionGroupModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **201** | When the creation was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **deletePermissionGroup** -> deletePermissionGroup(permissionGroupId) - -Delete Permission Group - -This endpoint removes a Permission Group identified by the `permissionGroupId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.PermissionGroupsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - PermissionGroupsApi apiInstance = new PermissionGroupsApi(defaultClient); - Long permissionGroupId = 56L; // Long | The identifier of the Permission Group. - try { - apiInstance.deletePermissionGroup(permissionGroupId); - } catch (ApiException e) { - System.err.println("Exception when calling PermissionGroupsApi#deletePermissionGroup"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **permissionGroupId** | **Long**| The identifier of the Permission Group. | | - -### Return type - -null (empty response body) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **204** | When the delete was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getPermissionGroup** -> PermissionGroupModel getPermissionGroup(permissionGroupId) - -Get Permission Group - -This endpoint returns the metadata of a Permission Group identified by the `permissionGroupId`. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.PermissionGroupsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - PermissionGroupsApi apiInstance = new PermissionGroupsApi(defaultClient); - Long permissionGroupId = 56L; // Long | The identifier of the Permission Group. - try { - PermissionGroupModel result = apiInstance.getPermissionGroup(permissionGroupId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling PermissionGroupsApi#getPermissionGroup"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **permissionGroupId** | **Long**| The identifier of the Permission Group. | | - -### Return type - -[**PermissionGroupModel**](PermissionGroupModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When everything is ok, the permission group data returned. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getPermissionGroups** -> List<PermissionGroupModel> getPermissionGroups(productId) - -List Permission Groups - -This endpoint returns the list of the Permission Groups that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.PermissionGroupsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - PermissionGroupsApi apiInstance = new PermissionGroupsApi(defaultClient); - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. - try { - List result = apiInstance.getPermissionGroups(productId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling PermissionGroupsApi#getPermissionGroups"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **UUID**| The identifier of the Product. | | - -### Return type - -[**List<PermissionGroupModel>**](PermissionGroupModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **updatePermissionGroup** -> PermissionGroupModel updatePermissionGroup(permissionGroupId, updatePermissionGroupRequest) - -Update Permission Group - -This endpoint updates a Permission Group identified by the `permissionGroupId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.PermissionGroupsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - PermissionGroupsApi apiInstance = new PermissionGroupsApi(defaultClient); - Long permissionGroupId = 56L; // Long | The identifier of the Permission Group. - UpdatePermissionGroupRequest updatePermissionGroupRequest = new UpdatePermissionGroupRequest(); // UpdatePermissionGroupRequest | - try { - PermissionGroupModel result = apiInstance.updatePermissionGroup(permissionGroupId, updatePermissionGroupRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling PermissionGroupsApi#updatePermissionGroup"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **permissionGroupId** | **Long**| The identifier of the Permission Group. | | -| **updatePermissionGroupRequest** | [**UpdatePermissionGroupRequest**](UpdatePermissionGroupRequest.md)| | | - -### Return type - -[**PermissionGroupModel**](PermissionGroupModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - diff --git a/docs/PreferencesModel.md b/docs/PreferencesModel.md deleted file mode 100644 index f80cb08..0000000 --- a/docs/PreferencesModel.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# PreferencesModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**reasonRequired** | **Boolean** | Indicates that a mandatory note required for saving and publishing. | [optional] | -|**keyGenerationMode** | **KeyGenerationMode** | | [optional] | -|**showVariationId** | **Boolean** | Indicates whether a variation ID's must be shown on the ConfigCat Dashboard. | [optional] | -|**reasonRequiredEnvironments** | [**List<ReasonRequiredEnvironmentModel>**](ReasonRequiredEnvironmentModel.md) | List of Environments where mandatory note must be set before saving and publishing. | [optional] | -|**mandatorySettingHint** | **Boolean** | Indicates whether Feature flags and Settings must have a hint. | [optional] | - - - diff --git a/docs/PrerequisiteComparator.md b/docs/PrerequisiteComparator.md deleted file mode 100644 index 1761aa2..0000000 --- a/docs/PrerequisiteComparator.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# PrerequisiteComparator - -## Enum - - -* `EQUALS` (value: `"equals"`) - -* `DOES_NOT_EQUAL` (value: `"doesNotEqual"`) - - - diff --git a/docs/PrerequisiteFlagConditionModel.md b/docs/PrerequisiteFlagConditionModel.md deleted file mode 100644 index b4c3d45..0000000 --- a/docs/PrerequisiteFlagConditionModel.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# PrerequisiteFlagConditionModel - -Describes a condition that is based on a prerequisite flag. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**prerequisiteSettingId** | **Integer** | The prerequisite flag's identifier. | | -|**comparator** | **PrerequisiteComparator** | | | -|**prerequisiteComparisonValue** | [**ValueModel**](ValueModel.md) | | | - - - diff --git a/docs/ProductModel.md b/docs/ProductModel.md deleted file mode 100644 index a870f99..0000000 --- a/docs/ProductModel.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# ProductModel - -Details of the Product. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**organization** | [**OrganizationModel**](OrganizationModel.md) | | [optional] | -|**productId** | **UUID** | Identifier of the Product. | [optional] | -|**name** | **String** | Name of the Product. | [optional] | -|**description** | **String** | Description of the Product. | [optional] | -|**order** | **Integer** | The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | -|**reasonRequired** | **Boolean** | Determines whether a mandatory reason must be given every time when the Feature Flags or Settings within a Product are saved. | [optional] | - - - diff --git a/docs/ProductsApi.md b/docs/ProductsApi.md deleted file mode 100644 index 4686b05..0000000 --- a/docs/ProductsApi.md +++ /dev/null @@ -1,511 +0,0 @@ -# ProductsApi - -All URIs are relative to *https://api.configcat.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**createProduct**](ProductsApi.md#createProduct) | **POST** /v1/organizations/{organizationId}/products | Create Product | -| [**deleteProduct**](ProductsApi.md#deleteProduct) | **DELETE** /v1/products/{productId} | Delete Product | -| [**getProduct**](ProductsApi.md#getProduct) | **GET** /v1/products/{productId} | Get Product | -| [**getProductPreferences**](ProductsApi.md#getProductPreferences) | **GET** /v1/products/{productId}/preferences | Get Product Preferences | -| [**getProducts**](ProductsApi.md#getProducts) | **GET** /v1/products | List Products | -| [**updateProduct**](ProductsApi.md#updateProduct) | **PUT** /v1/products/{productId} | Update Product | -| [**updateProductPreferences**](ProductsApi.md#updateProductPreferences) | **POST** /v1/products/{productId}/preferences | Update Product Preferences | - - - -# **createProduct** -> ProductModel createProduct(organizationId, createProductRequest) - -Create Product - -This endpoint creates a new Product in a specified Organization identified by the `organizationId` parameter, which can be obtained from the [List Organizations](#operation/get-organizations) endpoint. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.ProductsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - ProductsApi apiInstance = new ProductsApi(defaultClient); - UUID organizationId = UUID.randomUUID(); // UUID | The identifier of the Organization. - CreateProductRequest createProductRequest = new CreateProductRequest(); // CreateProductRequest | - try { - ProductModel result = apiInstance.createProduct(organizationId, createProductRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ProductsApi#createProduct"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **organizationId** | **UUID**| The identifier of the Organization. | | -| **createProductRequest** | [**CreateProductRequest**](CreateProductRequest.md)| | | - -### Return type - -[**ProductModel**](ProductModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **201** | When the creation was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **deleteProduct** -> deleteProduct(productId) - -Delete Product - -This endpoint removes a Product identified by the `productId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.ProductsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - ProductsApi apiInstance = new ProductsApi(defaultClient); - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. - try { - apiInstance.deleteProduct(productId); - } catch (ApiException e) { - System.err.println("Exception when calling ProductsApi#deleteProduct"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **UUID**| The identifier of the Product. | | - -### Return type - -null (empty response body) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **204** | When the delete was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getProduct** -> ProductModel getProduct(productId) - -Get Product - -This endpoint returns the metadata of a Product identified by the `productId`. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.ProductsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - ProductsApi apiInstance = new ProductsApi(defaultClient); - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. - try { - ProductModel result = apiInstance.getProduct(productId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ProductsApi#getProduct"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **UUID**| The identifier of the Product. | | - -### Return type - -[**ProductModel**](ProductModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When everything is ok, the product data is returned. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getProductPreferences** -> PreferencesModel getProductPreferences(productId) - -Get Product Preferences - -This endpoint returns the preferences of a Product identified by the `productId`. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.ProductsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - ProductsApi apiInstance = new ProductsApi(defaultClient); - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. - try { - PreferencesModel result = apiInstance.getProductPreferences(productId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ProductsApi#getProductPreferences"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **UUID**| The identifier of the Product. | | - -### Return type - -[**PreferencesModel**](PreferencesModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When everything is ok, the product preferences data is returned. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getProducts** -> List<ProductModel> getProducts() - -List Products - -This endpoint returns the list of the Products that belongs to the user. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.ProductsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - ProductsApi apiInstance = new ProductsApi(defaultClient); - try { - List result = apiInstance.getProducts(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ProductsApi#getProducts"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**List<ProductModel>**](ProductModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **updateProduct** -> ProductModel updateProduct(productId, updateProductRequest) - -Update Product - -This endpoint updates a Product identified by the `productId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.ProductsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - ProductsApi apiInstance = new ProductsApi(defaultClient); - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. - UpdateProductRequest updateProductRequest = new UpdateProductRequest(); // UpdateProductRequest | - try { - ProductModel result = apiInstance.updateProduct(productId, updateProductRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ProductsApi#updateProduct"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **UUID**| The identifier of the Product. | | -| **updateProductRequest** | [**UpdateProductRequest**](UpdateProductRequest.md)| | | - -### Return type - -[**ProductModel**](ProductModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **updateProductPreferences** -> PreferencesModel updateProductPreferences(productId, updatePreferencesRequest) - -Update Product Preferences - -This endpoint updates the preferences of a Product identified by the `productId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.ProductsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - ProductsApi apiInstance = new ProductsApi(defaultClient); - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. - UpdatePreferencesRequest updatePreferencesRequest = new UpdatePreferencesRequest(); // UpdatePreferencesRequest | - try { - PreferencesModel result = apiInstance.updateProductPreferences(productId, updatePreferencesRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ProductsApi#updateProductPreferences"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **UUID**| The identifier of the Product. | | -| **updatePreferencesRequest** | [**UpdatePreferencesRequest**](UpdatePreferencesRequest.md)| | | - -### Return type - -[**PreferencesModel**](PreferencesModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When the update was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - diff --git a/docs/ReasonRequiredEnvironmentModel.md b/docs/ReasonRequiredEnvironmentModel.md deleted file mode 100644 index 81a744f..0000000 --- a/docs/ReasonRequiredEnvironmentModel.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# ReasonRequiredEnvironmentModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**environmentId** | **UUID** | Identifier of the Environment. | [optional] | -|**reasonRequired** | **Boolean** | Indicates that a mandatory note is required in this Environment for saving and publishing. | [optional] | -|**environmentName** | **String** | Name of the Environment. | [optional] | - - - diff --git a/docs/ReferenceLine.md b/docs/ReferenceLine.md deleted file mode 100644 index e8c1949..0000000 --- a/docs/ReferenceLine.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# ReferenceLine - -Determines a code reference line. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**lineText** | **String** | The content of the reference line. | [optional] | -|**lineNumber** | **Integer** | The line number. | | - - - diff --git a/docs/ReferenceLines.md b/docs/ReferenceLines.md deleted file mode 100644 index 734452f..0000000 --- a/docs/ReferenceLines.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# ReferenceLines - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**_file** | **String** | The file's name in where the code reference has been found. (Appears on the ConfigCat Dashboard) | | -|**fileUrl** | **String** | The file's url. (Used to point to the file on the repository's website) | [optional] | -|**preLines** | [**List<ReferenceLine>**](ReferenceLine.md) | The lines before the actual reference line. | [optional] | -|**postLines** | [**List<ReferenceLine>**](ReferenceLine.md) | The lines after the actual reference line. | [optional] | -|**referenceLine** | [**ReferenceLine**](ReferenceLine.md) | | | - - - diff --git a/docs/ReplaceSettingModel.md b/docs/ReplaceSettingModel.md deleted file mode 100644 index b930b01..0000000 --- a/docs/ReplaceSettingModel.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# ReplaceSettingModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**hint** | **String** | A short description for the setting, shown on the Dashboard UI. | [optional] | -|**tags** | **List<Long>** | The IDs of the tags which are attached to the setting. | [optional] | -|**order** | **Integer** | The order of the Setting represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | -|**name** | **String** | The name of the Feature Flag or Setting. | | - - - diff --git a/docs/RolloutPercentageItemModel.md b/docs/RolloutPercentageItemModel.md deleted file mode 100644 index 52b5c4f..0000000 --- a/docs/RolloutPercentageItemModel.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# RolloutPercentageItemModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**percentage** | **Long** | The percentage value for the rule. | | -|**value** | **Object** | The value to serve when the user falls in the percentage rule. It must respect the setting type. | [optional] | - - - diff --git a/docs/RolloutRuleComparator.md b/docs/RolloutRuleComparator.md deleted file mode 100644 index 0f489a9..0000000 --- a/docs/RolloutRuleComparator.md +++ /dev/null @@ -1,45 +0,0 @@ - - -# RolloutRuleComparator - -## Enum - - -* `IS_ONE_OF` (value: `"isOneOf"`) - -* `IS_NOT_ONE_OF` (value: `"isNotOneOf"`) - -* `CONTAINS` (value: `"contains"`) - -* `DOES_NOT_CONTAIN` (value: `"doesNotContain"`) - -* `SEM_VER_IS_ONE_OF` (value: `"semVerIsOneOf"`) - -* `SEM_VER_IS_NOT_ONE_OF` (value: `"semVerIsNotOneOf"`) - -* `SEM_VER_LESS` (value: `"semVerLess"`) - -* `SEM_VER_LESS_OR_EQUALS` (value: `"semVerLessOrEquals"`) - -* `SEM_VER_GREATER` (value: `"semVerGreater"`) - -* `SEM_VER_GREATER_OR_EQUALS` (value: `"semVerGreaterOrEquals"`) - -* `NUMBER_EQUALS` (value: `"numberEquals"`) - -* `NUMBER_DOES_NOT_EQUAL` (value: `"numberDoesNotEqual"`) - -* `NUMBER_LESS` (value: `"numberLess"`) - -* `NUMBER_LESS_OR_EQUALS` (value: `"numberLessOrEquals"`) - -* `NUMBER_GREATER` (value: `"numberGreater"`) - -* `NUMBER_GREATER_OR_EQUALS` (value: `"numberGreaterOrEquals"`) - -* `SENSITIVE_IS_ONE_OF` (value: `"sensitiveIsOneOf"`) - -* `SENSITIVE_IS_NOT_ONE_OF` (value: `"sensitiveIsNotOneOf"`) - - - diff --git a/docs/RolloutRuleModel.md b/docs/RolloutRuleModel.md deleted file mode 100644 index bf136a6..0000000 --- a/docs/RolloutRuleModel.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# RolloutRuleModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**comparisonAttribute** | **String** | The user attribute to compare. | [optional] | -|**comparator** | **RolloutRuleComparator** | | [optional] | -|**comparisonValue** | **String** | The value to compare against. | [optional] | -|**value** | **Object** | The value to serve when the comparison matches. It must respect the setting type. | [optional] | -|**segmentComparator** | **SegmentComparator** | | [optional] | -|**segmentId** | **UUID** | The segment to compare against. | [optional] | - - - diff --git a/docs/SdkKeysApi.md b/docs/SdkKeysApi.md deleted file mode 100644 index 33dc9d2..0000000 --- a/docs/SdkKeysApi.md +++ /dev/null @@ -1,82 +0,0 @@ -# SdkKeysApi - -All URIs are relative to *https://api.configcat.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**getSdkKeys**](SdkKeysApi.md#getSdkKeys) | **GET** /v1/configs/{configId}/environments/{environmentId} | Get SDK Key | - - - -# **getSdkKeys** -> SdkKeysModel getSdkKeys(configId, environmentId) - -Get SDK Key - -This endpoint returns the SDK Key for your Config in a specified Environment. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.SdkKeysApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - SdkKeysApi apiInstance = new SdkKeysApi(defaultClient); - UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. - UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. - try { - SdkKeysModel result = apiInstance.getSdkKeys(configId, environmentId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling SdkKeysApi#getSdkKeys"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **configId** | **UUID**| The identifier of the Config. | | -| **environmentId** | **UUID**| The identifier of the Environment. | | - -### Return type - -[**SdkKeysModel**](SdkKeysModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - diff --git a/docs/SdkKeysModel.md b/docs/SdkKeysModel.md deleted file mode 100644 index a9700a6..0000000 --- a/docs/SdkKeysModel.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# SdkKeysModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**primary** | **String** | The primary SDK key. | [optional] | -|**secondary** | **String** | The secondary SDK key. | [optional] | - - - diff --git a/docs/SegmentComparator.md b/docs/SegmentComparator.md deleted file mode 100644 index 1649f44..0000000 --- a/docs/SegmentComparator.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# SegmentComparator - -## Enum - - -* `IS_IN` (value: `"isIn"`) - -* `IS_NOT_IN` (value: `"isNotIn"`) - - - diff --git a/docs/SegmentConditionModel.md b/docs/SegmentConditionModel.md deleted file mode 100644 index 4a0a1a2..0000000 --- a/docs/SegmentConditionModel.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# SegmentConditionModel - -Describes a condition that is based on a segment. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**segmentId** | **UUID** | The segment's identifier. | | -|**comparator** | **SegmentComparator** | | | - - - diff --git a/docs/SegmentListModel.md b/docs/SegmentListModel.md deleted file mode 100644 index 874bd4f..0000000 --- a/docs/SegmentListModel.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# SegmentListModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**product** | [**ProductModel**](ProductModel.md) | | [optional] | -|**segmentId** | **UUID** | Identifier of the Segment. | [optional] | -|**name** | **String** | Name of the Segment. | [optional] | -|**description** | **String** | Description of the Segment. | [optional] | -|**creatorEmail** | **String** | The email of the user who created the Segment. | [optional] | -|**creatorFullName** | **String** | The name of the user who created the Segment. | [optional] | -|**createdAt** | **OffsetDateTime** | The date and time when the Segment was created. | [optional] | -|**lastUpdaterEmail** | **String** | The email of the user who last updated the Segment. | [optional] | -|**lastUpdaterFullName** | **String** | The name of the user who last updated the Segment. | [optional] | -|**updatedAt** | **OffsetDateTime** | The date and time when the Segment was last updated. | [optional] | -|**usage** | **Integer** | Determines how many Feature Flags and Settings are using the Segment. | [optional] | - - - diff --git a/docs/SegmentModel.md b/docs/SegmentModel.md deleted file mode 100644 index 687b561..0000000 --- a/docs/SegmentModel.md +++ /dev/null @@ -1,25 +0,0 @@ - - -# SegmentModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**product** | [**ProductModel**](ProductModel.md) | | [optional] | -|**segmentId** | **UUID** | Identifier of the Segment. | [optional] | -|**name** | **String** | Name of the Segment. | [optional] | -|**description** | **String** | Description of the Segment. | [optional] | -|**creatorEmail** | **String** | The email of the user who created the Segment. | [optional] | -|**creatorFullName** | **String** | The name of the user who created the Segment. | [optional] | -|**createdAt** | **OffsetDateTime** | The date and time when the Segment was created. | [optional] | -|**lastUpdaterEmail** | **String** | The email of the user who last updated the Segment. | [optional] | -|**lastUpdaterFullName** | **String** | The name of the user who last updated the Segment. | [optional] | -|**updatedAt** | **OffsetDateTime** | The date and time when the Segment was last updated. | [optional] | -|**comparisonAttribute** | **String** | The user's attribute the evaluation process must take into account. | [optional] | -|**comparator** | **RolloutRuleComparator** | | [optional] | -|**comparisonValue** | **String** | The value to compare with the given user attribute's value. | [optional] | - - - diff --git a/docs/SegmentsApi.md b/docs/SegmentsApi.md deleted file mode 100644 index 5c64623..0000000 --- a/docs/SegmentsApi.md +++ /dev/null @@ -1,371 +0,0 @@ -# SegmentsApi - -All URIs are relative to *https://api.configcat.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**createSegment**](SegmentsApi.md#createSegment) | **POST** /v1/products/{productId}/segments | Create Segment | -| [**deleteSegment**](SegmentsApi.md#deleteSegment) | **DELETE** /v1/segments/{segmentId} | Delete Segment | -| [**getSegment**](SegmentsApi.md#getSegment) | **GET** /v1/segments/{segmentId} | Get Segment | -| [**getSegments**](SegmentsApi.md#getSegments) | **GET** /v1/products/{productId}/segments | List Segments | -| [**updateSegment**](SegmentsApi.md#updateSegment) | **PUT** /v1/segments/{segmentId} | Update Segment | - - - -# **createSegment** -> SegmentModel createSegment(productId, createSegmentModel) - -Create Segment - -This endpoint creates a new Segment in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.SegmentsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - SegmentsApi apiInstance = new SegmentsApi(defaultClient); - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. - CreateSegmentModel createSegmentModel = new CreateSegmentModel(); // CreateSegmentModel | - try { - SegmentModel result = apiInstance.createSegment(productId, createSegmentModel); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling SegmentsApi#createSegment"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **UUID**| The identifier of the Product. | | -| **createSegmentModel** | [**CreateSegmentModel**](CreateSegmentModel.md)| | | - -### Return type - -[**SegmentModel**](SegmentModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **201** | When the creation was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **deleteSegment** -> deleteSegment(segmentId) - -Delete Segment - -This endpoint removes a Segment identified by the `segmentId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.SegmentsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - SegmentsApi apiInstance = new SegmentsApi(defaultClient); - UUID segmentId = UUID.randomUUID(); // UUID | The identifier of the Segment. - try { - apiInstance.deleteSegment(segmentId); - } catch (ApiException e) { - System.err.println("Exception when calling SegmentsApi#deleteSegment"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **segmentId** | **UUID**| The identifier of the Segment. | | - -### Return type - -null (empty response body) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **204** | When the delete was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getSegment** -> SegmentModel getSegment(segmentId) - -Get Segment - -This endpoint returns the metadata of a Segment identified by the `segmentId`. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.SegmentsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - SegmentsApi apiInstance = new SegmentsApi(defaultClient); - UUID segmentId = UUID.randomUUID(); // UUID | The identifier of the Segment. - try { - SegmentModel result = apiInstance.getSegment(segmentId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling SegmentsApi#getSegment"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **segmentId** | **UUID**| The identifier of the Segment. | | - -### Return type - -[**SegmentModel**](SegmentModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When everything is ok, the config data returned. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getSegments** -> List<SegmentListModel> getSegments(productId) - -List Segments - -This endpoint returns the list of the Segments that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.SegmentsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - SegmentsApi apiInstance = new SegmentsApi(defaultClient); - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. - try { - List result = apiInstance.getSegments(productId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling SegmentsApi#getSegments"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **UUID**| The identifier of the Product. | | - -### Return type - -[**List<SegmentListModel>**](SegmentListModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **updateSegment** -> SegmentModel updateSegment(segmentId, updateSegmentModel) - -Update Segment - -This endpoint updates a Segment identified by the `segmentId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.SegmentsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - SegmentsApi apiInstance = new SegmentsApi(defaultClient); - UUID segmentId = UUID.randomUUID(); // UUID | The identifier of the Segment. - UpdateSegmentModel updateSegmentModel = new UpdateSegmentModel(); // UpdateSegmentModel | - try { - SegmentModel result = apiInstance.updateSegment(segmentId, updateSegmentModel); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling SegmentsApi#updateSegment"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **segmentId** | **UUID**| The identifier of the Segment. | | -| **updateSegmentModel** | [**UpdateSegmentModel**](UpdateSegmentModel.md)| | | - -### Return type - -[**SegmentModel**](SegmentModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - diff --git a/docs/SettingDataModel.md b/docs/SettingDataModel.md deleted file mode 100644 index 5fd9050..0000000 --- a/docs/SettingDataModel.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# SettingDataModel - -Metadata of a Feature Flag or Setting. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**settingId** | **Integer** | Identifier of the Feature Flag or Setting. | [optional] | -|**key** | **String** | Key of the Feature Flag or Setting. | [optional] | -|**name** | **String** | Name of the Feature Flag or Setting. | [optional] | -|**hint** | **String** | Description of the Feature Flag or Setting. | [optional] | -|**settingType** | **SettingType** | | [optional] | -|**order** | **Integer** | The order of the Feature Flag or Setting represented on the ConfigCat Dashboard. | [optional] | -|**createdAt** | **OffsetDateTime** | The creation time of the Feature Flag or Setting. | [optional] | -|**creatorEmail** | **String** | The user's email address who created the Feature Flag or Setting. | [optional] | -|**creatorFullName** | **String** | The user's name who created the Feature Flag or Setting. | [optional] | -|**isWatching** | **Boolean** | | [optional] | - - - diff --git a/docs/SettingFormulaModel.md b/docs/SettingFormulaModel.md deleted file mode 100644 index 81c8036..0000000 --- a/docs/SettingFormulaModel.md +++ /dev/null @@ -1,27 +0,0 @@ - - -# SettingFormulaModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**lastVersionId** | **UUID** | | [optional] | -|**defaultValue** | [**ValueModel**](ValueModel.md) | | [optional] | -|**targetingRules** | [**List<TargetingRuleModel>**](TargetingRuleModel.md) | The targeting rules of the Feature Flag or Setting. | [optional] | -|**setting** | [**SettingDataModel**](SettingDataModel.md) | | [optional] | -|**updatedAt** | **OffsetDateTime** | The last updated date and time when the Feature Flag or Setting. | [optional] | -|**percentageEvaluationAttribute** | **String** | The user attribute used for percentage evaluation. If not set, it defaults to the `Identifier` user object attribute. | [optional] | -|**lastUpdaterUserEmail** | **String** | The email of the user who last updated the Feature Flag or Setting. | [optional] | -|**lastUpdaterUserFullName** | **String** | The name of the user who last updated the Feature Flag or Setting. | [optional] | -|**integrationLinks** | [**List<IntegrationLinkModel>**](IntegrationLinkModel.md) | The integration links attached to the Feature Flag or Setting. | [optional] | -|**settingTags** | [**List<SettingTagModel>**](SettingTagModel.md) | The tags attached to the Feature Flag or Setting. | [optional] | -|**settingIdsWherePrerequisite** | **List<Integer>** | List of Feature Flag and Setting IDs where the actual Feature Flag or Setting is prerequisite. | [optional] | -|**config** | [**ConfigModel**](ConfigModel.md) | | [optional] | -|**environment** | [**EnvironmentModel**](EnvironmentModel.md) | | [optional] | -|**readOnly** | **Boolean** | | [optional] | -|**featureFlagLimitations** | [**FeatureFlagLimitations**](FeatureFlagLimitations.md) | | [optional] | - - - diff --git a/docs/SettingModel.md b/docs/SettingModel.md deleted file mode 100644 index 664391a..0000000 --- a/docs/SettingModel.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# SettingModel - -Metadata of a Feature Flag or Setting. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**settingId** | **Integer** | Identifier of the Feature Flag or Setting. | [optional] | -|**key** | **String** | Key of the Feature Flag or Setting. | [optional] | -|**name** | **String** | Name of the Feature Flag or Setting. | [optional] | -|**hint** | **String** | Description of the Feature Flag or Setting. | [optional] | -|**order** | **Integer** | The order of the Feature Flag or Setting represented on the ConfigCat Dashboard. | [optional] | -|**settingType** | **SettingType** | | [optional] | -|**configId** | **UUID** | Identifier of the Feature Flag's Config. | [optional] | -|**configName** | **String** | Name of the Feature Flag's Config. | [optional] | -|**createdAt** | **OffsetDateTime** | The creation time of the Feature Flag or Setting. | [optional] | -|**tags** | [**List<TagModel>**](TagModel.md) | The tags attached to the Feature Flag or Setting. | [optional] | - - - diff --git a/docs/SettingTagModel.md b/docs/SettingTagModel.md deleted file mode 100644 index 95dbd46..0000000 --- a/docs/SettingTagModel.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# SettingTagModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**settingTagId** | **Long** | | [optional] | -|**tagId** | **Long** | | [optional] | -|**name** | **String** | | [optional] | -|**color** | **String** | | [optional] | - - - diff --git a/docs/SettingType.md b/docs/SettingType.md deleted file mode 100644 index 6fa7dff..0000000 --- a/docs/SettingType.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# SettingType - -## Enum - - -* `BOOLEAN` (value: `"boolean"`) - -* `STRING` (value: `"string"`) - -* `INT` (value: `"int"`) - -* `DOUBLE` (value: `"double"`) - - - diff --git a/docs/SettingValueModel.md b/docs/SettingValueModel.md deleted file mode 100644 index 8f3736d..0000000 --- a/docs/SettingValueModel.md +++ /dev/null @@ -1,25 +0,0 @@ - - -# SettingValueModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rolloutRules** | [**List<RolloutRuleModel>**](RolloutRuleModel.md) | The targeting rule collection. | [optional] | -|**rolloutPercentageItems** | [**List<RolloutPercentageItemModel>**](RolloutPercentageItemModel.md) | The percentage rule collection. | [optional] | -|**value** | **Object** | The value to serve. It must respect the setting type. | [optional] | -|**setting** | [**SettingDataModel**](SettingDataModel.md) | | [optional] | -|**updatedAt** | **OffsetDateTime** | The last updated date and time when the Feature Flag or Setting. | [optional] | -|**lastUpdaterUserEmail** | **String** | The email of the user who last updated the Feature Flag or Setting. | [optional] | -|**lastUpdaterUserFullName** | **String** | The name of the user who last updated the Feature Flag or Setting. | [optional] | -|**integrationLinks** | [**List<IntegrationLinkModel>**](IntegrationLinkModel.md) | The integration links attached to the Feature Flag or Setting. | [optional] | -|**settingTags** | [**List<SettingTagModel>**](SettingTagModel.md) | The tags attached to the Feature Flag or Setting. | [optional] | -|**config** | [**ConfigModel**](ConfigModel.md) | | [optional] | -|**environment** | [**EnvironmentModel**](EnvironmentModel.md) | | [optional] | -|**featureFlagLimitations** | [**FeatureFlagLimitations**](FeatureFlagLimitations.md) | | [optional] | -|**readOnly** | **Boolean** | | [optional] | - - - diff --git a/docs/TagModel.md b/docs/TagModel.md deleted file mode 100644 index 6a5764b..0000000 --- a/docs/TagModel.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# TagModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**product** | [**ProductModel**](ProductModel.md) | | [optional] | -|**tagId** | **Long** | Identifier of the Tag. | [optional] | -|**name** | **String** | Name of the Tag. | [optional] | -|**color** | **String** | The configured color of the Tag. | [optional] | - - - diff --git a/docs/TagsApi.md b/docs/TagsApi.md deleted file mode 100644 index 7bca966..0000000 --- a/docs/TagsApi.md +++ /dev/null @@ -1,441 +0,0 @@ -# TagsApi - -All URIs are relative to *https://api.configcat.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**createTag**](TagsApi.md#createTag) | **POST** /v1/products/{productId}/tags | Create Tag | -| [**deleteTag**](TagsApi.md#deleteTag) | **DELETE** /v1/tags/{tagId} | Delete Tag | -| [**getSettingsByTag**](TagsApi.md#getSettingsByTag) | **GET** /v1/tags/{tagId}/settings | List Settings by Tag | -| [**getTag**](TagsApi.md#getTag) | **GET** /v1/tags/{tagId} | Get Tag | -| [**getTags**](TagsApi.md#getTags) | **GET** /v1/products/{productId}/tags | List Tags | -| [**updateTag**](TagsApi.md#updateTag) | **PUT** /v1/tags/{tagId} | Update Tag | - - - -# **createTag** -> TagModel createTag(productId, createTagModel) - -Create Tag - -This endpoint creates a new Tag in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.TagsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - TagsApi apiInstance = new TagsApi(defaultClient); - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Organization. - CreateTagModel createTagModel = new CreateTagModel(); // CreateTagModel | - try { - TagModel result = apiInstance.createTag(productId, createTagModel); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TagsApi#createTag"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **UUID**| The identifier of the Organization. | | -| **createTagModel** | [**CreateTagModel**](CreateTagModel.md)| | | - -### Return type - -[**TagModel**](TagModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **201** | When the creation was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **deleteTag** -> deleteTag(tagId) - -Delete Tag - -This endpoint deletes a Tag identified by the `tagId` parameter. To remove a Tag from a Feature Flag or Setting use the [Update Flag](#operation/update-setting) endpoint. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.TagsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - TagsApi apiInstance = new TagsApi(defaultClient); - Long tagId = 56L; // Long | The identifier of the Tag. - try { - apiInstance.deleteTag(tagId); - } catch (ApiException e) { - System.err.println("Exception when calling TagsApi#deleteTag"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **tagId** | **Long**| The identifier of the Tag. | | - -### Return type - -null (empty response body) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **204** | When the delete was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getSettingsByTag** -> List<SettingModel> getSettingsByTag(tagId) - -List Settings by Tag - -This endpoint returns the list of the Settings that has the specified Tag, identified by the `tagId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.TagsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - TagsApi apiInstance = new TagsApi(defaultClient); - Long tagId = 56L; // Long | The identifier of the Tag. - try { - List result = apiInstance.getSettingsByTag(tagId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TagsApi#getSettingsByTag"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **tagId** | **Long**| The identifier of the Tag. | | - -### Return type - -[**List<SettingModel>**](SettingModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When everything is ok, the settings data returned. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getTag** -> TagModel getTag(tagId) - -Get Tag - -This endpoint returns the metadata of a Tag identified by the `tagId`. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.TagsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - TagsApi apiInstance = new TagsApi(defaultClient); - Long tagId = 56L; // Long | The identifier of the Tag. - try { - TagModel result = apiInstance.getTag(tagId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TagsApi#getTag"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **tagId** | **Long**| The identifier of the Tag. | | - -### Return type - -[**TagModel**](TagModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When everything is ok, the tag data returned. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getTags** -> List<TagModel> getTags(productId) - -List Tags - -This endpoint returns the list of the Tags in a specified Product, identified by the `productId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.TagsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - TagsApi apiInstance = new TagsApi(defaultClient); - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. - try { - List result = apiInstance.getTags(productId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TagsApi#getTags"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **UUID**| The identifier of the Product. | | - -### Return type - -[**List<TagModel>**](TagModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **updateTag** -> TagModel updateTag(tagId, updateTagModel) - -Update Tag - -This endpoint updates a Tag identified by the `tagId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.TagsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - TagsApi apiInstance = new TagsApi(defaultClient); - Long tagId = 56L; // Long | The identifier of the Tag. - UpdateTagModel updateTagModel = new UpdateTagModel(); // UpdateTagModel | - try { - TagModel result = apiInstance.updateTag(tagId, updateTagModel); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TagsApi#updateTag"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **tagId** | **Long**| The identifier of the Tag. | | -| **updateTagModel** | [**UpdateTagModel**](UpdateTagModel.md)| | | - -### Return type - -[**TagModel**](TagModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - diff --git a/docs/TargetingRuleModel.md b/docs/TargetingRuleModel.md deleted file mode 100644 index d26b4a0..0000000 --- a/docs/TargetingRuleModel.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# TargetingRuleModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**conditions** | [**List<ConditionModel>**](ConditionModel.md) | The list of conditions that are combined with logical AND operators. It can be one of the following: - User condition - Segment condition - Prerequisite flag condition | [optional] | -|**percentageOptions** | [**List<PercentageOptionModel>**](PercentageOptionModel.md) | The percentage options from where the evaluation process will choose a value based on the flag's percentage evaluation attribute. | [optional] | -|**value** | [**ValueModel**](ValueModel.md) | | [optional] | - - - diff --git a/docs/UpdateConfigRequest.md b/docs/UpdateConfigRequest.md deleted file mode 100644 index 97dff79..0000000 --- a/docs/UpdateConfigRequest.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# UpdateConfigRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | The name of the Config. | [optional] | -|**description** | **String** | The description of the Config. | [optional] | -|**order** | **Integer** | The order of the Config represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | - - - diff --git a/docs/UpdateEnvironmentModel.md b/docs/UpdateEnvironmentModel.md deleted file mode 100644 index 0628a03..0000000 --- a/docs/UpdateEnvironmentModel.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# UpdateEnvironmentModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | The name of the Environment. | [optional] | -|**color** | **String** | The color of the Environment. RGB or HTML color codes are allowed. | [optional] | -|**description** | **String** | The description of the Environment. | [optional] | -|**order** | **Integer** | The order of the Environment represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | - - - diff --git a/docs/UpdateEvaluationFormulaModel.md b/docs/UpdateEvaluationFormulaModel.md deleted file mode 100644 index 853fa7b..0000000 --- a/docs/UpdateEvaluationFormulaModel.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# UpdateEvaluationFormulaModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**defaultValue** | [**ValueModel**](ValueModel.md) | | | -|**targetingRules** | [**List<TargetingRuleModel>**](TargetingRuleModel.md) | The targeting rules of the Feature Flag or Setting. | [optional] | -|**percentageEvaluationAttribute** | **String** | The user attribute used for percentage evaluation. If not set, it defaults to the `Identifier` user object attribute. | [optional] | - - - diff --git a/docs/UpdateEvaluationFormulaWithIdModel.md b/docs/UpdateEvaluationFormulaWithIdModel.md deleted file mode 100644 index 97353de..0000000 --- a/docs/UpdateEvaluationFormulaWithIdModel.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# UpdateEvaluationFormulaWithIdModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**defaultValue** | [**ValueModel**](ValueModel.md) | | | -|**targetingRules** | [**List<TargetingRuleModel>**](TargetingRuleModel.md) | The targeting rules of the Feature Flag or Setting. | [optional] | -|**percentageEvaluationAttribute** | **String** | The user attribute used for percentage evaluation. If not set, it defaults to the `Identifier` user object attribute. | [optional] | -|**settingId** | **Integer** | The identifier of the feature flag or setting. | [optional] | - - - diff --git a/docs/UpdateEvaluationFormulasModel.md b/docs/UpdateEvaluationFormulasModel.md deleted file mode 100644 index 4cfe0ab..0000000 --- a/docs/UpdateEvaluationFormulasModel.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# UpdateEvaluationFormulasModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**updateFormulas** | [**List<UpdateEvaluationFormulaWithIdModel>**](UpdateEvaluationFormulaWithIdModel.md) | Evaluation descriptors of each updated Feature Flag and Setting. | [optional] | - - - diff --git a/docs/UpdateMemberPermissionsRequest.md b/docs/UpdateMemberPermissionsRequest.md deleted file mode 100644 index 07ce20a..0000000 --- a/docs/UpdateMemberPermissionsRequest.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# UpdateMemberPermissionsRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**permissionGroupIds** | **List<Long>** | List of Permission Group identifiers to where the Member should be added. | [optional] | -|**isAdmin** | **Boolean** | Indicates that the member must be Organization Admin. | [optional] | -|**isBillingManager** | **Boolean** | Indicates that the member must be Billing Manager. | [optional] | -|**removeFromPermissionGroupsWhereIdNotSet** | **Boolean** | When `true`, the member will be removed from those Permission Groups that are not listed in the `permissionGroupIds` field. | [optional] | - - - diff --git a/docs/UpdatePermissionGroupRequest.md b/docs/UpdatePermissionGroupRequest.md deleted file mode 100644 index 2d40ebf..0000000 --- a/docs/UpdatePermissionGroupRequest.md +++ /dev/null @@ -1,37 +0,0 @@ - - -# UpdatePermissionGroupRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | Name of the Permission Group. | [optional] | -|**canManageMembers** | **Boolean** | Group members can manage team members. | [optional] | -|**canCreateOrUpdateConfig** | **Boolean** | Group members can create/update Configs. | [optional] | -|**canDeleteConfig** | **Boolean** | Group members can delete Configs. | [optional] | -|**canCreateOrUpdateEnvironment** | **Boolean** | Group members can create/update Environments. | [optional] | -|**canDeleteEnvironment** | **Boolean** | Group members can delete Environments. | [optional] | -|**canCreateOrUpdateSetting** | **Boolean** | Group members can create/update Feature Flags and Settings. | [optional] | -|**canTagSetting** | **Boolean** | Group members can attach/detach Tags to Feature Flags and Settings. | [optional] | -|**canDeleteSetting** | **Boolean** | Group members can delete Feature Flags and Settings. | [optional] | -|**canCreateOrUpdateTag** | **Boolean** | Group members can create/update Tags. | [optional] | -|**canDeleteTag** | **Boolean** | Group members can delete Tags. | [optional] | -|**canManageWebhook** | **Boolean** | Group members can create/update/delete Webhooks. | [optional] | -|**canUseExportImport** | **Boolean** | Group members can use the export/import feature. | [optional] | -|**canManageProductPreferences** | **Boolean** | Group members can update Product preferences. | [optional] | -|**canManageIntegrations** | **Boolean** | Group members can add and configure integrations. | [optional] | -|**canViewSdkKey** | **Boolean** | Group members has access to SDK keys. | [optional] | -|**canRotateSdkKey** | **Boolean** | Group members can rotate SDK keys. | [optional] | -|**canCreateOrUpdateSegments** | **Boolean** | Group members can create/update Segments. | [optional] | -|**canDeleteSegments** | **Boolean** | Group members can delete Segments. | [optional] | -|**canViewProductAuditLog** | **Boolean** | Group members has access to audit logs. | [optional] | -|**canViewProductStatistics** | **Boolean** | Group members has access to product statistics. | [optional] | -|**canDisable2FA** | **Boolean** | Group members can disable two-factor authentication for other members. | [optional] | -|**accessType** | **AccessType** | | [optional] | -|**newEnvironmentAccessType** | **EnvironmentAccessType** | | [optional] | -|**environmentAccesses** | [**List<CreateOrUpdateEnvironmentAccessModel>**](CreateOrUpdateEnvironmentAccessModel.md) | List of environment specific permissions. | [optional] | - - - diff --git a/docs/UpdatePreferencesRequest.md b/docs/UpdatePreferencesRequest.md deleted file mode 100644 index 60ca221..0000000 --- a/docs/UpdatePreferencesRequest.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# UpdatePreferencesRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**reasonRequired** | **Boolean** | Indicates that a mandatory note is required for saving and publishing. | [optional] | -|**keyGenerationMode** | **KeyGenerationMode** | | [optional] | -|**showVariationId** | **Boolean** | Indicates whether a variation ID's must be shown on the ConfigCat Dashboard. | [optional] | -|**mandatorySettingHint** | **Boolean** | Indicates whether Feature flags and Settings must have a hint. | [optional] | -|**reasonRequiredEnvironments** | [**List<UpdateReasonRequiredEnvironmentModel>**](UpdateReasonRequiredEnvironmentModel.md) | List of Environments where mandatory note must be set before saving and publishing. | [optional] | - - - diff --git a/docs/UpdateProductRequest.md b/docs/UpdateProductRequest.md deleted file mode 100644 index 27326a7..0000000 --- a/docs/UpdateProductRequest.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# UpdateProductRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | The name of the Product. | [optional] | -|**description** | **String** | The description of the Product. | [optional] | -|**order** | **Integer** | The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | - - - diff --git a/docs/UpdateReasonRequiredEnvironmentModel.md b/docs/UpdateReasonRequiredEnvironmentModel.md deleted file mode 100644 index f28450d..0000000 --- a/docs/UpdateReasonRequiredEnvironmentModel.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# UpdateReasonRequiredEnvironmentModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**environmentId** | **UUID** | Identifier of the Environment. | [optional] | -|**reasonRequired** | **Boolean** | Indicates that a mandatory note is required in this Environment for saving and publishing. | [optional] | - - - diff --git a/docs/UpdateSegmentModel.md b/docs/UpdateSegmentModel.md deleted file mode 100644 index a5e0f9c..0000000 --- a/docs/UpdateSegmentModel.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# UpdateSegmentModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | | [optional] | -|**description** | **String** | | [optional] | -|**comparisonAttribute** | **String** | | [optional] | -|**comparator** | **RolloutRuleComparator** | | [optional] | -|**comparisonValue** | **String** | | [optional] | - - - diff --git a/docs/UpdateSettingValueModel.md b/docs/UpdateSettingValueModel.md deleted file mode 100644 index 1f70ab1..0000000 --- a/docs/UpdateSettingValueModel.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# UpdateSettingValueModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rolloutRules** | [**List<RolloutRuleModel>**](RolloutRuleModel.md) | The targeting rule collection. | [optional] | -|**rolloutPercentageItems** | [**List<RolloutPercentageItemModel>**](RolloutPercentageItemModel.md) | The percentage rule collection. | [optional] | -|**value** | **Object** | The value to serve. It must respect the setting type. | [optional] | - - - diff --git a/docs/UpdateSettingValueWithSettingIdModel.md b/docs/UpdateSettingValueWithSettingIdModel.md deleted file mode 100644 index 9915b44..0000000 --- a/docs/UpdateSettingValueWithSettingIdModel.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# UpdateSettingValueWithSettingIdModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rolloutRules** | [**List<RolloutRuleModel>**](RolloutRuleModel.md) | The targeting rule collection. | [optional] | -|**rolloutPercentageItems** | [**List<RolloutPercentageItemModel>**](RolloutPercentageItemModel.md) | The percentage rule collection. | [optional] | -|**value** | **Object** | The value to serve. It must respect the setting type. | [optional] | -|**settingId** | **Integer** | The id of the Setting. | [optional] | - - - diff --git a/docs/UpdateSettingValuesWithIdModel.md b/docs/UpdateSettingValuesWithIdModel.md deleted file mode 100644 index 80eefbd..0000000 --- a/docs/UpdateSettingValuesWithIdModel.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# UpdateSettingValuesWithIdModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**settingValues** | [**List<UpdateSettingValueWithSettingIdModel>**](UpdateSettingValueWithSettingIdModel.md) | The values to update. | [optional] | - - - diff --git a/docs/UpdateTagModel.md b/docs/UpdateTagModel.md deleted file mode 100644 index cdecff6..0000000 --- a/docs/UpdateTagModel.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# UpdateTagModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | Name of the Tag. | [optional] | -|**color** | **String** | Color of the Tag. Possible values: `panther`, `whale`, `salmon`, `lizard`, `canary`, `koala`, or any HTML color code. | [optional] | - - - diff --git a/docs/UserComparator.md b/docs/UserComparator.md deleted file mode 100644 index 05289e2..0000000 --- a/docs/UserComparator.md +++ /dev/null @@ -1,81 +0,0 @@ - - -# UserComparator - -## Enum - - -* `IS_ONE_OF` (value: `"isOneOf"`) - -* `IS_NOT_ONE_OF` (value: `"isNotOneOf"`) - -* `CONTAINS_ANY_OF` (value: `"containsAnyOf"`) - -* `DOES_NOT_CONTAIN_ANY_OF` (value: `"doesNotContainAnyOf"`) - -* `SEM_VER_IS_ONE_OF` (value: `"semVerIsOneOf"`) - -* `SEM_VER_IS_NOT_ONE_OF` (value: `"semVerIsNotOneOf"`) - -* `SEM_VER_LESS` (value: `"semVerLess"`) - -* `SEM_VER_LESS_OR_EQUALS` (value: `"semVerLessOrEquals"`) - -* `SEM_VER_GREATER` (value: `"semVerGreater"`) - -* `SEM_VER_GREATER_OR_EQUALS` (value: `"semVerGreaterOrEquals"`) - -* `NUMBER_EQUALS` (value: `"numberEquals"`) - -* `NUMBER_DOES_NOT_EQUAL` (value: `"numberDoesNotEqual"`) - -* `NUMBER_LESS` (value: `"numberLess"`) - -* `NUMBER_LESS_OR_EQUALS` (value: `"numberLessOrEquals"`) - -* `NUMBER_GREATER` (value: `"numberGreater"`) - -* `NUMBER_GREATER_OR_EQUALS` (value: `"numberGreaterOrEquals"`) - -* `SENSITIVE_IS_ONE_OF` (value: `"sensitiveIsOneOf"`) - -* `SENSITIVE_IS_NOT_ONE_OF` (value: `"sensitiveIsNotOneOf"`) - -* `DATE_TIME_BEFORE` (value: `"dateTimeBefore"`) - -* `DATE_TIME_AFTER` (value: `"dateTimeAfter"`) - -* `SENSITIVE_TEXT_EQUALS` (value: `"sensitiveTextEquals"`) - -* `SENSITIVE_TEXT_DOES_NOT_EQUAL` (value: `"sensitiveTextDoesNotEqual"`) - -* `SENSITIVE_TEXT_STARTS_WITH_ANY_OF` (value: `"sensitiveTextStartsWithAnyOf"`) - -* `SENSITIVE_TEXT_NOT_STARTS_WITH_ANY_OF` (value: `"sensitiveTextNotStartsWithAnyOf"`) - -* `SENSITIVE_TEXT_ENDS_WITH_ANY_OF` (value: `"sensitiveTextEndsWithAnyOf"`) - -* `SENSITIVE_TEXT_NOT_ENDS_WITH_ANY_OF` (value: `"sensitiveTextNotEndsWithAnyOf"`) - -* `SENSITIVE_ARRAY_CONTAINS_ANY_OF` (value: `"sensitiveArrayContainsAnyOf"`) - -* `SENSITIVE_ARRAY_DOES_NOT_CONTAIN_ANY_OF` (value: `"sensitiveArrayDoesNotContainAnyOf"`) - -* `TEXT_EQUALS` (value: `"textEquals"`) - -* `TEXT_DOES_NOT_EQUAL` (value: `"textDoesNotEqual"`) - -* `TEXT_STARTS_WITH_ANY_OF` (value: `"textStartsWithAnyOf"`) - -* `TEXT_NOT_STARTS_WITH_ANY_OF` (value: `"textNotStartsWithAnyOf"`) - -* `TEXT_ENDS_WITH_ANY_OF` (value: `"textEndsWithAnyOf"`) - -* `TEXT_NOT_ENDS_WITH_ANY_OF` (value: `"textNotEndsWithAnyOf"`) - -* `ARRAY_CONTAINS_ANY_OF` (value: `"arrayContainsAnyOf"`) - -* `ARRAY_DOES_NOT_CONTAIN_ANY_OF` (value: `"arrayDoesNotContainAnyOf"`) - - - diff --git a/docs/UserConditionModel.md b/docs/UserConditionModel.md deleted file mode 100644 index 4ae7a53..0000000 --- a/docs/UserConditionModel.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# UserConditionModel - -Describes a condition that is based on user attributes. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**comparisonAttribute** | **String** | The User Object attribute that the condition is based on. Can be \"User ID\", \"Email\", \"Country\" or any custom attribute. | | -|**comparator** | **UserComparator** | | | -|**comparisonValue** | [**ComparisonValueModel**](ComparisonValueModel.md) | | | - - - diff --git a/docs/UserModel.md b/docs/UserModel.md deleted file mode 100644 index 9783892..0000000 --- a/docs/UserModel.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# UserModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**userId** | **String** | Identifier of the Member. | [optional] | -|**fullName** | **String** | Name of the Member. | [optional] | -|**email** | **String** | Email of the Member. | [optional] | -|**twoFactorEnabled** | **Boolean** | Determines whether 2FA is enabled for the Member. | [optional] | - - - diff --git a/docs/ValueModel.md b/docs/ValueModel.md deleted file mode 100644 index 775dcd4..0000000 --- a/docs/ValueModel.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# ValueModel - -Represents the value of a Feature Flag or Setting. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**boolValue** | **Boolean** | The served value in case of a boolean Feature Flag. | [optional] | -|**stringValue** | **String** | The served value in case of a text Setting. | [optional] | -|**intValue** | **Integer** | The served value in case of a whole number Setting. | [optional] | -|**doubleValue** | **Double** | The served value in case of a decimal number Setting. | [optional] | - - - diff --git a/docs/WebHookHttpMethod.md b/docs/WebHookHttpMethod.md deleted file mode 100644 index 07d3160..0000000 --- a/docs/WebHookHttpMethod.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# WebHookHttpMethod - -## Enum - - -* `GET` (value: `"get"`) - -* `POST` (value: `"post"`) - - - diff --git a/docs/WebHookRequest.md b/docs/WebHookRequest.md deleted file mode 100644 index 7591a3c..0000000 --- a/docs/WebHookRequest.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# WebHookRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**url** | **String** | The URL of the Webhook. | | -|**content** | **String** | The HTTP body content. | [optional] | -|**httpMethod** | **WebHookHttpMethod** | | [optional] | -|**webHookHeaders** | [**List<WebhookHeaderModel>**](WebhookHeaderModel.md) | List of HTTP headers. | [optional] | - - - diff --git a/docs/WebhookConfig.md b/docs/WebhookConfig.md deleted file mode 100644 index 04150ea..0000000 --- a/docs/WebhookConfig.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# WebhookConfig - -The Config where the applied changes will invoke the Webhook. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | The Config's name. | [optional] | -|**configId** | **UUID** | The Config's identifier. | [optional] | - - - diff --git a/docs/WebhookEnvironment.md b/docs/WebhookEnvironment.md deleted file mode 100644 index 1101752..0000000 --- a/docs/WebhookEnvironment.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# WebhookEnvironment - -The Environment where the applied changes will invoke the Webhook. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | The Environment's name. | [optional] | -|**environmentId** | **UUID** | The Environment's identifier. | [optional] | - - - diff --git a/docs/WebhookHeaderModel.md b/docs/WebhookHeaderModel.md deleted file mode 100644 index a9ea39d..0000000 --- a/docs/WebhookHeaderModel.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# WebhookHeaderModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**key** | **String** | The HTTP header key. | | -|**value** | **String** | The HTTP header value. | | -|**isSecure** | **Boolean** | Indicates whether the header value is sensitive. | [optional] | - - - diff --git a/docs/WebhookModel.md b/docs/WebhookModel.md deleted file mode 100644 index 8a83ee0..0000000 --- a/docs/WebhookModel.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# WebhookModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**webhookId** | **Integer** | The identifier of the Webhook. | [optional] | -|**url** | **String** | The URL of the Webhook. | [optional] | -|**httpMethod** | **WebHookHttpMethod** | | [optional] | -|**content** | **String** | The HTTP body content. | [optional] | -|**webHookHeaders** | [**List<WebhookHeaderModel>**](WebhookHeaderModel.md) | List of HTTP headers that the Webhook must send. | [optional] | -|**config** | [**WebhookConfig**](WebhookConfig.md) | | [optional] | -|**environment** | [**WebhookEnvironment**](WebhookEnvironment.md) | | [optional] | - - - diff --git a/docs/WebhookSigningKeysModel.md b/docs/WebhookSigningKeysModel.md deleted file mode 100644 index eb56f9c..0000000 --- a/docs/WebhookSigningKeysModel.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# WebhookSigningKeysModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**key1** | **String** | The first signing key. | [optional] | -|**key2** | **String** | The second signing key. | [optional] | - - - diff --git a/docs/WebhooksApi.md b/docs/WebhooksApi.md deleted file mode 100644 index 8373df2..0000000 --- a/docs/WebhooksApi.md +++ /dev/null @@ -1,517 +0,0 @@ -# WebhooksApi - -All URIs are relative to *https://api.configcat.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**createWebhook**](WebhooksApi.md#createWebhook) | **POST** /v1/configs/{configId}/environments/{environmentId}/webhooks | Create Webhook | -| [**deleteWebhook**](WebhooksApi.md#deleteWebhook) | **DELETE** /v1/webhooks/{webhookId} | Delete Webhook | -| [**getWebhook**](WebhooksApi.md#getWebhook) | **GET** /v1/webhooks/{webhookId} | Get Webhook | -| [**getWebhookSigningKeys**](WebhooksApi.md#getWebhookSigningKeys) | **GET** /v1/webhooks/{webhookId}/keys | Get Webhook Signing Keys | -| [**getWebhooks**](WebhooksApi.md#getWebhooks) | **GET** /v1/products/{productId}/webhooks | List Webhooks | -| [**replaceWebhook**](WebhooksApi.md#replaceWebhook) | **PUT** /v1/webhooks/{webhookId} | Replace Webhook | -| [**updateWebhook**](WebhooksApi.md#updateWebhook) | **PATCH** /v1/webhooks/{webhookId} | Update Webhook | - - - -# **createWebhook** -> WebhookModel createWebhook(configId, environmentId, webHookRequest) - -Create Webhook - -This endpoint creates a new Webhook in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.WebhooksApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - WebhooksApi apiInstance = new WebhooksApi(defaultClient); - UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. - UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. - WebHookRequest webHookRequest = new WebHookRequest(); // WebHookRequest | - try { - WebhookModel result = apiInstance.createWebhook(configId, environmentId, webHookRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebhooksApi#createWebhook"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **configId** | **UUID**| The identifier of the Config. | | -| **environmentId** | **UUID**| The identifier of the Environment. | | -| **webHookRequest** | [**WebHookRequest**](WebHookRequest.md)| | | - -### Return type - -[**WebhookModel**](WebhookModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **201** | When the creation was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **deleteWebhook** -> deleteWebhook(webhookId) - -Delete Webhook - -This endpoint removes a Webhook identified by the `webhookId` parameter. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.WebhooksApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - WebhooksApi apiInstance = new WebhooksApi(defaultClient); - Integer webhookId = 56; // Integer | The identifier of the Webhook. - try { - apiInstance.deleteWebhook(webhookId); - } catch (ApiException e) { - System.err.println("Exception when calling WebhooksApi#deleteWebhook"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **webhookId** | **Integer**| The identifier of the Webhook. | | - -### Return type - -null (empty response body) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **204** | When the delete was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getWebhook** -> WebhookModel getWebhook(webhookId) - -Get Webhook - -This endpoint returns the metadata of a Webhook identified by the `webhookId`. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.WebhooksApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - WebhooksApi apiInstance = new WebhooksApi(defaultClient); - Integer webhookId = 56; // Integer | The identifier of the Webhook. - try { - WebhookModel result = apiInstance.getWebhook(webhookId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebhooksApi#getWebhook"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **webhookId** | **Integer**| The identifier of the Webhook. | | - -### Return type - -[**WebhookModel**](WebhookModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When everything is ok, the webhook data is returned. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getWebhookSigningKeys** -> WebhookSigningKeysModel getWebhookSigningKeys(webhookId) - -Get Webhook Signing Keys - -This endpoint returns the signing keys of a Webhook identified by the `webhookId`. Signing keys are used for ensuring the Webhook requests you receive are actually sent by ConfigCat. <a href=\"https://configcat.com/docs/advanced/notifications-webhooks/#verifying-webhook-requests\" target=\"_blank\" rel=\"noopener noreferrer\">Here</a> you can read more about Webhook request verification. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.WebhooksApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - WebhooksApi apiInstance = new WebhooksApi(defaultClient); - Integer webhookId = 56; // Integer | The identifier of the Webhook. - try { - WebhookSigningKeysModel result = apiInstance.getWebhookSigningKeys(webhookId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebhooksApi#getWebhookSigningKeys"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **webhookId** | **Integer**| The identifier of the Webhook. | | - -### Return type - -[**WebhookSigningKeysModel**](WebhookSigningKeysModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When everything is ok, the webhook signing keys are returned. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **getWebhooks** -> List<WebhookModel> getWebhooks(productId) - -List Webhooks - -This endpoint returns the list of the Webhooks that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.WebhooksApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - WebhooksApi apiInstance = new WebhooksApi(defaultClient); - UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. - try { - List result = apiInstance.getWebhooks(productId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebhooksApi#getWebhooks"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **UUID**| The identifier of the Product. | | - -### Return type - -[**List<WebhookModel>**](WebhookModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **replaceWebhook** -> WebhookModel replaceWebhook(webhookId, webHookRequest) - -Replace Webhook - -This endpoint replaces the whole value of a Webhook identified by the `webhookId` parameter. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.WebhooksApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - WebhooksApi apiInstance = new WebhooksApi(defaultClient); - Integer webhookId = 56; // Integer | The identifier of the Webhook. - WebHookRequest webHookRequest = new WebHookRequest(); // WebHookRequest | - try { - WebhookModel result = apiInstance.replaceWebhook(webhookId, webHookRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebhooksApi#replaceWebhook"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **webhookId** | **Integer**| The identifier of the Webhook. | | -| **webHookRequest** | [**WebHookRequest**](WebHookRequest.md)| | | - -### Return type - -[**WebhookModel**](WebhookModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When the replace was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - - -# **updateWebhook** -> WebhookModel updateWebhook(webhookId, jsonPatchOperation) - -Update Webhook - -This endpoint updates a Webhook identified by the `webhookId` parameter with a collection of [JSON Patch](https://jsonpatch.com) operations. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. For example: We have the following resource. ```json { \"webhookId\": 6, \"url\": \"https://example.com/hook\", \"httpMethod\": \"post\", \"content\": \"null\", \"webHookHeaders\": [] } ``` If we send an update request body as below (it changes the `content` field and adds a new HTTP header): ```json [ { \"op\": \"replace\", \"path\": \"/content\", \"value\": \"Some webhook content.\" }, { \"op\": \"add\", \"path\": \"/webHookHeaders/-\", \"value\": { \"key\": \"X-Custom-Header\", \"value\": \"Custom header value\" } } ] ``` Only the `content` and `webHookHeaders` are updated and all the other attributes remain unchanged. So we get a response like this: ```json { \"webhookId\": 6, \"url\": \"https://example.com/hook\", \"httpMethod\": \"post\", \"content\": \"Some webhook content.\", \"webHookHeaders\": [ { \"key\": \"X-Custom-Header\", \"value\": \"Custom header value\", \"isSecure\": false } ] } ``` - -### Example -```java -// Import classes: -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.auth.*; -import com.configcat.publicapi.java.client.models.*; -import com.configcat.publicapi.java.client.api.WebhooksApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.configcat.com"); - - // Configure HTTP basic authorization: Basic - HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); - Basic.setUsername("YOUR USERNAME"); - Basic.setPassword("YOUR PASSWORD"); - - WebhooksApi apiInstance = new WebhooksApi(defaultClient); - Integer webhookId = 56; // Integer | The identifier of the Webhook. - List jsonPatchOperation = Arrays.asList(); // List | - try { - WebhookModel result = apiInstance.updateWebhook(webhookId, jsonPatchOperation); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebhooksApi#updateWebhook"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **webhookId** | **Integer**| The identifier of the Webhook. | | -| **jsonPatchOperation** | [**List<JsonPatchOperation>**](JsonPatchOperation.md)| | | - -### Return type - -[**WebhookModel**](WebhookModel.md) - -### Authorization - -[Basic](../README.md#Basic) - -### HTTP request headers - - - **Content-Type**: application/json, text/json, application/*+json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | When the update was successful. | - | -| **400** | Bad request. | - | -| **404** | Not found. | - | -| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | - diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml deleted file mode 100644 index f38cedc..0000000 --- a/src/main/AndroidManifest.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/main/java/com/configcat/publicapi/java/client/ApiCallback.java b/src/main/java/com/configcat/publicapi/java/client/ApiCallback.java deleted file mode 100644 index 244fd5b..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/ApiCallback.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client; - -import java.io.IOException; - -import java.util.Map; -import java.util.List; - -/** - * Callback for asynchronous API call. - * - * @param The return type - */ -public interface ApiCallback { - /** - * This is called when the API call fails. - * - * @param e The exception causing the failure - * @param statusCode Status code of the response if available, otherwise it would be 0 - * @param responseHeaders Headers of the response if available, otherwise it would be null - */ - void onFailure(ApiException e, int statusCode, Map> responseHeaders); - - /** - * This is called when the API call succeeded. - * - * @param result The result deserialized from response - * @param statusCode Status code of the response - * @param responseHeaders Headers of the response - */ - void onSuccess(T result, int statusCode, Map> responseHeaders); - - /** - * This is called when the API upload processing. - * - * @param bytesWritten bytes Written - * @param contentLength content length of request body - * @param done write end - */ - void onUploadProgress(long bytesWritten, long contentLength, boolean done); - - /** - * This is called when the API download processing. - * - * @param bytesRead bytes Read - * @param contentLength content length of the response - * @param done Read end - */ - void onDownloadProgress(long bytesRead, long contentLength, boolean done); -} diff --git a/src/main/java/com/configcat/publicapi/java/client/ApiClient.java b/src/main/java/com/configcat/publicapi/java/client/ApiClient.java deleted file mode 100644 index d5fee4b..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/ApiClient.java +++ /dev/null @@ -1,1566 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client; - -import okhttp3.*; -import okhttp3.internal.http.HttpMethod; -import okhttp3.internal.tls.OkHostnameVerifier; -import okhttp3.logging.HttpLoggingInterceptor; -import okhttp3.logging.HttpLoggingInterceptor.Level; -import okio.Buffer; -import okio.BufferedSink; -import okio.Okio; - -import javax.net.ssl.*; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.lang.reflect.Type; -import java.net.URI; -import java.net.URLConnection; -import java.net.URLEncoder; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.security.GeneralSecurityException; -import java.security.KeyStore; -import java.security.SecureRandom; -import java.security.cert.Certificate; -import java.security.cert.CertificateException; -import java.security.cert.CertificateFactory; -import java.security.cert.X509Certificate; -import java.text.DateFormat; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.TimeUnit; -import java.util.function.Supplier; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import com.configcat.publicapi.java.client.auth.Authentication; -import com.configcat.publicapi.java.client.auth.HttpBasicAuth; -import com.configcat.publicapi.java.client.auth.HttpBearerAuth; -import com.configcat.publicapi.java.client.auth.ApiKeyAuth; - -/** - *

ApiClient class.

- */ -public class ApiClient { - - private String basePath = "https://api.configcat.com"; - protected List servers = new ArrayList(Arrays.asList( - new ServerConfiguration( - "https://api.configcat.com", - "No description provided", - new HashMap() - ) - )); - protected Integer serverIndex = 0; - protected Map serverVariables = null; - private boolean debugging = false; - private Map defaultHeaderMap = new HashMap(); - private Map defaultCookieMap = new HashMap(); - private String tempFolderPath = null; - - private Map authentications; - - private DateFormat dateFormat; - private DateFormat datetimeFormat; - private boolean lenientDatetimeFormat; - private int dateLength; - - private InputStream sslCaCert; - private boolean verifyingSsl; - private KeyManager[] keyManagers; - - private OkHttpClient httpClient; - private JSON json; - - private HttpLoggingInterceptor loggingInterceptor; - - /** - * Basic constructor for ApiClient - */ - public ApiClient() { - init(); - initHttpClient(); - - // Setup authentications (key: authentication name, value: authentication). - authentications.put("Basic", new HttpBasicAuth()); - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - /** - * Basic constructor with custom OkHttpClient - * - * @param client a {@link okhttp3.OkHttpClient} object - */ - public ApiClient(OkHttpClient client) { - init(); - - httpClient = client; - - // Setup authentications (key: authentication name, value: authentication). - authentications.put("Basic", new HttpBasicAuth()); - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - private void initHttpClient() { - initHttpClient(Collections.emptyList()); - } - - private void initHttpClient(List interceptors) { - OkHttpClient.Builder builder = new OkHttpClient.Builder(); - builder.addNetworkInterceptor(getProgressInterceptor()); - for (Interceptor interceptor: interceptors) { - builder.addInterceptor(interceptor); - } - - httpClient = builder.build(); - } - - private void init() { - verifyingSsl = true; - - json = new JSON(); - - // Set default User-Agent. - setUserAgent("OpenAPI-Generator/v1/java"); - - authentications = new HashMap(); - } - - /** - * Get base path - * - * @return Base path - */ - public String getBasePath() { - return basePath; - } - - /** - * Set base path - * - * @param basePath Base path of the URL (e.g https://api.configcat.com - * @return An instance of OkHttpClient - */ - public ApiClient setBasePath(String basePath) { - this.basePath = basePath; - this.serverIndex = null; - return this; - } - - public List getServers() { - return servers; - } - - public ApiClient setServers(List servers) { - this.servers = servers; - return this; - } - - public Integer getServerIndex() { - return serverIndex; - } - - public ApiClient setServerIndex(Integer serverIndex) { - this.serverIndex = serverIndex; - return this; - } - - public Map getServerVariables() { - return serverVariables; - } - - public ApiClient setServerVariables(Map serverVariables) { - this.serverVariables = serverVariables; - return this; - } - - /** - * Get HTTP client - * - * @return An instance of OkHttpClient - */ - public OkHttpClient getHttpClient() { - return httpClient; - } - - /** - * Set HTTP client, which must never be null. - * - * @param newHttpClient An instance of OkHttpClient - * @return Api Client - * @throws java.lang.NullPointerException when newHttpClient is null - */ - public ApiClient setHttpClient(OkHttpClient newHttpClient) { - this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); - return this; - } - - /** - * Get JSON - * - * @return JSON object - */ - public JSON getJSON() { - return json; - } - - /** - * Set JSON - * - * @param json JSON object - * @return Api client - */ - public ApiClient setJSON(JSON json) { - this.json = json; - return this; - } - - /** - * True if isVerifyingSsl flag is on - * - * @return True if isVerifySsl flag is on - */ - public boolean isVerifyingSsl() { - return verifyingSsl; - } - - /** - * Configure whether to verify certificate and hostname when making https requests. - * Default to true. - * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. - * - * @param verifyingSsl True to verify TLS/SSL connection - * @return ApiClient - */ - public ApiClient setVerifyingSsl(boolean verifyingSsl) { - this.verifyingSsl = verifyingSsl; - applySslSettings(); - return this; - } - - /** - * Get SSL CA cert. - * - * @return Input stream to the SSL CA cert - */ - public InputStream getSslCaCert() { - return sslCaCert; - } - - /** - * Configure the CA certificate to be trusted when making https requests. - * Use null to reset to default. - * - * @param sslCaCert input stream for SSL CA cert - * @return ApiClient - */ - public ApiClient setSslCaCert(InputStream sslCaCert) { - this.sslCaCert = sslCaCert; - applySslSettings(); - return this; - } - - /** - *

Getter for the field keyManagers.

- * - * @return an array of {@link javax.net.ssl.KeyManager} objects - */ - public KeyManager[] getKeyManagers() { - return keyManagers; - } - - /** - * Configure client keys to use for authorization in an SSL session. - * Use null to reset to default. - * - * @param managers The KeyManagers to use - * @return ApiClient - */ - public ApiClient setKeyManagers(KeyManager[] managers) { - this.keyManagers = managers; - applySslSettings(); - return this; - } - - /** - *

Getter for the field dateFormat.

- * - * @return a {@link java.text.DateFormat} object - */ - public DateFormat getDateFormat() { - return dateFormat; - } - - /** - *

Setter for the field dateFormat.

- * - * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link com.configcat.publicapi.java.client.ApiClient} object - */ - public ApiClient setDateFormat(DateFormat dateFormat) { - JSON.setDateFormat(dateFormat); - return this; - } - - /** - *

Set SqlDateFormat.

- * - * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link com.configcat.publicapi.java.client.ApiClient} object - */ - public ApiClient setSqlDateFormat(DateFormat dateFormat) { - JSON.setSqlDateFormat(dateFormat); - return this; - } - - /** - *

Set OffsetDateTimeFormat.

- * - * @param dateFormat a {@link java.time.format.DateTimeFormatter} object - * @return a {@link com.configcat.publicapi.java.client.ApiClient} object - */ - public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - JSON.setOffsetDateTimeFormat(dateFormat); - return this; - } - - /** - *

Set LocalDateFormat.

- * - * @param dateFormat a {@link java.time.format.DateTimeFormatter} object - * @return a {@link com.configcat.publicapi.java.client.ApiClient} object - */ - public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - JSON.setLocalDateFormat(dateFormat); - return this; - } - - /** - *

Set LenientOnJson.

- * - * @param lenientOnJson a boolean - * @return a {@link com.configcat.publicapi.java.client.ApiClient} object - */ - public ApiClient setLenientOnJson(boolean lenientOnJson) { - JSON.setLenientOnJson(lenientOnJson); - return this; - } - - /** - * Get authentications (key: authentication name, value: authentication). - * - * @return Map of authentication objects - */ - public Map getAuthentications() { - return authentications; - } - - /** - * Get authentication for the given name. - * - * @param authName The authentication name - * @return The authentication, null if not found - */ - public Authentication getAuthentication(String authName) { - return authentications.get(authName); - } - - - /** - * Helper method to set username for the first HTTP basic authentication. - * - * @param username Username - */ - public void setUsername(String username) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setUsername(username); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Helper method to set password for the first HTTP basic authentication. - * - * @param password Password - */ - public void setPassword(String password) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setPassword(password); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Helper method to set API key value for the first API key authentication. - * - * @param apiKey API key - */ - public void setApiKey(String apiKey) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKey(apiKey); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set API key prefix for the first API key authentication. - * - * @param apiKeyPrefix API key prefix - */ - public void setApiKeyPrefix(String apiKeyPrefix) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set access token for the first OAuth2 authentication. - * - * @param accessToken Access token - */ - public void setAccessToken(String accessToken) { - throw new RuntimeException("No OAuth2 authentication configured!"); - } - - /** - * Helper method to set credentials for AWSV4 Signature - * - * @param accessKey Access Key - * @param secretKey Secret Key - * @param region Region - * @param service Service to access to - */ - public void setAWS4Configuration(String accessKey, String secretKey, String region, String service) { - throw new RuntimeException("No AWS4 authentication configured!"); - } - - /** - * Helper method to set credentials for AWSV4 Signature - * - * @param accessKey Access Key - * @param secretKey Secret Key - * @param sessionToken Session Token - * @param region Region - * @param service Service to access to - */ - public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) { - throw new RuntimeException("No AWS4 authentication configured!"); - } - - /** - * Set the User-Agent header's value (by adding to the default header map). - * - * @param userAgent HTTP request's user agent - * @return ApiClient - */ - public ApiClient setUserAgent(String userAgent) { - addDefaultHeader("User-Agent", userAgent); - return this; - } - - /** - * Add a default header. - * - * @param key The header's key - * @param value The header's value - * @return ApiClient - */ - public ApiClient addDefaultHeader(String key, String value) { - defaultHeaderMap.put(key, value); - return this; - } - - /** - * Add a default cookie. - * - * @param key The cookie's key - * @param value The cookie's value - * @return ApiClient - */ - public ApiClient addDefaultCookie(String key, String value) { - defaultCookieMap.put(key, value); - return this; - } - - /** - * Check that whether debugging is enabled for this API client. - * - * @return True if debugging is enabled, false otherwise. - */ - public boolean isDebugging() { - return debugging; - } - - /** - * Enable/disable debugging for this API client. - * - * @param debugging To enable (true) or disable (false) debugging - * @return ApiClient - */ - public ApiClient setDebugging(boolean debugging) { - if (debugging != this.debugging) { - if (debugging) { - loggingInterceptor = new HttpLoggingInterceptor(); - loggingInterceptor.setLevel(Level.BODY); - httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); - } else { - final OkHttpClient.Builder builder = httpClient.newBuilder(); - builder.interceptors().remove(loggingInterceptor); - httpClient = builder.build(); - loggingInterceptor = null; - } - } - this.debugging = debugging; - return this; - } - - /** - * The path of temporary folder used to store downloaded files from endpoints - * with file response. The default value is null, i.e. using - * the system's default temporary folder. - * - * @see createTempFile - * @return Temporary folder path - */ - public String getTempFolderPath() { - return tempFolderPath; - } - - /** - * Set the temporary folder path (for downloading files) - * - * @param tempFolderPath Temporary folder path - * @return ApiClient - */ - public ApiClient setTempFolderPath(String tempFolderPath) { - this.tempFolderPath = tempFolderPath; - return this; - } - - /** - * Get connection timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getConnectTimeout() { - return httpClient.connectTimeoutMillis(); - } - - /** - * Sets the connect timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param connectionTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setConnectTimeout(int connectionTimeout) { - httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - /** - * Get read timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getReadTimeout() { - return httpClient.readTimeoutMillis(); - } - - /** - * Sets the read timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param readTimeout read timeout in milliseconds - * @return Api client - */ - public ApiClient setReadTimeout(int readTimeout) { - httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - /** - * Get write timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getWriteTimeout() { - return httpClient.writeTimeoutMillis(); - } - - /** - * Sets the write timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param writeTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setWriteTimeout(int writeTimeout) { - httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - - /** - * Format the given parameter object into string. - * - * @param param Parameter - * @return String representation of the parameter - */ - public String parameterToString(Object param) { - if (param == null) { - return ""; - } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { - //Serialize to json string and remove the " enclosing characters - String jsonStr = JSON.serialize(param); - return jsonStr.substring(1, jsonStr.length() - 1); - } else if (param instanceof Collection) { - StringBuilder b = new StringBuilder(); - for (Object o : (Collection) param) { - if (b.length() > 0) { - b.append(","); - } - b.append(o); - } - return b.toString(); - } else { - return String.valueOf(param); - } - } - - /** - * Formats the specified query parameter to a list containing a single {@code Pair} object. - * - * Note that {@code value} must not be a collection. - * - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list containing a single {@code Pair} object. - */ - public List parameterToPair(String name, Object value) { - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null || value instanceof Collection) { - return params; - } - - params.add(new Pair(name, parameterToString(value))); - return params; - } - - /** - * Formats the specified collection query parameters to a list of {@code Pair} objects. - * - * Note that the values of each of the returned Pair objects are percent-encoded. - * - * @param collectionFormat The collection format of the parameter. - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list of {@code Pair} objects. - */ - public List parameterToPairs(String collectionFormat, String name, Collection value) { - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null || value.isEmpty()) { - return params; - } - - // create the params based on the collection format - if ("multi".equals(collectionFormat)) { - for (Object item : value) { - params.add(new Pair(name, escapeString(parameterToString(item)))); - } - return params; - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - // escape all delimiters except commas, which are URI reserved - // characters - if ("ssv".equals(collectionFormat)) { - delimiter = escapeString(" "); - } else if ("tsv".equals(collectionFormat)) { - delimiter = escapeString("\t"); - } else if ("pipes".equals(collectionFormat)) { - delimiter = escapeString("|"); - } - - StringBuilder sb = new StringBuilder(); - for (Object item : value) { - sb.append(delimiter); - sb.append(escapeString(parameterToString(item))); - } - - params.add(new Pair(name, sb.substring(delimiter.length()))); - - return params; - } - - /** - * Formats the specified collection path parameter to a string value. - * - * @param collectionFormat The collection format of the parameter. - * @param value The value of the parameter. - * @return String representation of the parameter - */ - public String collectionPathParameterToString(String collectionFormat, Collection value) { - // create the value based on the collection format - if ("multi".equals(collectionFormat)) { - // not valid for path params - return parameterToString(value); - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - if ("ssv".equals(collectionFormat)) { - delimiter = " "; - } else if ("tsv".equals(collectionFormat)) { - delimiter = "\t"; - } else if ("pipes".equals(collectionFormat)) { - delimiter = "|"; - } - - StringBuilder sb = new StringBuilder() ; - for (Object item : value) { - sb.append(delimiter); - sb.append(parameterToString(item)); - } - - return sb.substring(delimiter.length()); - } - - /** - * Sanitize filename by removing path. - * e.g. ../../sun.gif becomes sun.gif - * - * @param filename The filename to be sanitized - * @return The sanitized filename - */ - public String sanitizeFilename(String filename) { - return filename.replaceAll(".*[/\\\\]", ""); - } - - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * "* / *" is also default to JSON - * @param mime MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); - } - - /** - * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) - * - * @param accepts The accepts array to select from - * @return The Accept header to use. If the given array is empty, - * null will be returned (not to set the Accept header explicitly). - */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { - return null; - } - for (String accept : accepts) { - if (isJsonMime(accept)) { - return accept; - } - } - return StringUtil.join(accepts, ","); - } - - /** - * Select the Content-Type header's value from the given array: - * if JSON exists in the given array, use it; - * otherwise use the first one of the array. - * - * @param contentTypes The Content-Type array to select from - * @return The Content-Type header to use. If the given array is empty, - * returns null. If it matches "any", JSON will be used. - */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { - return null; - } - - if (contentTypes[0].equals("*/*")) { - return "application/json"; - } - - for (String contentType : contentTypes) { - if (isJsonMime(contentType)) { - return contentType; - } - } - - return contentTypes[0]; - } - - /** - * Escape the given string to be used as URL query value. - * - * @param str String to be escaped - * @return Escaped string - */ - public String escapeString(String str) { - try { - return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); - } catch (UnsupportedEncodingException e) { - return str; - } - } - - /** - * Deserialize response body to Java object, according to the return type and - * the Content-Type response header. - * - * @param Type - * @param response HTTP response - * @param returnType The type of the Java object - * @return The deserialized Java object - * @throws com.configcat.publicapi.java.client.ApiException If fail to deserialize response body, i.e. cannot read response body - * or the Content-Type of the response is not supported. - */ - @SuppressWarnings("unchecked") - public T deserialize(Response response, Type returnType) throws ApiException { - if (response == null || returnType == null) { - return null; - } - - if ("byte[]".equals(returnType.toString())) { - // Handle binary response (byte array). - try { - return (T) response.body().bytes(); - } catch (IOException e) { - throw new ApiException(e); - } - } else if (returnType.equals(File.class)) { - // Handle file downloading. - return (T) downloadFileFromResponse(response); - } - - String respBody; - try { - if (response.body() != null) - respBody = response.body().string(); - else - respBody = null; - } catch (IOException e) { - throw new ApiException(e); - } - - if (respBody == null || "".equals(respBody)) { - return null; - } - - String contentType = response.headers().get("Content-Type"); - if (contentType == null) { - // ensuring a default content type - contentType = "application/json"; - } - if (isJsonMime(contentType)) { - return JSON.deserialize(respBody, returnType); - } else if (returnType.equals(String.class)) { - // Expecting string, return the raw response body. - return (T) respBody; - } else { - throw new ApiException( - "Content type \"" + contentType + "\" is not supported for type: " + returnType, - response.code(), - response.headers().toMultimap(), - respBody); - } - } - - /** - * Serialize the given Java object into request body according to the object's - * class and the request Content-Type. - * - * @param obj The Java object - * @param contentType The request Content-Type - * @return The serialized request body - * @throws com.configcat.publicapi.java.client.ApiException If fail to serialize the given object - */ - public RequestBody serialize(Object obj, String contentType) throws ApiException { - if (obj instanceof byte[]) { - // Binary (byte array) body parameter support. - return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); - } else if (obj instanceof File) { - // File body parameter support. - return RequestBody.create((File) obj, MediaType.parse(contentType)); - } else if ("text/plain".equals(contentType) && obj instanceof String) { - return RequestBody.create((String) obj, MediaType.parse(contentType)); - } else if (isJsonMime(contentType)) { - String content; - if (obj != null) { - content = JSON.serialize(obj); - } else { - content = null; - } - return RequestBody.create(content, MediaType.parse(contentType)); - } else if (obj instanceof String) { - return RequestBody.create((String) obj, MediaType.parse(contentType)); - } else { - throw new ApiException("Content type \"" + contentType + "\" is not supported"); - } - } - - /** - * Download file from the given response. - * - * @param response An instance of the Response object - * @throws com.configcat.publicapi.java.client.ApiException If fail to read file content from response and write to disk - * @return Downloaded file - */ - public File downloadFileFromResponse(Response response) throws ApiException { - try { - File file = prepareDownloadFile(response); - BufferedSink sink = Okio.buffer(Okio.sink(file)); - sink.writeAll(response.body().source()); - sink.close(); - return file; - } catch (IOException e) { - throw new ApiException(e); - } - } - - /** - * Prepare file for download - * - * @param response An instance of the Response object - * @return Prepared file for the download - * @throws java.io.IOException If fail to prepare file for download - */ - public File prepareDownloadFile(Response response) throws IOException { - String filename = null; - String contentDisposition = response.header("Content-Disposition"); - if (contentDisposition != null && !"".equals(contentDisposition)) { - // Get filename from the Content-Disposition header. - Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); - Matcher matcher = pattern.matcher(contentDisposition); - if (matcher.find()) { - filename = sanitizeFilename(matcher.group(1)); - } - } - - String prefix = null; - String suffix = null; - if (filename == null) { - prefix = "download-"; - suffix = ""; - } else { - int pos = filename.lastIndexOf("."); - if (pos == -1) { - prefix = filename + "-"; - } else { - prefix = filename.substring(0, pos) + "-"; - suffix = filename.substring(pos); - } - // Files.createTempFile requires the prefix to be at least three characters long - if (prefix.length() < 3) - prefix = "download-"; - } - - if (tempFolderPath == null) - return Files.createTempFile(prefix, suffix).toFile(); - else - return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); - } - - /** - * {@link #execute(Call, Type)} - * - * @param Type - * @param call An instance of the Call object - * @return ApiResponse<T> - * @throws com.configcat.publicapi.java.client.ApiException If fail to execute the call - */ - public ApiResponse execute(Call call) throws ApiException { - return execute(call, null); - } - - /** - * Execute HTTP call and deserialize the HTTP response body into the given return type. - * - * @param returnType The return type used to deserialize HTTP response body - * @param The return type corresponding to (same with) returnType - * @param call Call - * @return ApiResponse object containing response status, headers and - * data, which is a Java object deserialized from response body and would be null - * when returnType is null. - * @throws com.configcat.publicapi.java.client.ApiException If fail to execute the call - */ - public ApiResponse execute(Call call, Type returnType) throws ApiException { - try { - Response response = call.execute(); - T data = handleResponse(response, returnType); - return new ApiResponse(response.code(), response.headers().toMultimap(), data); - } catch (IOException e) { - throw new ApiException(e); - } - } - - /** - * {@link #executeAsync(Call, Type, ApiCallback)} - * - * @param Type - * @param call An instance of the Call object - * @param callback ApiCallback<T> - */ - public void executeAsync(Call call, ApiCallback callback) { - executeAsync(call, null, callback); - } - - /** - * Execute HTTP call asynchronously. - * - * @param Type - * @param call The callback to be executed when the API call finishes - * @param returnType Return type - * @param callback ApiCallback - * @see #execute(Call, Type) - */ - @SuppressWarnings("unchecked") - public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { - call.enqueue(new Callback() { - @Override - public void onFailure(Call call, IOException e) { - callback.onFailure(new ApiException(e), 0, null); - } - - @Override - public void onResponse(Call call, Response response) throws IOException { - T result; - try { - result = (T) handleResponse(response, returnType); - } catch (ApiException e) { - callback.onFailure(e, response.code(), response.headers().toMultimap()); - return; - } catch (Exception e) { - callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); - return; - } - callback.onSuccess(result, response.code(), response.headers().toMultimap()); - } - }); - } - - /** - * Handle the given response, return the deserialized object when the response is successful. - * - * @param Type - * @param response Response - * @param returnType Return type - * @return Type - * @throws com.configcat.publicapi.java.client.ApiException If the response has an unsuccessful status code or - * fail to deserialize the response body - */ - public T handleResponse(Response response, Type returnType) throws ApiException { - if (response.isSuccessful()) { - if (returnType == null || response.code() == 204) { - // returning null if the returnType is not defined, - // or the status code is 204 (No Content) - if (response.body() != null) { - try { - response.body().close(); - } catch (Exception e) { - throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); - } - } - return null; - } else { - return deserialize(response, returnType); - } - } else { - String respBody = null; - if (response.body() != null) { - try { - respBody = response.body().string(); - } catch (IOException e) { - throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); - } - } - throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); - } - } - - /** - * Build HTTP call with the given options. - * - * @param baseUrl The base URL - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param authNames The authentications to apply - * @param callback Callback for upload/download progress - * @return The HTTP call - * @throws com.configcat.publicapi.java.client.ApiException If fail to serialize the request body object - */ - public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); - - return httpClient.newCall(request); - } - - /** - * Build an HTTP request with the given options. - * - * @param baseUrl The base URL - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param authNames The authentications to apply - * @param callback Callback for upload/download progress - * @return The HTTP request - * @throws com.configcat.publicapi.java.client.ApiException If fail to serialize the request body object - */ - public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams - List allQueryParams = new ArrayList(queryParams); - allQueryParams.addAll(collectionQueryParams); - - final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); - - // prepare HTTP request body - RequestBody reqBody; - String contentType = headerParams.get("Content-Type"); - String contentTypePure = contentType; - if (contentTypePure != null && contentTypePure.contains(";")) { - contentTypePure = contentType.substring(0, contentType.indexOf(";")); - } - if (!HttpMethod.permitsRequestBody(method)) { - reqBody = null; - } else if ("application/x-www-form-urlencoded".equals(contentTypePure)) { - reqBody = buildRequestBodyFormEncoding(formParams); - } else if ("multipart/form-data".equals(contentTypePure)) { - reqBody = buildRequestBodyMultipart(formParams); - } else if (body == null) { - if ("DELETE".equals(method)) { - // allow calling DELETE without sending a request body - reqBody = null; - } else { - // use an empty request body (for POST, PUT and PATCH) - reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType)); - } - } else { - reqBody = serialize(body, contentType); - } - - // update parameters with authentication settings - updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); - - final Request.Builder reqBuilder = new Request.Builder().url(url); - processHeaderParams(headerParams, reqBuilder); - processCookieParams(cookieParams, reqBuilder); - - // Associate callback with request (if not null) so interceptor can - // access it when creating ProgressResponseBody - reqBuilder.tag(callback); - - Request request = null; - - if (callback != null && reqBody != null) { - ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); - request = reqBuilder.method(method, progressRequestBody).build(); - } else { - request = reqBuilder.method(method, reqBody).build(); - } - - return request; - } - - /** - * Build full URL by concatenating base path, the given sub path and query parameters. - * - * @param baseUrl The base URL - * @param path The sub path - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @return The full URL - */ - public String buildUrl(String baseUrl, String path, List queryParams, List collectionQueryParams) { - final StringBuilder url = new StringBuilder(); - if (baseUrl != null) { - url.append(baseUrl).append(path); - } else { - String baseURL; - if (serverIndex != null) { - if (serverIndex < 0 || serverIndex >= servers.size()) { - throw new ArrayIndexOutOfBoundsException(String.format( - "Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size() - )); - } - baseURL = servers.get(serverIndex).URL(serverVariables); - } else { - baseURL = basePath; - } - url.append(baseURL).append(path); - } - - if (queryParams != null && !queryParams.isEmpty()) { - // support (constant) query string in `path`, e.g. "/posts?draft=1" - String prefix = path.contains("?") ? "&" : "?"; - for (Pair param : queryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - String value = parameterToString(param.getValue()); - url.append(escapeString(param.getName())).append("=").append(escapeString(value)); - } - } - } - - if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { - String prefix = url.toString().contains("?") ? "&" : "?"; - for (Pair param : collectionQueryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - String value = parameterToString(param.getValue()); - // collection query parameter value already escaped as part of parameterToPairs - url.append(escapeString(param.getName())).append("=").append(value); - } - } - } - - return url.toString(); - } - - /** - * Set header parameters to the request builder, including default headers. - * - * @param headerParams Header parameters in the form of Map - * @param reqBuilder Request.Builder - */ - public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { - for (Entry param : headerParams.entrySet()) { - reqBuilder.header(param.getKey(), parameterToString(param.getValue())); - } - for (Entry header : defaultHeaderMap.entrySet()) { - if (!headerParams.containsKey(header.getKey())) { - reqBuilder.header(header.getKey(), parameterToString(header.getValue())); - } - } - } - - /** - * Set cookie parameters to the request builder, including default cookies. - * - * @param cookieParams Cookie parameters in the form of Map - * @param reqBuilder Request.Builder - */ - public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { - for (Entry param : cookieParams.entrySet()) { - reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); - } - for (Entry param : defaultCookieMap.entrySet()) { - if (!cookieParams.containsKey(param.getKey())) { - reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); - } - } - } - - /** - * Update query and header parameters based on authentication settings. - * - * @param authNames The authentications to apply - * @param queryParams List of query parameters - * @param headerParams Map of header parameters - * @param cookieParams Map of cookie parameters - * @param payload HTTP request body - * @param method HTTP method - * @param uri URI - * @throws com.configcat.publicapi.java.client.ApiException If fails to update the parameters - */ - public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, - Map cookieParams, String payload, String method, URI uri) throws ApiException { - for (String authName : authNames) { - Authentication auth = authentications.get(authName); - if (auth == null) { - throw new RuntimeException("Authentication undefined: " + authName); - } - auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); - } - } - - /** - * Build a form-encoding request body with the given form parameters. - * - * @param formParams Form parameters in the form of Map - * @return RequestBody - */ - public RequestBody buildRequestBodyFormEncoding(Map formParams) { - okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); - for (Entry param : formParams.entrySet()) { - formBuilder.add(param.getKey(), parameterToString(param.getValue())); - } - return formBuilder.build(); - } - - /** - * Build a multipart (file uploading) request body with the given form parameters, - * which could contain text fields and file fields. - * - * @param formParams Form parameters in the form of Map - * @return RequestBody - */ - public RequestBody buildRequestBodyMultipart(Map formParams) { - MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); - for (Entry param : formParams.entrySet()) { - if (param.getValue() instanceof File) { - File file = (File) param.getValue(); - addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); - } else if (param.getValue() instanceof List) { - List list = (List) param.getValue(); - for (Object item: list) { - if (item instanceof File) { - addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); - } else { - addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); - } - } - } else { - addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); - } - } - return mpBuilder.build(); - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - public String guessContentTypeFromFile(File file) { - String contentType = URLConnection.guessContentTypeFromName(file.getName()); - if (contentType == null) { - return "application/octet-stream"; - } else { - return contentType; - } - } - - /** - * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. - * - * @param mpBuilder MultipartBody.Builder - * @param key The key of the Header element - * @param file The file to add to the Header - */ - private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); - MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); - mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); - } - - /** - * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. - * - * @param mpBuilder MultipartBody.Builder - * @param key The key of the Header element - * @param obj The complex object to add to the Header - */ - private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { - RequestBody requestBody; - if (obj instanceof String) { - requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); - } else { - String content; - if (obj != null) { - content = JSON.serialize(obj); - } else { - content = null; - } - requestBody = RequestBody.create(content, MediaType.parse("application/json")); - } - - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); - mpBuilder.addPart(partHeaders, requestBody); - } - - /** - * Get network interceptor to add it to the httpClient to track download progress for - * async requests. - */ - private Interceptor getProgressInterceptor() { - return new Interceptor() { - @Override - public Response intercept(Interceptor.Chain chain) throws IOException { - final Request request = chain.request(); - final Response originalResponse = chain.proceed(request); - if (request.tag() instanceof ApiCallback) { - final ApiCallback callback = (ApiCallback) request.tag(); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), callback)) - .build(); - } - return originalResponse; - } - }; - } - - /** - * Apply SSL related settings to httpClient according to the current values of - * verifyingSsl and sslCaCert. - */ - private void applySslSettings() { - try { - TrustManager[] trustManagers; - HostnameVerifier hostnameVerifier; - if (!verifyingSsl) { - trustManagers = new TrustManager[]{ - new X509TrustManager() { - @Override - public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } - - @Override - public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } - - @Override - public java.security.cert.X509Certificate[] getAcceptedIssuers() { - return new java.security.cert.X509Certificate[]{}; - } - } - }; - hostnameVerifier = new HostnameVerifier() { - @Override - public boolean verify(String hostname, SSLSession session) { - return true; - } - }; - } else { - TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - - if (sslCaCert == null) { - trustManagerFactory.init((KeyStore) null); - } else { - char[] password = null; // Any password will work. - CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); - Collection certificates = certificateFactory.generateCertificates(sslCaCert); - if (certificates.isEmpty()) { - throw new IllegalArgumentException("expected non-empty set of trusted certificates"); - } - KeyStore caKeyStore = newEmptyKeyStore(password); - int index = 0; - for (Certificate certificate : certificates) { - String certificateAlias = "ca" + (index++); - caKeyStore.setCertificateEntry(certificateAlias, certificate); - } - trustManagerFactory.init(caKeyStore); - } - trustManagers = trustManagerFactory.getTrustManagers(); - hostnameVerifier = OkHostnameVerifier.INSTANCE; - } - - SSLContext sslContext = SSLContext.getInstance("TLS"); - sslContext.init(keyManagers, trustManagers, new SecureRandom()); - httpClient = httpClient.newBuilder() - .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) - .hostnameVerifier(hostnameVerifier) - .build(); - } catch (GeneralSecurityException e) { - throw new RuntimeException(e); - } - } - - private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { - try { - KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); - keyStore.load(null, password); - return keyStore; - } catch (IOException e) { - throw new AssertionError(e); - } - } - - /** - * Convert the HTTP request body to a string. - * - * @param requestBody The HTTP request object - * @return The string representation of the HTTP request body - * @throws com.configcat.publicapi.java.client.ApiException If fail to serialize the request body object into a string - */ - private String requestBodyToString(RequestBody requestBody) throws ApiException { - if (requestBody != null) { - try { - final Buffer buffer = new Buffer(); - requestBody.writeTo(buffer); - return buffer.readUtf8(); - } catch (final IOException e) { - throw new ApiException(e); - } - } - - // empty http request body - return ""; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/ApiException.java b/src/main/java/com/configcat/publicapi/java/client/ApiException.java deleted file mode 100644 index 3ea6ea1..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/ApiException.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client; - -import java.util.Map; -import java.util.List; - - -/** - *

ApiException class.

- */ -@SuppressWarnings("serial") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class ApiException extends RuntimeException { - private static final long serialVersionUID = 1L; - - private int code = 0; - private Map> responseHeaders = null; - private String responseBody = null; - - /** - *

Constructor for ApiException.

- */ - public ApiException() {} - - /** - *

Constructor for ApiException.

- * - * @param throwable a {@link java.lang.Throwable} object - */ - public ApiException(Throwable throwable) { - super(throwable); - } - - /** - *

Constructor for ApiException.

- * - * @param message the error message - */ - public ApiException(String message) { - super(message); - } - - /** - *

Constructor for ApiException.

- * - * @param message the error message - * @param throwable a {@link java.lang.Throwable} object - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { - super(message, throwable); - this.code = code; - this.responseHeaders = responseHeaders; - this.responseBody = responseBody; - } - - /** - *

Constructor for ApiException.

- * - * @param message the error message - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(String message, int code, Map> responseHeaders, String responseBody) { - this(message, (Throwable) null, code, responseHeaders, responseBody); - } - - /** - *

Constructor for ApiException.

- * - * @param message the error message - * @param throwable a {@link java.lang.Throwable} object - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - */ - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { - this(message, throwable, code, responseHeaders, null); - } - - /** - *

Constructor for ApiException.

- * - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(int code, Map> responseHeaders, String responseBody) { - this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody); - } - - /** - *

Constructor for ApiException.

- * - * @param code HTTP status code - * @param message a {@link java.lang.String} object - */ - public ApiException(int code, String message) { - super(message); - this.code = code; - } - - /** - *

Constructor for ApiException.

- * - * @param code HTTP status code - * @param message the error message - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(int code, String message, Map> responseHeaders, String responseBody) { - this(code, message); - this.responseHeaders = responseHeaders; - this.responseBody = responseBody; - } - - /** - * Get the HTTP status code. - * - * @return HTTP status code - */ - public int getCode() { - return code; - } - - /** - * Get the HTTP response headers. - * - * @return A map of list of string - */ - public Map> getResponseHeaders() { - return responseHeaders; - } - - /** - * Get the HTTP response body. - * - * @return Response body in the form of string - */ - public String getResponseBody() { - return responseBody; - } - - /** - * Get the exception message including HTTP response data. - * - * @return The exception message - */ - public String getMessage() { - return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", - super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/ApiResponse.java b/src/main/java/com/configcat/publicapi/java/client/ApiResponse.java deleted file mode 100644 index 47d753e..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/ApiResponse.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client; - -import java.util.List; -import java.util.Map; - -/** - * API response returned by API call. - */ -public class ApiResponse { - final private int statusCode; - final private Map> headers; - final private T data; - - /** - *

Constructor for ApiResponse.

- * - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - */ - public ApiResponse(int statusCode, Map> headers) { - this(statusCode, headers, null); - } - - /** - *

Constructor for ApiResponse.

- * - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - * @param data The object deserialized from response bod - */ - public ApiResponse(int statusCode, Map> headers, T data) { - this.statusCode = statusCode; - this.headers = headers; - this.data = data; - } - - /** - *

Get the status code.

- * - * @return the status code - */ - public int getStatusCode() { - return statusCode; - } - - /** - *

Get the headers.

- * - * @return a {@link java.util.Map} of headers - */ - public Map> getHeaders() { - return headers; - } - - /** - *

Get the data.

- * - * @return the data - */ - public T getData() { - return data; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/Configuration.java b/src/main/java/com/configcat/publicapi/java/client/Configuration.java deleted file mode 100644 index c6baed3..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/Configuration.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class Configuration { - public static final String VERSION = "v1"; - - private static ApiClient defaultApiClient = new ApiClient(); - - /** - * Get the default API client, which would be used when creating API - * instances without providing an API client. - * - * @return Default API client - */ - public static ApiClient getDefaultApiClient() { - return defaultApiClient; - } - - /** - * Set the default API client, which would be used when creating API - * instances without providing an API client. - * - * @param apiClient API client - */ - public static void setDefaultApiClient(ApiClient apiClient) { - defaultApiClient = apiClient; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/GzipRequestInterceptor.java b/src/main/java/com/configcat/publicapi/java/client/GzipRequestInterceptor.java deleted file mode 100644 index 1d17be4..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/GzipRequestInterceptor.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client; - -import okhttp3.*; -import okio.Buffer; -import okio.BufferedSink; -import okio.GzipSink; -import okio.Okio; - -import java.io.IOException; - -/** - * Encodes request bodies using gzip. - * - * Taken from https://github.com/square/okhttp/issues/350 - */ -class GzipRequestInterceptor implements Interceptor { - @Override - public Response intercept(Chain chain) throws IOException { - Request originalRequest = chain.request(); - if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { - return chain.proceed(originalRequest); - } - - Request compressedRequest = originalRequest.newBuilder() - .header("Content-Encoding", "gzip") - .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) - .build(); - return chain.proceed(compressedRequest); - } - - private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { - final Buffer buffer = new Buffer(); - requestBody.writeTo(buffer); - return new RequestBody() { - @Override - public MediaType contentType() { - return requestBody.contentType(); - } - - @Override - public long contentLength() { - return buffer.size(); - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - sink.write(buffer.snapshot()); - } - }; - } - - private RequestBody gzip(final RequestBody body) { - return new RequestBody() { - @Override - public MediaType contentType() { - return body.contentType(); - } - - @Override - public long contentLength() { - return -1; // We don't know the compressed length in advance! - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); - body.writeTo(gzipSink); - gzipSink.close(); - } - }; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/JSON.java b/src/main/java/com/configcat/publicapi/java/client/JSON.java deleted file mode 100644 index 3892933..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/JSON.java +++ /dev/null @@ -1,495 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.internal.bind.util.ISO8601Utils; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.google.gson.JsonElement; -import io.gsonfire.GsonFireBuilder; -import io.gsonfire.TypeSelector; - -import okio.ByteString; - -import java.io.IOException; -import java.io.StringReader; -import java.lang.reflect.Type; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.ParsePosition; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.Date; -import java.util.Locale; -import java.util.Map; -import java.util.HashMap; - -/* - * A JSON utility class - * - * NOTE: in the future, this class may be converted to static, which may break - * backward-compatibility - */ -public class JSON { - private static Gson gson; - private static boolean isLenientOnJson = false; - private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); - private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); - private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); - private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); - private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); - - @SuppressWarnings("unchecked") - public static GsonBuilder createGson() { - GsonFireBuilder fireBuilder = new GsonFireBuilder() - ; - GsonBuilder builder = fireBuilder.createGsonBuilder(); - return builder; - } - - private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { - JsonElement element = readElement.getAsJsonObject().get(discriminatorField); - if (null == element) { - throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); - } - return element.getAsString(); - } - - /** - * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. - * - * @param classByDiscriminatorValue The map of discriminator values to Java classes. - * @param discriminatorValue The value of the OpenAPI discriminator in the input data. - * @return The Java class that implements the OpenAPI schema - */ - private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { - Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); - if (null == clazz) { - throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); - } - return clazz; - } - - static { - GsonBuilder gsonBuilder = createGson(); - gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); - gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); - gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); - gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); - gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.AddOrUpdateIntegrationLinkModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.AddOrUpdateJiraIntegrationLinkModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.AuditLogItemModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.CodeReferenceModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.CodeReferenceRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ComparisonValueListModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ComparisonValueModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ConditionModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ConfigModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ConfigSettingFormulaModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ConfigSettingFormulasModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ConfigSettingValueModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ConfigSettingValuesModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ConnectRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.CreateConfigRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.CreateEnvironmentModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.CreateIntegrationModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.CreateOrUpdateEnvironmentAccessModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.CreatePermissionGroupRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.CreateProductRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.CreateSegmentModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.CreateSettingInitialValues.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.CreateTagModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.DeleteIntegrationLinkModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.DeleteRepositoryReportsRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.EnvironmentAccessModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.EnvironmentModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.FeatureFlagLimitations.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.FlagReference.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.InitialValue.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.IntegrationLinkDetail.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.IntegrationLinkDetailsModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.IntegrationLinkModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.IntegrationModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.IntegrationsModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.InvitationModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.InviteMembersRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.JsonPatchOperation.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.MeModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.MemberModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ModifyIntegrationRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.OrganizationAdminModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.OrganizationInvitationModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.OrganizationMemberModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.OrganizationMembersModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.OrganizationModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.OrganizationPermissionGroupModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.OrganizationPermissionModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.OrganizationProductModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.PercentageOptionModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.PermissionGroupModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.PreferencesModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.PrerequisiteFlagConditionModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ProductModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ReasonRequiredEnvironmentModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ReferenceLine.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ReferenceLines.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ReplaceSettingModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.RolloutPercentageItemModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.RolloutRuleModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.SdkKeysModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.SegmentConditionModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.SegmentListModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.SegmentModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.SettingDataModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.SettingFormulaModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.SettingModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.SettingTagModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.SettingValueModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.TagModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.TargetingRuleModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateConfigRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateEnvironmentModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateEvaluationFormulaModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateEvaluationFormulaWithIdModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateEvaluationFormulasModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateMemberPermissionsRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdatePermissionGroupRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdatePreferencesRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateProductRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateReasonRequiredEnvironmentModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateSegmentModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateSettingValueModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateSettingValueWithSettingIdModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateSettingValuesWithIdModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateTagModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UserConditionModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UserModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ValueModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.WebHookRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.WebhookConfig.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.WebhookEnvironment.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.WebhookHeaderModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.WebhookModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.WebhookSigningKeysModel.CustomTypeAdapterFactory()); - gson = gsonBuilder.create(); - } - - /** - * Get Gson. - * - * @return Gson - */ - public static Gson getGson() { - return gson; - } - - /** - * Set Gson. - * - * @param gson Gson - */ - public static void setGson(Gson gson) { - JSON.gson = gson; - } - - public static void setLenientOnJson(boolean lenientOnJson) { - isLenientOnJson = lenientOnJson; - } - - /** - * Serialize the given Java object into JSON string. - * - * @param obj Object - * @return String representation of the JSON - */ - public static String serialize(Object obj) { - return gson.toJson(obj); - } - - /** - * Deserialize the given JSON string to Java object. - * - * @param Type - * @param body The JSON string - * @param returnType The type to deserialize into - * @return The deserialized Java object - */ - @SuppressWarnings("unchecked") - public static T deserialize(String body, Type returnType) { - try { - if (isLenientOnJson) { - JsonReader jsonReader = new JsonReader(new StringReader(body)); - // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) - jsonReader.setLenient(true); - return gson.fromJson(jsonReader, returnType); - } else { - return gson.fromJson(body, returnType); - } - } catch (JsonParseException e) { - // Fallback processing when failed to parse JSON form response body: - // return the response body string directly for the String return type; - if (returnType.equals(String.class)) { - return (T) body; - } else { - throw (e); - } - } - } - - /** - * Gson TypeAdapter for Byte Array type - */ - public static class ByteArrayAdapter extends TypeAdapter { - - @Override - public void write(JsonWriter out, byte[] value) throws IOException { - if (value == null) { - out.nullValue(); - } else { - out.value(ByteString.of(value).base64()); - } - } - - @Override - public byte[] read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String bytesAsBase64 = in.nextString(); - ByteString byteString = ByteString.decodeBase64(bytesAsBase64); - return byteString.toByteArray(); - } - } - } - - /** - * Gson TypeAdapter for JSR310 OffsetDateTime type - */ - public static class OffsetDateTimeTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public OffsetDateTimeTypeAdapter() { - this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); - } - - public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, OffsetDateTime date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.format(date)); - } - } - - @Override - public OffsetDateTime read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - if (date.endsWith("+0000")) { - date = date.substring(0, date.length()-5) + "Z"; - } - return OffsetDateTime.parse(date, formatter); - } - } - } - - /** - * Gson TypeAdapter for JSR310 LocalDate type - */ - public static class LocalDateTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public LocalDateTypeAdapter() { - this(DateTimeFormatter.ISO_LOCAL_DATE); - } - - public LocalDateTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, LocalDate date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.format(date)); - } - } - - @Override - public LocalDate read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - return LocalDate.parse(date, formatter); - } - } - } - - public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - offsetDateTimeTypeAdapter.setFormat(dateFormat); - } - - public static void setLocalDateFormat(DateTimeFormatter dateFormat) { - localDateTypeAdapter.setFormat(dateFormat); - } - - /** - * Gson TypeAdapter for java.sql.Date type - * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used - * (more efficient than SimpleDateFormat). - */ - public static class SqlDateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public SqlDateTypeAdapter() {} - - public SqlDateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, java.sql.Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = date.toString(); - } - out.value(value); - } - } - - @Override - public java.sql.Date read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return new java.sql.Date(dateFormat.parse(date).getTime()); - } - return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } - } - } - - /** - * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, ISO8601Utils will be used. - */ - public static class DateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public DateTypeAdapter() {} - - public DateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = ISO8601Utils.format(date, true); - } - out.value(value); - } - } - - @Override - public Date read(JsonReader in) throws IOException { - try { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return dateFormat.parse(date); - } - return ISO8601Utils.parse(date, new ParsePosition(0)); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } - } catch (IllegalArgumentException e) { - throw new JsonParseException(e); - } - } - } - - public static void setDateFormat(DateFormat dateFormat) { - dateTypeAdapter.setFormat(dateFormat); - } - - public static void setSqlDateFormat(DateFormat dateFormat) { - sqlDateTypeAdapter.setFormat(dateFormat); - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/Pair.java b/src/main/java/com/configcat/publicapi/java/client/Pair.java deleted file mode 100644 index 8a854a2..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/Pair.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class Pair { - private String name = ""; - private String value = ""; - - public Pair (String name, String value) { - setName(name); - setValue(value); - } - - private void setName(String name) { - if (!isValidString(name)) { - return; - } - - this.name = name; - } - - private void setValue(String value) { - if (!isValidString(value)) { - return; - } - - this.value = value; - } - - public String getName() { - return this.name; - } - - public String getValue() { - return this.value; - } - - private boolean isValidString(String arg) { - if (arg == null) { - return false; - } - - return true; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/ProgressRequestBody.java b/src/main/java/com/configcat/publicapi/java/client/ProgressRequestBody.java deleted file mode 100644 index fa0316d..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/ProgressRequestBody.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client; - -import okhttp3.MediaType; -import okhttp3.RequestBody; - -import java.io.IOException; - -import okio.Buffer; -import okio.BufferedSink; -import okio.ForwardingSink; -import okio.Okio; -import okio.Sink; - -public class ProgressRequestBody extends RequestBody { - - private final RequestBody requestBody; - - private final ApiCallback callback; - - public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { - this.requestBody = requestBody; - this.callback = callback; - } - - @Override - public MediaType contentType() { - return requestBody.contentType(); - } - - @Override - public long contentLength() throws IOException { - return requestBody.contentLength(); - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - BufferedSink bufferedSink = Okio.buffer(sink(sink)); - requestBody.writeTo(bufferedSink); - bufferedSink.flush(); - } - - private Sink sink(Sink sink) { - return new ForwardingSink(sink) { - - long bytesWritten = 0L; - long contentLength = 0L; - - @Override - public void write(Buffer source, long byteCount) throws IOException { - super.write(source, byteCount); - if (contentLength == 0) { - contentLength = contentLength(); - } - - bytesWritten += byteCount; - callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); - } - }; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/ProgressResponseBody.java b/src/main/java/com/configcat/publicapi/java/client/ProgressResponseBody.java deleted file mode 100644 index 6fb85b3..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/ProgressResponseBody.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client; - -import okhttp3.MediaType; -import okhttp3.ResponseBody; - -import java.io.IOException; - -import okio.Buffer; -import okio.BufferedSource; -import okio.ForwardingSource; -import okio.Okio; -import okio.Source; - -public class ProgressResponseBody extends ResponseBody { - - private final ResponseBody responseBody; - private final ApiCallback callback; - private BufferedSource bufferedSource; - - public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { - this.responseBody = responseBody; - this.callback = callback; - } - - @Override - public MediaType contentType() { - return responseBody.contentType(); - } - - @Override - public long contentLength() { - return responseBody.contentLength(); - } - - @Override - public BufferedSource source() { - if (bufferedSource == null) { - bufferedSource = Okio.buffer(source(responseBody.source())); - } - return bufferedSource; - } - - private Source source(Source source) { - return new ForwardingSource(source) { - long totalBytesRead = 0L; - - @Override - public long read(Buffer sink, long byteCount) throws IOException { - long bytesRead = super.read(sink, byteCount); - // read() returns the number of bytes read, or -1 if this source is exhausted. - totalBytesRead += bytesRead != -1 ? bytesRead : 0; - callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); - return bytesRead; - } - }; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/ServerConfiguration.java b/src/main/java/com/configcat/publicapi/java/client/ServerConfiguration.java deleted file mode 100644 index 935cc91..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/ServerConfiguration.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.configcat.publicapi.java.client; - -import java.util.Map; - -/** - * Representing a Server configuration. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class ServerConfiguration { - public String URL; - public String description; - public Map variables; - - /** - * @param URL A URL to the target host. - * @param description A description of the host designated by the URL. - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ - public ServerConfiguration(String URL, String description, Map variables) { - this.URL = URL; - this.description = description; - this.variables = variables; - } - - /** - * Format URL template using given variables. - * - * @param variables A map between a variable name and its value. - * @return Formatted URL. - */ - public String URL(Map variables) { - String url = this.URL; - - // go through variables and replace placeholders - for (Map.Entry variable: this.variables.entrySet()) { - String name = variable.getKey(); - ServerVariable serverVariable = variable.getValue(); - String value = serverVariable.defaultValue; - - if (variables != null && variables.containsKey(name)) { - value = variables.get(name); - if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { - throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); - } - } - url = url.replace("{" + name + "}", value); - } - return url; - } - - /** - * Format URL template using default server variables. - * - * @return Formatted URL. - */ - public String URL() { - return URL(null); - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/ServerVariable.java b/src/main/java/com/configcat/publicapi/java/client/ServerVariable.java deleted file mode 100644 index 642d8ea..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/ServerVariable.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.configcat.publicapi.java.client; - -import java.util.HashSet; - -/** - * Representing a Server Variable for server URL template substitution. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class ServerVariable { - public String description; - public String defaultValue; - public HashSet enumValues = null; - - /** - * @param description A description for the server variable. - * @param defaultValue The default value to use for substitution. - * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. - */ - public ServerVariable(String description, String defaultValue, HashSet enumValues) { - this.description = description; - this.defaultValue = defaultValue; - this.enumValues = enumValues; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/StringUtil.java b/src/main/java/com/configcat/publicapi/java/client/StringUtil.java deleted file mode 100644 index 0662de4..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/StringUtil.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client; - -import java.util.Collection; -import java.util.Iterator; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class StringUtil { - /** - * Check if the given array contains the given value (with case-insensitive comparison). - * - * @param array The array - * @param value The value to search - * @return true if the array contains the value - */ - public static boolean containsIgnoreCase(String[] array, String value) { - for (String str : array) { - if (value == null && str == null) { - return true; - } - if (value != null && value.equalsIgnoreCase(str)) { - return true; - } - } - return false; - } - - /** - * Join an array of strings with the given separator. - *

- * Note: This might be replaced by utility method from commons-lang or guava someday - * if one of those libraries is added as dependency. - *

- * - * @param array The array of strings - * @param separator The separator - * @return the resulting string - */ - public static String join(String[] array, String separator) { - int len = array.length; - if (len == 0) { - return ""; - } - - StringBuilder out = new StringBuilder(); - out.append(array[0]); - for (int i = 1; i < len; i++) { - out.append(separator).append(array[i]); - } - return out.toString(); - } - - /** - * Join a list of strings with the given separator. - * - * @param list The list of strings - * @param separator The separator - * @return the resulting string - */ - public static String join(Collection list, String separator) { - Iterator iterator = list.iterator(); - StringBuilder out = new StringBuilder(); - if (iterator.hasNext()) { - out.append(iterator.next()); - } - while (iterator.hasNext()) { - out.append(separator).append(iterator.next()); - } - return out.toString(); - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/AuditLogsApi.java b/src/main/java/com/configcat/publicapi/java/client/api/AuditLogsApi.java deleted file mode 100644 index 2d303c9..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/api/AuditLogsApi.java +++ /dev/null @@ -1,572 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.api; - -import com.configcat.publicapi.java.client.ApiCallback; -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.ApiResponse; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.Pair; -import com.configcat.publicapi.java.client.ProgressRequestBody; -import com.configcat.publicapi.java.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.configcat.publicapi.java.client.model.AuditLogItemModel; -import com.configcat.publicapi.java.client.model.AuditLogType; -import java.time.OffsetDateTime; -import com.configcat.publicapi.java.client.model.SettingModel; -import java.util.UUID; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class AuditLogsApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public AuditLogsApi() { - this(Configuration.getDefaultApiClient()); - } - - public AuditLogsApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for getAuditlogs - * @param productId The identifier of the Product. (required) - * @param configId The identifier of the Config. (optional) - * @param environmentId The identifier of the Environment. (optional) - * @param auditLogType Filter Audit logs by Audit log type. (optional) - * @param fromUtcDateTime Filter Audit logs by starting UTC date. (optional) - * @param toUtcDateTime Filter Audit logs by ending UTC date. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getAuditlogsCall(UUID productId, UUID configId, UUID environmentId, AuditLogType auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/products/{productId}/auditlogs" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (configId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("configId", configId)); - } - - if (environmentId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("environmentId", environmentId)); - } - - if (auditLogType != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("auditLogType", auditLogType)); - } - - if (fromUtcDateTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fromUtcDateTime", fromUtcDateTime)); - } - - if (toUtcDateTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("toUtcDateTime", toUtcDateTime)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getAuditlogsValidateBeforeCall(UUID productId, UUID configId, UUID environmentId, AuditLogType auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'productId' is set - if (productId == null) { - throw new ApiException("Missing the required parameter 'productId' when calling getAuditlogs(Async)"); - } - - return getAuditlogsCall(productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime, _callback); - - } - - /** - * List Audit log items for Product - * This endpoint returns the list of Audit log items for a given Product and the result can be optionally filtered by Config and/or Environment. - * @param productId The identifier of the Product. (required) - * @param configId The identifier of the Config. (optional) - * @param environmentId The identifier of the Environment. (optional) - * @param auditLogType Filter Audit logs by Audit log type. (optional) - * @param fromUtcDateTime Filter Audit logs by starting UTC date. (optional) - * @param toUtcDateTime Filter Audit logs by ending UTC date. (optional) - * @return List<AuditLogItemModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public List getAuditlogs(UUID productId, UUID configId, UUID environmentId, AuditLogType auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime) throws ApiException { - ApiResponse> localVarResp = getAuditlogsWithHttpInfo(productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime); - return localVarResp.getData(); - } - - /** - * List Audit log items for Product - * This endpoint returns the list of Audit log items for a given Product and the result can be optionally filtered by Config and/or Environment. - * @param productId The identifier of the Product. (required) - * @param configId The identifier of the Config. (optional) - * @param environmentId The identifier of the Environment. (optional) - * @param auditLogType Filter Audit logs by Audit log type. (optional) - * @param fromUtcDateTime Filter Audit logs by starting UTC date. (optional) - * @param toUtcDateTime Filter Audit logs by ending UTC date. (optional) - * @return ApiResponse<List<AuditLogItemModel>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse> getAuditlogsWithHttpInfo(UUID productId, UUID configId, UUID environmentId, AuditLogType auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime) throws ApiException { - okhttp3.Call localVarCall = getAuditlogsValidateBeforeCall(productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Audit log items for Product (asynchronously) - * This endpoint returns the list of Audit log items for a given Product and the result can be optionally filtered by Config and/or Environment. - * @param productId The identifier of the Product. (required) - * @param configId The identifier of the Config. (optional) - * @param environmentId The identifier of the Environment. (optional) - * @param auditLogType Filter Audit logs by Audit log type. (optional) - * @param fromUtcDateTime Filter Audit logs by starting UTC date. (optional) - * @param toUtcDateTime Filter Audit logs by ending UTC date. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getAuditlogsAsync(UUID productId, UUID configId, UUID environmentId, AuditLogType auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime, final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = getAuditlogsValidateBeforeCall(productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getDeletedSettings - * @param configId The identifier of the Config. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getDeletedSettingsCall(UUID configId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/configs/{configId}/deleted-settings" - .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getDeletedSettingsValidateBeforeCall(UUID configId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'configId' is set - if (configId == null) { - throw new ApiException("Missing the required parameter 'configId' when calling getDeletedSettings(Async)"); - } - - return getDeletedSettingsCall(configId, _callback); - - } - - /** - * List Deleted Settings - * This endpoint returns the list of Feature Flags and Settings that were deleted from the given Config. - * @param configId The identifier of the Config. (required) - * @return List<SettingModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public List getDeletedSettings(UUID configId) throws ApiException { - ApiResponse> localVarResp = getDeletedSettingsWithHttpInfo(configId); - return localVarResp.getData(); - } - - /** - * List Deleted Settings - * This endpoint returns the list of Feature Flags and Settings that were deleted from the given Config. - * @param configId The identifier of the Config. (required) - * @return ApiResponse<List<SettingModel>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse> getDeletedSettingsWithHttpInfo(UUID configId) throws ApiException { - okhttp3.Call localVarCall = getDeletedSettingsValidateBeforeCall(configId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Deleted Settings (asynchronously) - * This endpoint returns the list of Feature Flags and Settings that were deleted from the given Config. - * @param configId The identifier of the Config. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getDeletedSettingsAsync(UUID configId, final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = getDeletedSettingsValidateBeforeCall(configId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getOrganizationAuditlogs - * @param organizationId The identifier of the Organization. (required) - * @param productId The identifier of the Product. (optional) - * @param configId The identifier of the Config. (optional) - * @param environmentId The identifier of the Environment. (optional) - * @param auditLogType Filter Audit logs by Audit log type. (optional) - * @param fromUtcDateTime Filter Audit logs by starting UTC date. (optional) - * @param toUtcDateTime Filter Audit logs by ending UTC date. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getOrganizationAuditlogsCall(UUID organizationId, UUID productId, UUID configId, UUID environmentId, AuditLogType auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/organizations/{organizationId}/auditlogs" - .replace("{" + "organizationId" + "}", localVarApiClient.escapeString(organizationId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (productId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("productId", productId)); - } - - if (configId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("configId", configId)); - } - - if (environmentId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("environmentId", environmentId)); - } - - if (auditLogType != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("auditLogType", auditLogType)); - } - - if (fromUtcDateTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fromUtcDateTime", fromUtcDateTime)); - } - - if (toUtcDateTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("toUtcDateTime", toUtcDateTime)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getOrganizationAuditlogsValidateBeforeCall(UUID organizationId, UUID productId, UUID configId, UUID environmentId, AuditLogType auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { - throw new ApiException("Missing the required parameter 'organizationId' when calling getOrganizationAuditlogs(Async)"); - } - - return getOrganizationAuditlogsCall(organizationId, productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime, _callback); - - } - - /** - * List Audit log items for Organization - * This endpoint returns the list of Audit log items for a given Organization and the result can be optionally filtered by Product and/or Config and/or Environment. - * @param organizationId The identifier of the Organization. (required) - * @param productId The identifier of the Product. (optional) - * @param configId The identifier of the Config. (optional) - * @param environmentId The identifier of the Environment. (optional) - * @param auditLogType Filter Audit logs by Audit log type. (optional) - * @param fromUtcDateTime Filter Audit logs by starting UTC date. (optional) - * @param toUtcDateTime Filter Audit logs by ending UTC date. (optional) - * @return List<AuditLogItemModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public List getOrganizationAuditlogs(UUID organizationId, UUID productId, UUID configId, UUID environmentId, AuditLogType auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime) throws ApiException { - ApiResponse> localVarResp = getOrganizationAuditlogsWithHttpInfo(organizationId, productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime); - return localVarResp.getData(); - } - - /** - * List Audit log items for Organization - * This endpoint returns the list of Audit log items for a given Organization and the result can be optionally filtered by Product and/or Config and/or Environment. - * @param organizationId The identifier of the Organization. (required) - * @param productId The identifier of the Product. (optional) - * @param configId The identifier of the Config. (optional) - * @param environmentId The identifier of the Environment. (optional) - * @param auditLogType Filter Audit logs by Audit log type. (optional) - * @param fromUtcDateTime Filter Audit logs by starting UTC date. (optional) - * @param toUtcDateTime Filter Audit logs by ending UTC date. (optional) - * @return ApiResponse<List<AuditLogItemModel>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse> getOrganizationAuditlogsWithHttpInfo(UUID organizationId, UUID productId, UUID configId, UUID environmentId, AuditLogType auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime) throws ApiException { - okhttp3.Call localVarCall = getOrganizationAuditlogsValidateBeforeCall(organizationId, productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Audit log items for Organization (asynchronously) - * This endpoint returns the list of Audit log items for a given Organization and the result can be optionally filtered by Product and/or Config and/or Environment. - * @param organizationId The identifier of the Organization. (required) - * @param productId The identifier of the Product. (optional) - * @param configId The identifier of the Config. (optional) - * @param environmentId The identifier of the Environment. (optional) - * @param auditLogType Filter Audit logs by Audit log type. (optional) - * @param fromUtcDateTime Filter Audit logs by starting UTC date. (optional) - * @param toUtcDateTime Filter Audit logs by ending UTC date. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getOrganizationAuditlogsAsync(UUID organizationId, UUID productId, UUID configId, UUID environmentId, AuditLogType auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime, final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = getOrganizationAuditlogsValidateBeforeCall(organizationId, productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/CodeReferencesApi.java b/src/main/java/com/configcat/publicapi/java/client/api/CodeReferencesApi.java deleted file mode 100644 index 22e4524..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/api/CodeReferencesApi.java +++ /dev/null @@ -1,476 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.api; - -import com.configcat.publicapi.java.client.ApiCallback; -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.ApiResponse; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.Pair; -import com.configcat.publicapi.java.client.ProgressRequestBody; -import com.configcat.publicapi.java.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.configcat.publicapi.java.client.model.CodeReferenceModel; -import com.configcat.publicapi.java.client.model.CodeReferenceRequest; -import com.configcat.publicapi.java.client.model.DeleteRepositoryReportsRequest; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class CodeReferencesApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public CodeReferencesApi() { - this(Configuration.getDefaultApiClient()); - } - - public CodeReferencesApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for v1CodeReferencesDeleteReportsPost - * @param deleteRepositoryReportsRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call v1CodeReferencesDeleteReportsPostCall(DeleteRepositoryReportsRequest deleteRepositoryReportsRequest, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = deleteRepositoryReportsRequest; - - // create path and map variables - String localVarPath = "/v1/code-references/delete-reports"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call v1CodeReferencesDeleteReportsPostValidateBeforeCall(DeleteRepositoryReportsRequest deleteRepositoryReportsRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'deleteRepositoryReportsRequest' is set - if (deleteRepositoryReportsRequest == null) { - throw new ApiException("Missing the required parameter 'deleteRepositoryReportsRequest' when calling v1CodeReferencesDeleteReportsPost(Async)"); - } - - return v1CodeReferencesDeleteReportsPostCall(deleteRepositoryReportsRequest, _callback); - - } - - /** - * Delete Reference reports - * - * @param deleteRepositoryReportsRequest (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public void v1CodeReferencesDeleteReportsPost(DeleteRepositoryReportsRequest deleteRepositoryReportsRequest) throws ApiException { - v1CodeReferencesDeleteReportsPostWithHttpInfo(deleteRepositoryReportsRequest); - } - - /** - * Delete Reference reports - * - * @param deleteRepositoryReportsRequest (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse v1CodeReferencesDeleteReportsPostWithHttpInfo(DeleteRepositoryReportsRequest deleteRepositoryReportsRequest) throws ApiException { - okhttp3.Call localVarCall = v1CodeReferencesDeleteReportsPostValidateBeforeCall(deleteRepositoryReportsRequest, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete Reference reports (asynchronously) - * - * @param deleteRepositoryReportsRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call v1CodeReferencesDeleteReportsPostAsync(DeleteRepositoryReportsRequest deleteRepositoryReportsRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = v1CodeReferencesDeleteReportsPostValidateBeforeCall(deleteRepositoryReportsRequest, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for v1CodeReferencesPost - * @param codeReferenceRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call v1CodeReferencesPostCall(CodeReferenceRequest codeReferenceRequest, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = codeReferenceRequest; - - // create path and map variables - String localVarPath = "/v1/code-references"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call v1CodeReferencesPostValidateBeforeCall(CodeReferenceRequest codeReferenceRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'codeReferenceRequest' is set - if (codeReferenceRequest == null) { - throw new ApiException("Missing the required parameter 'codeReferenceRequest' when calling v1CodeReferencesPost(Async)"); - } - - return v1CodeReferencesPostCall(codeReferenceRequest, _callback); - - } - - /** - * Upload References - * - * @param codeReferenceRequest (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public void v1CodeReferencesPost(CodeReferenceRequest codeReferenceRequest) throws ApiException { - v1CodeReferencesPostWithHttpInfo(codeReferenceRequest); - } - - /** - * Upload References - * - * @param codeReferenceRequest (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse v1CodeReferencesPostWithHttpInfo(CodeReferenceRequest codeReferenceRequest) throws ApiException { - okhttp3.Call localVarCall = v1CodeReferencesPostValidateBeforeCall(codeReferenceRequest, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Upload References (asynchronously) - * - * @param codeReferenceRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call v1CodeReferencesPostAsync(CodeReferenceRequest codeReferenceRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = v1CodeReferencesPostValidateBeforeCall(codeReferenceRequest, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for v1SettingsSettingIdCodeReferencesGet - * @param settingId The identifier of the Feature Flag or Setting. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call v1SettingsSettingIdCodeReferencesGetCall(Integer settingId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/settings/{settingId}/code-references" - .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call v1SettingsSettingIdCodeReferencesGetValidateBeforeCall(Integer settingId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'settingId' is set - if (settingId == null) { - throw new ApiException("Missing the required parameter 'settingId' when calling v1SettingsSettingIdCodeReferencesGet(Async)"); - } - - return v1SettingsSettingIdCodeReferencesGetCall(settingId, _callback); - - } - - /** - * Get References for Feature Flag or Setting - * - * @param settingId The identifier of the Feature Flag or Setting. (required) - * @return List<CodeReferenceModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public List v1SettingsSettingIdCodeReferencesGet(Integer settingId) throws ApiException { - ApiResponse> localVarResp = v1SettingsSettingIdCodeReferencesGetWithHttpInfo(settingId); - return localVarResp.getData(); - } - - /** - * Get References for Feature Flag or Setting - * - * @param settingId The identifier of the Feature Flag or Setting. (required) - * @return ApiResponse<List<CodeReferenceModel>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse> v1SettingsSettingIdCodeReferencesGetWithHttpInfo(Integer settingId) throws ApiException { - okhttp3.Call localVarCall = v1SettingsSettingIdCodeReferencesGetValidateBeforeCall(settingId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get References for Feature Flag or Setting (asynchronously) - * - * @param settingId The identifier of the Feature Flag or Setting. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call v1SettingsSettingIdCodeReferencesGetAsync(Integer settingId, final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = v1SettingsSettingIdCodeReferencesGetValidateBeforeCall(settingId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/ConfigsApi.java b/src/main/java/com/configcat/publicapi/java/client/api/ConfigsApi.java deleted file mode 100644 index d664bcb..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/api/ConfigsApi.java +++ /dev/null @@ -1,772 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.api; - -import com.configcat.publicapi.java.client.ApiCallback; -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.ApiResponse; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.Pair; -import com.configcat.publicapi.java.client.ProgressRequestBody; -import com.configcat.publicapi.java.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.configcat.publicapi.java.client.model.ConfigModel; -import com.configcat.publicapi.java.client.model.CreateConfigRequest; -import java.util.UUID; -import com.configcat.publicapi.java.client.model.UpdateConfigRequest; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class ConfigsApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public ConfigsApi() { - this(Configuration.getDefaultApiClient()); - } - - public ConfigsApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for createConfig - * @param productId The identifier of the Product. (required) - * @param createConfigRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call createConfigCall(UUID productId, CreateConfigRequest createConfigRequest, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = createConfigRequest; - - // create path and map variables - String localVarPath = "/v1/products/{productId}/configs" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createConfigValidateBeforeCall(UUID productId, CreateConfigRequest createConfigRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'productId' is set - if (productId == null) { - throw new ApiException("Missing the required parameter 'productId' when calling createConfig(Async)"); - } - - // verify the required parameter 'createConfigRequest' is set - if (createConfigRequest == null) { - throw new ApiException("Missing the required parameter 'createConfigRequest' when calling createConfig(Async)"); - } - - return createConfigCall(productId, createConfigRequest, _callback); - - } - - /** - * Create Config - * This endpoint creates a new Config in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @param createConfigRequest (required) - * @return ConfigModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ConfigModel createConfig(UUID productId, CreateConfigRequest createConfigRequest) throws ApiException { - ApiResponse localVarResp = createConfigWithHttpInfo(productId, createConfigRequest); - return localVarResp.getData(); - } - - /** - * Create Config - * This endpoint creates a new Config in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @param createConfigRequest (required) - * @return ApiResponse<ConfigModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse createConfigWithHttpInfo(UUID productId, CreateConfigRequest createConfigRequest) throws ApiException { - okhttp3.Call localVarCall = createConfigValidateBeforeCall(productId, createConfigRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create Config (asynchronously) - * This endpoint creates a new Config in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @param createConfigRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call createConfigAsync(UUID productId, CreateConfigRequest createConfigRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createConfigValidateBeforeCall(productId, createConfigRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for deleteConfig - * @param configId The identifier of the Config. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteConfigCall(UUID configId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/configs/{configId}" - .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteConfigValidateBeforeCall(UUID configId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'configId' is set - if (configId == null) { - throw new ApiException("Missing the required parameter 'configId' when calling deleteConfig(Async)"); - } - - return deleteConfigCall(configId, _callback); - - } - - /** - * Delete Config - * This endpoint removes a Config identified by the `configId` parameter. - * @param configId The identifier of the Config. (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public void deleteConfig(UUID configId) throws ApiException { - deleteConfigWithHttpInfo(configId); - } - - /** - * Delete Config - * This endpoint removes a Config identified by the `configId` parameter. - * @param configId The identifier of the Config. (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse deleteConfigWithHttpInfo(UUID configId) throws ApiException { - okhttp3.Call localVarCall = deleteConfigValidateBeforeCall(configId, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete Config (asynchronously) - * This endpoint removes a Config identified by the `configId` parameter. - * @param configId The identifier of the Config. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteConfigAsync(UUID configId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deleteConfigValidateBeforeCall(configId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for getConfig - * @param configId The identifier of the Config. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the config data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getConfigCall(UUID configId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/configs/{configId}" - .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getConfigValidateBeforeCall(UUID configId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'configId' is set - if (configId == null) { - throw new ApiException("Missing the required parameter 'configId' when calling getConfig(Async)"); - } - - return getConfigCall(configId, _callback); - - } - - /** - * Get Config - * This endpoint returns the metadata of a Config identified by the `configId`. - * @param configId The identifier of the Config. (required) - * @return ConfigModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the config data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ConfigModel getConfig(UUID configId) throws ApiException { - ApiResponse localVarResp = getConfigWithHttpInfo(configId); - return localVarResp.getData(); - } - - /** - * Get Config - * This endpoint returns the metadata of a Config identified by the `configId`. - * @param configId The identifier of the Config. (required) - * @return ApiResponse<ConfigModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the config data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse getConfigWithHttpInfo(UUID configId) throws ApiException { - okhttp3.Call localVarCall = getConfigValidateBeforeCall(configId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Config (asynchronously) - * This endpoint returns the metadata of a Config identified by the `configId`. - * @param configId The identifier of the Config. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the config data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getConfigAsync(UUID configId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getConfigValidateBeforeCall(configId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getConfigs - * @param productId The identifier of the Product. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getConfigsCall(UUID productId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/products/{productId}/configs" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getConfigsValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'productId' is set - if (productId == null) { - throw new ApiException("Missing the required parameter 'productId' when calling getConfigs(Async)"); - } - - return getConfigsCall(productId, _callback); - - } - - /** - * List Configs - * This endpoint returns the list of the Configs that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @return List<ConfigModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public List getConfigs(UUID productId) throws ApiException { - ApiResponse> localVarResp = getConfigsWithHttpInfo(productId); - return localVarResp.getData(); - } - - /** - * List Configs - * This endpoint returns the list of the Configs that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @return ApiResponse<List<ConfigModel>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse> getConfigsWithHttpInfo(UUID productId) throws ApiException { - okhttp3.Call localVarCall = getConfigsValidateBeforeCall(productId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Configs (asynchronously) - * This endpoint returns the list of the Configs that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getConfigsAsync(UUID productId, final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = getConfigsValidateBeforeCall(productId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for updateConfig - * @param configId The identifier of the Config. (required) - * @param updateConfigRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateConfigCall(UUID configId, UpdateConfigRequest updateConfigRequest, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updateConfigRequest; - - // create path and map variables - String localVarPath = "/v1/configs/{configId}" - .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateConfigValidateBeforeCall(UUID configId, UpdateConfigRequest updateConfigRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'configId' is set - if (configId == null) { - throw new ApiException("Missing the required parameter 'configId' when calling updateConfig(Async)"); - } - - // verify the required parameter 'updateConfigRequest' is set - if (updateConfigRequest == null) { - throw new ApiException("Missing the required parameter 'updateConfigRequest' when calling updateConfig(Async)"); - } - - return updateConfigCall(configId, updateConfigRequest, _callback); - - } - - /** - * Update Config - * This endpoint updates a Config identified by the `configId` parameter. - * @param configId The identifier of the Config. (required) - * @param updateConfigRequest (required) - * @return ConfigModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ConfigModel updateConfig(UUID configId, UpdateConfigRequest updateConfigRequest) throws ApiException { - ApiResponse localVarResp = updateConfigWithHttpInfo(configId, updateConfigRequest); - return localVarResp.getData(); - } - - /** - * Update Config - * This endpoint updates a Config identified by the `configId` parameter. - * @param configId The identifier of the Config. (required) - * @param updateConfigRequest (required) - * @return ApiResponse<ConfigModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse updateConfigWithHttpInfo(UUID configId, UpdateConfigRequest updateConfigRequest) throws ApiException { - okhttp3.Call localVarCall = updateConfigValidateBeforeCall(configId, updateConfigRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update Config (asynchronously) - * This endpoint updates a Config identified by the `configId` parameter. - * @param configId The identifier of the Config. (required) - * @param updateConfigRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateConfigAsync(UUID configId, UpdateConfigRequest updateConfigRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateConfigValidateBeforeCall(configId, updateConfigRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/EnvironmentsApi.java b/src/main/java/com/configcat/publicapi/java/client/api/EnvironmentsApi.java deleted file mode 100644 index 0ef5b52..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/api/EnvironmentsApi.java +++ /dev/null @@ -1,780 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.api; - -import com.configcat.publicapi.java.client.ApiCallback; -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.ApiResponse; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.Pair; -import com.configcat.publicapi.java.client.ProgressRequestBody; -import com.configcat.publicapi.java.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.configcat.publicapi.java.client.model.CreateEnvironmentModel; -import com.configcat.publicapi.java.client.model.EnvironmentModel; -import java.util.UUID; -import com.configcat.publicapi.java.client.model.UpdateEnvironmentModel; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class EnvironmentsApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public EnvironmentsApi() { - this(Configuration.getDefaultApiClient()); - } - - public EnvironmentsApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for createEnvironment - * @param productId The identifier of the Product. (required) - * @param createEnvironmentModel (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call createEnvironmentCall(UUID productId, CreateEnvironmentModel createEnvironmentModel, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = createEnvironmentModel; - - // create path and map variables - String localVarPath = "/v1/products/{productId}/environments" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createEnvironmentValidateBeforeCall(UUID productId, CreateEnvironmentModel createEnvironmentModel, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'productId' is set - if (productId == null) { - throw new ApiException("Missing the required parameter 'productId' when calling createEnvironment(Async)"); - } - - // verify the required parameter 'createEnvironmentModel' is set - if (createEnvironmentModel == null) { - throw new ApiException("Missing the required parameter 'createEnvironmentModel' when calling createEnvironment(Async)"); - } - - return createEnvironmentCall(productId, createEnvironmentModel, _callback); - - } - - /** - * Create Environment - * This endpoint creates a new Environment in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @param createEnvironmentModel (required) - * @return EnvironmentModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public EnvironmentModel createEnvironment(UUID productId, CreateEnvironmentModel createEnvironmentModel) throws ApiException { - ApiResponse localVarResp = createEnvironmentWithHttpInfo(productId, createEnvironmentModel); - return localVarResp.getData(); - } - - /** - * Create Environment - * This endpoint creates a new Environment in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @param createEnvironmentModel (required) - * @return ApiResponse<EnvironmentModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse createEnvironmentWithHttpInfo(UUID productId, CreateEnvironmentModel createEnvironmentModel) throws ApiException { - okhttp3.Call localVarCall = createEnvironmentValidateBeforeCall(productId, createEnvironmentModel, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create Environment (asynchronously) - * This endpoint creates a new Environment in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @param createEnvironmentModel (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call createEnvironmentAsync(UUID productId, CreateEnvironmentModel createEnvironmentModel, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createEnvironmentValidateBeforeCall(productId, createEnvironmentModel, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for deleteEnvironment - * @param environmentId The identifier of the Environment. (required) - * @param cleanupAuditLogs An optional flag which indicates whether the audit log records related to the environment should be deleted or not. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteEnvironmentCall(UUID environmentId, Boolean cleanupAuditLogs, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/environments/{environmentId}" - .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (cleanupAuditLogs != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("cleanupAuditLogs", cleanupAuditLogs)); - } - - final String[] localVarAccepts = { - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteEnvironmentValidateBeforeCall(UUID environmentId, Boolean cleanupAuditLogs, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'environmentId' is set - if (environmentId == null) { - throw new ApiException("Missing the required parameter 'environmentId' when calling deleteEnvironment(Async)"); - } - - return deleteEnvironmentCall(environmentId, cleanupAuditLogs, _callback); - - } - - /** - * Delete Environment - * This endpoint removes an Environment identified by the `environmentId` parameter. If the `cleanupAuditLogs` flag is set to true, it also deletes the audit log records related to the environment (except for the `Created a new environment` and `Deleted an environment` records). - * @param environmentId The identifier of the Environment. (required) - * @param cleanupAuditLogs An optional flag which indicates whether the audit log records related to the environment should be deleted or not. (optional) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public void deleteEnvironment(UUID environmentId, Boolean cleanupAuditLogs) throws ApiException { - deleteEnvironmentWithHttpInfo(environmentId, cleanupAuditLogs); - } - - /** - * Delete Environment - * This endpoint removes an Environment identified by the `environmentId` parameter. If the `cleanupAuditLogs` flag is set to true, it also deletes the audit log records related to the environment (except for the `Created a new environment` and `Deleted an environment` records). - * @param environmentId The identifier of the Environment. (required) - * @param cleanupAuditLogs An optional flag which indicates whether the audit log records related to the environment should be deleted or not. (optional) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse deleteEnvironmentWithHttpInfo(UUID environmentId, Boolean cleanupAuditLogs) throws ApiException { - okhttp3.Call localVarCall = deleteEnvironmentValidateBeforeCall(environmentId, cleanupAuditLogs, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete Environment (asynchronously) - * This endpoint removes an Environment identified by the `environmentId` parameter. If the `cleanupAuditLogs` flag is set to true, it also deletes the audit log records related to the environment (except for the `Created a new environment` and `Deleted an environment` records). - * @param environmentId The identifier of the Environment. (required) - * @param cleanupAuditLogs An optional flag which indicates whether the audit log records related to the environment should be deleted or not. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteEnvironmentAsync(UUID environmentId, Boolean cleanupAuditLogs, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deleteEnvironmentValidateBeforeCall(environmentId, cleanupAuditLogs, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for getEnvironment - * @param environmentId The identifier of the Environment. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the environment data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getEnvironmentCall(UUID environmentId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/environments/{environmentId}" - .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getEnvironmentValidateBeforeCall(UUID environmentId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'environmentId' is set - if (environmentId == null) { - throw new ApiException("Missing the required parameter 'environmentId' when calling getEnvironment(Async)"); - } - - return getEnvironmentCall(environmentId, _callback); - - } - - /** - * Get Environment - * This endpoint returns the metadata of an Environment identified by the `environmentId`. - * @param environmentId The identifier of the Environment. (required) - * @return EnvironmentModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the environment data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public EnvironmentModel getEnvironment(UUID environmentId) throws ApiException { - ApiResponse localVarResp = getEnvironmentWithHttpInfo(environmentId); - return localVarResp.getData(); - } - - /** - * Get Environment - * This endpoint returns the metadata of an Environment identified by the `environmentId`. - * @param environmentId The identifier of the Environment. (required) - * @return ApiResponse<EnvironmentModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the environment data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse getEnvironmentWithHttpInfo(UUID environmentId) throws ApiException { - okhttp3.Call localVarCall = getEnvironmentValidateBeforeCall(environmentId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Environment (asynchronously) - * This endpoint returns the metadata of an Environment identified by the `environmentId`. - * @param environmentId The identifier of the Environment. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the environment data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getEnvironmentAsync(UUID environmentId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getEnvironmentValidateBeforeCall(environmentId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getEnvironments - * @param productId The identifier of the Product. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getEnvironmentsCall(UUID productId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/products/{productId}/environments" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getEnvironmentsValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'productId' is set - if (productId == null) { - throw new ApiException("Missing the required parameter 'productId' when calling getEnvironments(Async)"); - } - - return getEnvironmentsCall(productId, _callback); - - } - - /** - * List Environments - * This endpoint returns the list of the Environments that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @return List<EnvironmentModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public List getEnvironments(UUID productId) throws ApiException { - ApiResponse> localVarResp = getEnvironmentsWithHttpInfo(productId); - return localVarResp.getData(); - } - - /** - * List Environments - * This endpoint returns the list of the Environments that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @return ApiResponse<List<EnvironmentModel>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse> getEnvironmentsWithHttpInfo(UUID productId) throws ApiException { - okhttp3.Call localVarCall = getEnvironmentsValidateBeforeCall(productId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Environments (asynchronously) - * This endpoint returns the list of the Environments that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getEnvironmentsAsync(UUID productId, final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = getEnvironmentsValidateBeforeCall(productId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for updateEnvironment - * @param environmentId The identifier of the Environment. (required) - * @param updateEnvironmentModel (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateEnvironmentCall(UUID environmentId, UpdateEnvironmentModel updateEnvironmentModel, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updateEnvironmentModel; - - // create path and map variables - String localVarPath = "/v1/environments/{environmentId}" - .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateEnvironmentValidateBeforeCall(UUID environmentId, UpdateEnvironmentModel updateEnvironmentModel, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'environmentId' is set - if (environmentId == null) { - throw new ApiException("Missing the required parameter 'environmentId' when calling updateEnvironment(Async)"); - } - - // verify the required parameter 'updateEnvironmentModel' is set - if (updateEnvironmentModel == null) { - throw new ApiException("Missing the required parameter 'updateEnvironmentModel' when calling updateEnvironment(Async)"); - } - - return updateEnvironmentCall(environmentId, updateEnvironmentModel, _callback); - - } - - /** - * Update Environment - * This endpoint updates an Environment identified by the `environmentId` parameter. - * @param environmentId The identifier of the Environment. (required) - * @param updateEnvironmentModel (required) - * @return EnvironmentModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public EnvironmentModel updateEnvironment(UUID environmentId, UpdateEnvironmentModel updateEnvironmentModel) throws ApiException { - ApiResponse localVarResp = updateEnvironmentWithHttpInfo(environmentId, updateEnvironmentModel); - return localVarResp.getData(); - } - - /** - * Update Environment - * This endpoint updates an Environment identified by the `environmentId` parameter. - * @param environmentId The identifier of the Environment. (required) - * @param updateEnvironmentModel (required) - * @return ApiResponse<EnvironmentModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse updateEnvironmentWithHttpInfo(UUID environmentId, UpdateEnvironmentModel updateEnvironmentModel) throws ApiException { - okhttp3.Call localVarCall = updateEnvironmentValidateBeforeCall(environmentId, updateEnvironmentModel, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update Environment (asynchronously) - * This endpoint updates an Environment identified by the `environmentId` parameter. - * @param environmentId The identifier of the Environment. (required) - * @param updateEnvironmentModel (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateEnvironmentAsync(UUID environmentId, UpdateEnvironmentModel updateEnvironmentModel, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateEnvironmentValidateBeforeCall(environmentId, updateEnvironmentModel, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesApi.java b/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesApi.java deleted file mode 100644 index d44dd5a..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesApi.java +++ /dev/null @@ -1,869 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.api; - -import com.configcat.publicapi.java.client.ApiCallback; -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.ApiResponse; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.Pair; -import com.configcat.publicapi.java.client.ProgressRequestBody; -import com.configcat.publicapi.java.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.configcat.publicapi.java.client.model.ConfigSettingValuesModel; -import com.configcat.publicapi.java.client.model.JsonPatchOperation; -import com.configcat.publicapi.java.client.model.SettingValueModel; -import java.util.UUID; -import com.configcat.publicapi.java.client.model.UpdateSettingValueModel; -import com.configcat.publicapi.java.client.model.UpdateSettingValuesWithIdModel; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class FeatureFlagSettingValuesApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public FeatureFlagSettingValuesApi() { - this(Configuration.getDefaultApiClient()); - } - - public FeatureFlagSettingValuesApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for getSettingValue - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the setting value data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSettingValueCall(UUID environmentId, Integer settingId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/environments/{environmentId}/settings/{settingId}/value" - .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())) - .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getSettingValueValidateBeforeCall(UUID environmentId, Integer settingId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'environmentId' is set - if (environmentId == null) { - throw new ApiException("Missing the required parameter 'environmentId' when calling getSettingValue(Async)"); - } - - // verify the required parameter 'settingId' is set - if (settingId == null) { - throw new ApiException("Missing the required parameter 'settingId' when calling getSettingValue(Async)"); - } - - return getSettingValueCall(environmentId, settingId, _callback); - - } - - /** - * Get value - * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the `environmentId` parameter. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview). - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @return SettingValueModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the setting value data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public SettingValueModel getSettingValue(UUID environmentId, Integer settingId) throws ApiException { - ApiResponse localVarResp = getSettingValueWithHttpInfo(environmentId, settingId); - return localVarResp.getData(); - } - - /** - * Get value - * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the `environmentId` parameter. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview). - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @return ApiResponse<SettingValueModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the setting value data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse getSettingValueWithHttpInfo(UUID environmentId, Integer settingId) throws ApiException { - okhttp3.Call localVarCall = getSettingValueValidateBeforeCall(environmentId, settingId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get value (asynchronously) - * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the `environmentId` parameter. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview). - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the setting value data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSettingValueAsync(UUID environmentId, Integer settingId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getSettingValueValidateBeforeCall(environmentId, settingId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getSettingValues - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSettingValuesCall(UUID configId, UUID environmentId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/configs/{configId}/environments/{environmentId}/values" - .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())) - .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getSettingValuesValidateBeforeCall(UUID configId, UUID environmentId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'configId' is set - if (configId == null) { - throw new ApiException("Missing the required parameter 'configId' when calling getSettingValues(Async)"); - } - - // verify the required parameter 'environmentId' is set - if (environmentId == null) { - throw new ApiException("Missing the required parameter 'environmentId' when calling getSettingValues(Async)"); - } - - return getSettingValuesCall(configId, environmentId, _callback); - - } - - /** - * Get values - * This endpoint returns the value of a specified Config's Feature Flags or Settings identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @return ConfigSettingValuesModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ConfigSettingValuesModel getSettingValues(UUID configId, UUID environmentId) throws ApiException { - ApiResponse localVarResp = getSettingValuesWithHttpInfo(configId, environmentId); - return localVarResp.getData(); - } - - /** - * Get values - * This endpoint returns the value of a specified Config's Feature Flags or Settings identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @return ApiResponse<ConfigSettingValuesModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse getSettingValuesWithHttpInfo(UUID configId, UUID environmentId) throws ApiException { - okhttp3.Call localVarCall = getSettingValuesValidateBeforeCall(configId, environmentId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get values (asynchronously) - * This endpoint returns the value of a specified Config's Feature Flags or Settings identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSettingValuesAsync(UUID configId, UUID environmentId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getSettingValuesValidateBeforeCall(configId, environmentId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for postSettingValues - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @param updateSettingValuesWithIdModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the updated setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call postSettingValuesCall(UUID configId, UUID environmentId, UpdateSettingValuesWithIdModel updateSettingValuesWithIdModel, String reason, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updateSettingValuesWithIdModel; - - // create path and map variables - String localVarPath = "/v1/configs/{configId}/environments/{environmentId}/values" - .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())) - .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (reason != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call postSettingValuesValidateBeforeCall(UUID configId, UUID environmentId, UpdateSettingValuesWithIdModel updateSettingValuesWithIdModel, String reason, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'configId' is set - if (configId == null) { - throw new ApiException("Missing the required parameter 'configId' when calling postSettingValues(Async)"); - } - - // verify the required parameter 'environmentId' is set - if (environmentId == null) { - throw new ApiException("Missing the required parameter 'environmentId' when calling postSettingValues(Async)"); - } - - // verify the required parameter 'updateSettingValuesWithIdModel' is set - if (updateSettingValuesWithIdModel == null) { - throw new ApiException("Missing the required parameter 'updateSettingValuesWithIdModel' when calling postSettingValues(Async)"); - } - - return postSettingValuesCall(configId, environmentId, updateSettingValuesWithIdModel, reason, _callback); - - } - - /** - * Post values - * This endpoint replaces the values of a specified Config's Feature Flags or Settings identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"settingValues\": [ { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false, \"settingId\": 1 } ] } ``` If we send a replace request body as below: ```json { \"settingValues\": [ { \"value\": true, \"settingId\": 1 } ] } ``` Then besides that the default value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"settingValues\": [ { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true, \"setting\": { \"settingId\": 1 } } ] } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @param updateSettingValuesWithIdModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @return ConfigSettingValuesModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the updated setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ConfigSettingValuesModel postSettingValues(UUID configId, UUID environmentId, UpdateSettingValuesWithIdModel updateSettingValuesWithIdModel, String reason) throws ApiException { - ApiResponse localVarResp = postSettingValuesWithHttpInfo(configId, environmentId, updateSettingValuesWithIdModel, reason); - return localVarResp.getData(); - } - - /** - * Post values - * This endpoint replaces the values of a specified Config's Feature Flags or Settings identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"settingValues\": [ { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false, \"settingId\": 1 } ] } ``` If we send a replace request body as below: ```json { \"settingValues\": [ { \"value\": true, \"settingId\": 1 } ] } ``` Then besides that the default value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"settingValues\": [ { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true, \"setting\": { \"settingId\": 1 } } ] } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @param updateSettingValuesWithIdModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @return ApiResponse<ConfigSettingValuesModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the updated setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse postSettingValuesWithHttpInfo(UUID configId, UUID environmentId, UpdateSettingValuesWithIdModel updateSettingValuesWithIdModel, String reason) throws ApiException { - okhttp3.Call localVarCall = postSettingValuesValidateBeforeCall(configId, environmentId, updateSettingValuesWithIdModel, reason, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Post values (asynchronously) - * This endpoint replaces the values of a specified Config's Feature Flags or Settings identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"settingValues\": [ { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false, \"settingId\": 1 } ] } ``` If we send a replace request body as below: ```json { \"settingValues\": [ { \"value\": true, \"settingId\": 1 } ] } ``` Then besides that the default value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"settingValues\": [ { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true, \"setting\": { \"settingId\": 1 } } ] } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @param updateSettingValuesWithIdModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the updated setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call postSettingValuesAsync(UUID configId, UUID environmentId, UpdateSettingValuesWithIdModel updateSettingValuesWithIdModel, String reason, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = postSettingValuesValidateBeforeCall(configId, environmentId, updateSettingValuesWithIdModel, reason, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for replaceSettingValue - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param updateSettingValueModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call replaceSettingValueCall(UUID environmentId, Integer settingId, UpdateSettingValueModel updateSettingValueModel, String reason, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updateSettingValueModel; - - // create path and map variables - String localVarPath = "/v1/environments/{environmentId}/settings/{settingId}/value" - .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())) - .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (reason != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call replaceSettingValueValidateBeforeCall(UUID environmentId, Integer settingId, UpdateSettingValueModel updateSettingValueModel, String reason, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'environmentId' is set - if (environmentId == null) { - throw new ApiException("Missing the required parameter 'environmentId' when calling replaceSettingValue(Async)"); - } - - // verify the required parameter 'settingId' is set - if (settingId == null) { - throw new ApiException("Missing the required parameter 'settingId' when calling replaceSettingValue(Async)"); - } - - // verify the required parameter 'updateSettingValueModel' is set - if (updateSettingValueModel == null) { - throw new ApiException("Missing the required parameter 'updateSettingValueModel' when calling replaceSettingValue(Async)"); - } - - return replaceSettingValueCall(environmentId, settingId, updateSettingValueModel, reason, _callback); - - } - - /** - * Replace value - * This endpoint replaces the whole value of a Feature Flag or Setting in a specified Environment. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send a replace request body as below: ```json { \"value\": true } ``` Then besides that the default value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param updateSettingValueModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @return SettingValueModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public SettingValueModel replaceSettingValue(UUID environmentId, Integer settingId, UpdateSettingValueModel updateSettingValueModel, String reason) throws ApiException { - ApiResponse localVarResp = replaceSettingValueWithHttpInfo(environmentId, settingId, updateSettingValueModel, reason); - return localVarResp.getData(); - } - - /** - * Replace value - * This endpoint replaces the whole value of a Feature Flag or Setting in a specified Environment. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send a replace request body as below: ```json { \"value\": true } ``` Then besides that the default value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param updateSettingValueModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @return ApiResponse<SettingValueModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse replaceSettingValueWithHttpInfo(UUID environmentId, Integer settingId, UpdateSettingValueModel updateSettingValueModel, String reason) throws ApiException { - okhttp3.Call localVarCall = replaceSettingValueValidateBeforeCall(environmentId, settingId, updateSettingValueModel, reason, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Replace value (asynchronously) - * This endpoint replaces the whole value of a Feature Flag or Setting in a specified Environment. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send a replace request body as below: ```json { \"value\": true } ``` Then besides that the default value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param updateSettingValueModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call replaceSettingValueAsync(UUID environmentId, Integer settingId, UpdateSettingValueModel updateSettingValueModel, String reason, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = replaceSettingValueValidateBeforeCall(environmentId, settingId, updateSettingValueModel, reason, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for updateSettingValue - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param jsonPatchOperation (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - - -
Status Code Description Response Headers
200 When the patch was successful. -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateSettingValueCall(UUID environmentId, Integer settingId, List jsonPatchOperation, String reason, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = jsonPatchOperation; - - // create path and map variables - String localVarPath = "/v1/environments/{environmentId}/settings/{settingId}/value" - .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())) - .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (reason != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateSettingValueValidateBeforeCall(UUID environmentId, Integer settingId, List jsonPatchOperation, String reason, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'environmentId' is set - if (environmentId == null) { - throw new ApiException("Missing the required parameter 'environmentId' when calling updateSettingValue(Async)"); - } - - // verify the required parameter 'settingId' is set - if (settingId == null) { - throw new ApiException("Missing the required parameter 'settingId' when calling updateSettingValue(Async)"); - } - - // verify the required parameter 'jsonPatchOperation' is set - if (jsonPatchOperation == null) { - throw new ApiException("Missing the required parameter 'jsonPatchOperation' when calling updateSettingValue(Async)"); - } - - return updateSettingValueCall(environmentId, settingId, jsonPatchOperation, reason, _callback); - - } - - /** - * Update value - * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/value\", \"value\": true } ] ``` Only the default value is going to be set to `true` and all the Percentage Rules are remaining unchanged. So we get a response like this: ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": true } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param jsonPatchOperation (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @return SettingValueModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - -
Status Code Description Response Headers
200 When the patch was successful. -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public SettingValueModel updateSettingValue(UUID environmentId, Integer settingId, List jsonPatchOperation, String reason) throws ApiException { - ApiResponse localVarResp = updateSettingValueWithHttpInfo(environmentId, settingId, jsonPatchOperation, reason); - return localVarResp.getData(); - } - - /** - * Update value - * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/value\", \"value\": true } ] ``` Only the default value is going to be set to `true` and all the Percentage Rules are remaining unchanged. So we get a response like this: ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": true } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param jsonPatchOperation (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @return ApiResponse<SettingValueModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - -
Status Code Description Response Headers
200 When the patch was successful. -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse updateSettingValueWithHttpInfo(UUID environmentId, Integer settingId, List jsonPatchOperation, String reason) throws ApiException { - okhttp3.Call localVarCall = updateSettingValueValidateBeforeCall(environmentId, settingId, jsonPatchOperation, reason, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update value (asynchronously) - * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/value\", \"value\": true } ] ``` Only the default value is going to be set to `true` and all the Percentage Rules are remaining unchanged. So we get a response like this: ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": true } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param jsonPatchOperation (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - - -
Status Code Description Response Headers
200 When the patch was successful. -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateSettingValueAsync(UUID environmentId, Integer settingId, List jsonPatchOperation, String reason, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateSettingValueValidateBeforeCall(environmentId, settingId, jsonPatchOperation, reason, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyApi.java b/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyApi.java deleted file mode 100644 index d77443d..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyApi.java +++ /dev/null @@ -1,550 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.api; - -import com.configcat.publicapi.java.client.ApiCallback; -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.ApiResponse; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.Pair; -import com.configcat.publicapi.java.client.ProgressRequestBody; -import com.configcat.publicapi.java.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.configcat.publicapi.java.client.model.JsonPatchOperation; -import com.configcat.publicapi.java.client.model.SettingValueModel; -import com.configcat.publicapi.java.client.model.UpdateSettingValueModel; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class FeatureFlagSettingValuesUsingSdkKeyApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public FeatureFlagSettingValuesUsingSdkKeyApi() { - this(Configuration.getDefaultApiClient()); - } - - public FeatureFlagSettingValuesUsingSdkKeyApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for getSettingValueBySdkkey - * @param settingKeyOrId The key or id of the Setting. (required) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSettingValueBySdkkeyCall(String settingKeyOrId, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/settings/{settingKeyOrId}/value" - .replace("{" + "settingKeyOrId" + "}", localVarApiClient.escapeString(settingKeyOrId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (X_CONFIGCAT_SDKKEY != null) { - localVarHeaderParams.put("X-CONFIGCAT-SDKKEY", localVarApiClient.parameterToString(X_CONFIGCAT_SDKKEY)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getSettingValueBySdkkeyValidateBeforeCall(String settingKeyOrId, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'settingKeyOrId' is set - if (settingKeyOrId == null) { - throw new ApiException("Missing the required parameter 'settingKeyOrId' when calling getSettingValueBySdkkey(Async)"); - } - - return getSettingValueBySdkkeyCall(settingKeyOrId, X_CONFIGCAT_SDKKEY, _callback); - - } - - /** - * Get value - * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). - * @param settingKeyOrId The key or id of the Setting. (required) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @return SettingValueModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public SettingValueModel getSettingValueBySdkkey(String settingKeyOrId, String X_CONFIGCAT_SDKKEY) throws ApiException { - ApiResponse localVarResp = getSettingValueBySdkkeyWithHttpInfo(settingKeyOrId, X_CONFIGCAT_SDKKEY); - return localVarResp.getData(); - } - - /** - * Get value - * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). - * @param settingKeyOrId The key or id of the Setting. (required) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @return ApiResponse<SettingValueModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse getSettingValueBySdkkeyWithHttpInfo(String settingKeyOrId, String X_CONFIGCAT_SDKKEY) throws ApiException { - okhttp3.Call localVarCall = getSettingValueBySdkkeyValidateBeforeCall(settingKeyOrId, X_CONFIGCAT_SDKKEY, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get value (asynchronously) - * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). - * @param settingKeyOrId The key or id of the Setting. (required) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSettingValueBySdkkeyAsync(String settingKeyOrId, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getSettingValueBySdkkeyValidateBeforeCall(settingKeyOrId, X_CONFIGCAT_SDKKEY, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for replaceSettingValueBySdkkey - * @param settingKeyOrId The key or id of the Setting. (required) - * @param updateSettingValueModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call replaceSettingValueBySdkkeyCall(String settingKeyOrId, UpdateSettingValueModel updateSettingValueModel, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updateSettingValueModel; - - // create path and map variables - String localVarPath = "/v1/settings/{settingKeyOrId}/value" - .replace("{" + "settingKeyOrId" + "}", localVarApiClient.escapeString(settingKeyOrId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (reason != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); - } - - if (X_CONFIGCAT_SDKKEY != null) { - localVarHeaderParams.put("X-CONFIGCAT-SDKKEY", localVarApiClient.parameterToString(X_CONFIGCAT_SDKKEY)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call replaceSettingValueBySdkkeyValidateBeforeCall(String settingKeyOrId, UpdateSettingValueModel updateSettingValueModel, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'settingKeyOrId' is set - if (settingKeyOrId == null) { - throw new ApiException("Missing the required parameter 'settingKeyOrId' when calling replaceSettingValueBySdkkey(Async)"); - } - - // verify the required parameter 'updateSettingValueModel' is set - if (updateSettingValueModel == null) { - throw new ApiException("Missing the required parameter 'updateSettingValueModel' when calling replaceSettingValueBySdkkey(Async)"); - } - - return replaceSettingValueBySdkkeyCall(settingKeyOrId, updateSettingValueModel, reason, X_CONFIGCAT_SDKKEY, _callback); - - } - - /** - * Replace value - * This endpoint replaces the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send a replace request body as below: ```json { \"value\": true } ``` Then besides that the default served value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true } ``` - * @param settingKeyOrId The key or id of the Setting. (required) - * @param updateSettingValueModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @return SettingValueModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public SettingValueModel replaceSettingValueBySdkkey(String settingKeyOrId, UpdateSettingValueModel updateSettingValueModel, String reason, String X_CONFIGCAT_SDKKEY) throws ApiException { - ApiResponse localVarResp = replaceSettingValueBySdkkeyWithHttpInfo(settingKeyOrId, updateSettingValueModel, reason, X_CONFIGCAT_SDKKEY); - return localVarResp.getData(); - } - - /** - * Replace value - * This endpoint replaces the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send a replace request body as below: ```json { \"value\": true } ``` Then besides that the default served value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true } ``` - * @param settingKeyOrId The key or id of the Setting. (required) - * @param updateSettingValueModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @return ApiResponse<SettingValueModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse replaceSettingValueBySdkkeyWithHttpInfo(String settingKeyOrId, UpdateSettingValueModel updateSettingValueModel, String reason, String X_CONFIGCAT_SDKKEY) throws ApiException { - okhttp3.Call localVarCall = replaceSettingValueBySdkkeyValidateBeforeCall(settingKeyOrId, updateSettingValueModel, reason, X_CONFIGCAT_SDKKEY, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Replace value (asynchronously) - * This endpoint replaces the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send a replace request body as below: ```json { \"value\": true } ``` Then besides that the default served value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true } ``` - * @param settingKeyOrId The key or id of the Setting. (required) - * @param updateSettingValueModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call replaceSettingValueBySdkkeyAsync(String settingKeyOrId, UpdateSettingValueModel updateSettingValueModel, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = replaceSettingValueBySdkkeyValidateBeforeCall(settingKeyOrId, updateSettingValueModel, reason, X_CONFIGCAT_SDKKEY, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for updateSettingValueBySdkkey - * @param settingKeyOrId The key or id of the Setting. (required) - * @param jsonPatchOperation (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - - -
Status Code Description Response Headers
200 -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateSettingValueBySdkkeyCall(String settingKeyOrId, List jsonPatchOperation, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = jsonPatchOperation; - - // create path and map variables - String localVarPath = "/v1/settings/{settingKeyOrId}/value" - .replace("{" + "settingKeyOrId" + "}", localVarApiClient.escapeString(settingKeyOrId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (reason != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); - } - - if (X_CONFIGCAT_SDKKEY != null) { - localVarHeaderParams.put("X-CONFIGCAT-SDKKEY", localVarApiClient.parameterToString(X_CONFIGCAT_SDKKEY)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateSettingValueBySdkkeyValidateBeforeCall(String settingKeyOrId, List jsonPatchOperation, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'settingKeyOrId' is set - if (settingKeyOrId == null) { - throw new ApiException("Missing the required parameter 'settingKeyOrId' when calling updateSettingValueBySdkkey(Async)"); - } - - // verify the required parameter 'jsonPatchOperation' is set - if (jsonPatchOperation == null) { - throw new ApiException("Missing the required parameter 'jsonPatchOperation' when calling updateSettingValueBySdkkey(Async)"); - } - - return updateSettingValueBySdkkeyCall(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY, _callback); - - } - - /** - * Update value - * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/value\", \"value\": true } ] ``` Only the default served value is going to be set to `true` and all the Percentage Rules are remaining unchanged. So we get a response like this: ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": true } ``` - * @param settingKeyOrId The key or id of the Setting. (required) - * @param jsonPatchOperation (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @return SettingValueModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - -
Status Code Description Response Headers
200 -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public SettingValueModel updateSettingValueBySdkkey(String settingKeyOrId, List jsonPatchOperation, String reason, String X_CONFIGCAT_SDKKEY) throws ApiException { - ApiResponse localVarResp = updateSettingValueBySdkkeyWithHttpInfo(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY); - return localVarResp.getData(); - } - - /** - * Update value - * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/value\", \"value\": true } ] ``` Only the default served value is going to be set to `true` and all the Percentage Rules are remaining unchanged. So we get a response like this: ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": true } ``` - * @param settingKeyOrId The key or id of the Setting. (required) - * @param jsonPatchOperation (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @return ApiResponse<SettingValueModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - -
Status Code Description Response Headers
200 -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse updateSettingValueBySdkkeyWithHttpInfo(String settingKeyOrId, List jsonPatchOperation, String reason, String X_CONFIGCAT_SDKKEY) throws ApiException { - okhttp3.Call localVarCall = updateSettingValueBySdkkeyValidateBeforeCall(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update value (asynchronously) - * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/value\", \"value\": true } ] ``` Only the default served value is going to be set to `true` and all the Percentage Rules are remaining unchanged. So we get a response like this: ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": true } ``` - * @param settingKeyOrId The key or id of the Setting. (required) - * @param jsonPatchOperation (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - - -
Status Code Description Response Headers
200 -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateSettingValueBySdkkeyAsync(String settingKeyOrId, List jsonPatchOperation, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateSettingValueBySdkkeyValidateBeforeCall(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyV2Api.java b/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyV2Api.java deleted file mode 100644 index 85149f8..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyV2Api.java +++ /dev/null @@ -1,550 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.api; - -import com.configcat.publicapi.java.client.ApiCallback; -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.ApiResponse; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.Pair; -import com.configcat.publicapi.java.client.ProgressRequestBody; -import com.configcat.publicapi.java.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.configcat.publicapi.java.client.model.JsonPatchOperation; -import com.configcat.publicapi.java.client.model.SettingFormulaModel; -import com.configcat.publicapi.java.client.model.UpdateEvaluationFormulaModel; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class FeatureFlagSettingValuesUsingSdkKeyV2Api { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public FeatureFlagSettingValuesUsingSdkKeyV2Api() { - this(Configuration.getDefaultApiClient()); - } - - public FeatureFlagSettingValuesUsingSdkKeyV2Api(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for getSettingValueBySdkkeyV2 - * @param settingKeyOrId The key or id of the Setting. (required) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSettingValueBySdkkeyV2Call(String settingKeyOrId, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/settings/{settingKeyOrId}/value" - .replace("{" + "settingKeyOrId" + "}", localVarApiClient.escapeString(settingKeyOrId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (X_CONFIGCAT_SDKKEY != null) { - localVarHeaderParams.put("X-CONFIGCAT-SDKKEY", localVarApiClient.parameterToString(X_CONFIGCAT_SDKKEY)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getSettingValueBySdkkeyV2ValidateBeforeCall(String settingKeyOrId, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'settingKeyOrId' is set - if (settingKeyOrId == null) { - throw new ApiException("Missing the required parameter 'settingKeyOrId' when calling getSettingValueBySdkkeyV2(Async)"); - } - - return getSettingValueBySdkkeyV2Call(settingKeyOrId, X_CONFIGCAT_SDKKEY, _callback); - - } - - /** - * Get value - * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. The most important fields in the response are the `defaultValue`, `targetingRules`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used at the [percentage evaluation](https://configcat.com/docs/advanced/targeting/#anatomy-of-the-percentage-based-targeting) of the Feature Flag or Setting. - * @param settingKeyOrId The key or id of the Setting. (required) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @return SettingFormulaModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public SettingFormulaModel getSettingValueBySdkkeyV2(String settingKeyOrId, String X_CONFIGCAT_SDKKEY) throws ApiException { - ApiResponse localVarResp = getSettingValueBySdkkeyV2WithHttpInfo(settingKeyOrId, X_CONFIGCAT_SDKKEY); - return localVarResp.getData(); - } - - /** - * Get value - * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. The most important fields in the response are the `defaultValue`, `targetingRules`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used at the [percentage evaluation](https://configcat.com/docs/advanced/targeting/#anatomy-of-the-percentage-based-targeting) of the Feature Flag or Setting. - * @param settingKeyOrId The key or id of the Setting. (required) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @return ApiResponse<SettingFormulaModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse getSettingValueBySdkkeyV2WithHttpInfo(String settingKeyOrId, String X_CONFIGCAT_SDKKEY) throws ApiException { - okhttp3.Call localVarCall = getSettingValueBySdkkeyV2ValidateBeforeCall(settingKeyOrId, X_CONFIGCAT_SDKKEY, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get value (asynchronously) - * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. The most important fields in the response are the `defaultValue`, `targetingRules`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used at the [percentage evaluation](https://configcat.com/docs/advanced/targeting/#anatomy-of-the-percentage-based-targeting) of the Feature Flag or Setting. - * @param settingKeyOrId The key or id of the Setting. (required) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSettingValueBySdkkeyV2Async(String settingKeyOrId, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getSettingValueBySdkkeyV2ValidateBeforeCall(settingKeyOrId, X_CONFIGCAT_SDKKEY, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for replaceSettingValueBySdkkeyV2 - * @param settingKeyOrId The key or id of the Setting. (required) - * @param updateEvaluationFormulaModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call replaceSettingValueBySdkkeyV2Call(String settingKeyOrId, UpdateEvaluationFormulaModel updateEvaluationFormulaModel, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updateEvaluationFormulaModel; - - // create path and map variables - String localVarPath = "/v2/settings/{settingKeyOrId}/value" - .replace("{" + "settingKeyOrId" + "}", localVarApiClient.escapeString(settingKeyOrId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (reason != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); - } - - if (X_CONFIGCAT_SDKKEY != null) { - localVarHeaderParams.put("X-CONFIGCAT-SDKKEY", localVarApiClient.parameterToString(X_CONFIGCAT_SDKKEY)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call replaceSettingValueBySdkkeyV2ValidateBeforeCall(String settingKeyOrId, UpdateEvaluationFormulaModel updateEvaluationFormulaModel, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'settingKeyOrId' is set - if (settingKeyOrId == null) { - throw new ApiException("Missing the required parameter 'settingKeyOrId' when calling replaceSettingValueBySdkkeyV2(Async)"); - } - - // verify the required parameter 'updateEvaluationFormulaModel' is set - if (updateEvaluationFormulaModel == null) { - throw new ApiException("Missing the required parameter 'updateEvaluationFormulaModel' when calling replaceSettingValueBySdkkeyV2(Async)"); - } - - return replaceSettingValueBySdkkeyV2Call(settingKeyOrId, updateEvaluationFormulaModel, reason, X_CONFIGCAT_SDKKEY, _callback); - - } - - /** - * Replace value - * This endpoint replaces the value and the Targeting Rules of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other field that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send a replace request body as below: ```json { \"defaultValue\": { \"boolValue\": true } } ``` Then besides that the default served value is set to `true`, all the Targeting Rules are deleted. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": true }, \"targetingRules\": [] } ``` - * @param settingKeyOrId The key or id of the Setting. (required) - * @param updateEvaluationFormulaModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @return SettingFormulaModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public SettingFormulaModel replaceSettingValueBySdkkeyV2(String settingKeyOrId, UpdateEvaluationFormulaModel updateEvaluationFormulaModel, String reason, String X_CONFIGCAT_SDKKEY) throws ApiException { - ApiResponse localVarResp = replaceSettingValueBySdkkeyV2WithHttpInfo(settingKeyOrId, updateEvaluationFormulaModel, reason, X_CONFIGCAT_SDKKEY); - return localVarResp.getData(); - } - - /** - * Replace value - * This endpoint replaces the value and the Targeting Rules of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other field that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send a replace request body as below: ```json { \"defaultValue\": { \"boolValue\": true } } ``` Then besides that the default served value is set to `true`, all the Targeting Rules are deleted. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": true }, \"targetingRules\": [] } ``` - * @param settingKeyOrId The key or id of the Setting. (required) - * @param updateEvaluationFormulaModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @return ApiResponse<SettingFormulaModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse replaceSettingValueBySdkkeyV2WithHttpInfo(String settingKeyOrId, UpdateEvaluationFormulaModel updateEvaluationFormulaModel, String reason, String X_CONFIGCAT_SDKKEY) throws ApiException { - okhttp3.Call localVarCall = replaceSettingValueBySdkkeyV2ValidateBeforeCall(settingKeyOrId, updateEvaluationFormulaModel, reason, X_CONFIGCAT_SDKKEY, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Replace value (asynchronously) - * This endpoint replaces the value and the Targeting Rules of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other field that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send a replace request body as below: ```json { \"defaultValue\": { \"boolValue\": true } } ``` Then besides that the default served value is set to `true`, all the Targeting Rules are deleted. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": true }, \"targetingRules\": [] } ``` - * @param settingKeyOrId The key or id of the Setting. (required) - * @param updateEvaluationFormulaModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call replaceSettingValueBySdkkeyV2Async(String settingKeyOrId, UpdateEvaluationFormulaModel updateEvaluationFormulaModel, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = replaceSettingValueBySdkkeyV2ValidateBeforeCall(settingKeyOrId, updateEvaluationFormulaModel, reason, X_CONFIGCAT_SDKKEY, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for updateSettingValueBySdkkeyV2 - * @param settingKeyOrId The key or id of the Setting. (required) - * @param jsonPatchOperation (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - - -
Status Code Description Response Headers
200 -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateSettingValueBySdkkeyV2Call(String settingKeyOrId, List jsonPatchOperation, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = jsonPatchOperation; - - // create path and map variables - String localVarPath = "/v2/settings/{settingKeyOrId}/value" - .replace("{" + "settingKeyOrId" + "}", localVarApiClient.escapeString(settingKeyOrId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (reason != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); - } - - if (X_CONFIGCAT_SDKKEY != null) { - localVarHeaderParams.put("X-CONFIGCAT-SDKKEY", localVarApiClient.parameterToString(X_CONFIGCAT_SDKKEY)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateSettingValueBySdkkeyV2ValidateBeforeCall(String settingKeyOrId, List jsonPatchOperation, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'settingKeyOrId' is set - if (settingKeyOrId == null) { - throw new ApiException("Missing the required parameter 'settingKeyOrId' when calling updateSettingValueBySdkkeyV2(Async)"); - } - - // verify the required parameter 'jsonPatchOperation' is set - if (jsonPatchOperation == null) { - throw new ApiException("Missing the required parameter 'jsonPatchOperation' when calling updateSettingValueBySdkkeyV2(Async)"); - } - - return updateSettingValueBySdkkeyV2Call(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY, _callback); - - } - - /** - * Update value - * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/targetingRules/0/value/boolValue\", \"value\": true } ] ``` Only the first Targeting Rule's `value` is going to be set to `false` and all the other fields are remaining unchanged. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": false } } ] } ``` - * @param settingKeyOrId The key or id of the Setting. (required) - * @param jsonPatchOperation (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @return SettingFormulaModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - -
Status Code Description Response Headers
200 -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public SettingFormulaModel updateSettingValueBySdkkeyV2(String settingKeyOrId, List jsonPatchOperation, String reason, String X_CONFIGCAT_SDKKEY) throws ApiException { - ApiResponse localVarResp = updateSettingValueBySdkkeyV2WithHttpInfo(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY); - return localVarResp.getData(); - } - - /** - * Update value - * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/targetingRules/0/value/boolValue\", \"value\": true } ] ``` Only the first Targeting Rule's `value` is going to be set to `false` and all the other fields are remaining unchanged. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": false } } ] } ``` - * @param settingKeyOrId The key or id of the Setting. (required) - * @param jsonPatchOperation (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @return ApiResponse<SettingFormulaModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - -
Status Code Description Response Headers
200 -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse updateSettingValueBySdkkeyV2WithHttpInfo(String settingKeyOrId, List jsonPatchOperation, String reason, String X_CONFIGCAT_SDKKEY) throws ApiException { - okhttp3.Call localVarCall = updateSettingValueBySdkkeyV2ValidateBeforeCall(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update value (asynchronously) - * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/targetingRules/0/value/boolValue\", \"value\": true } ] ``` Only the first Targeting Rule's `value` is going to be set to `false` and all the other fields are remaining unchanged. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": false } } ] } ``` - * @param settingKeyOrId The key or id of the Setting. (required) - * @param jsonPatchOperation (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - - -
Status Code Description Response Headers
200 -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateSettingValueBySdkkeyV2Async(String settingKeyOrId, List jsonPatchOperation, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateSettingValueBySdkkeyV2ValidateBeforeCall(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesV2Api.java b/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesV2Api.java deleted file mode 100644 index 9009b3d..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesV2Api.java +++ /dev/null @@ -1,869 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.api; - -import com.configcat.publicapi.java.client.ApiCallback; -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.ApiResponse; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.Pair; -import com.configcat.publicapi.java.client.ProgressRequestBody; -import com.configcat.publicapi.java.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.configcat.publicapi.java.client.model.ConfigSettingFormulasModel; -import com.configcat.publicapi.java.client.model.JsonPatchOperation; -import com.configcat.publicapi.java.client.model.SettingFormulaModel; -import java.util.UUID; -import com.configcat.publicapi.java.client.model.UpdateEvaluationFormulaModel; -import com.configcat.publicapi.java.client.model.UpdateEvaluationFormulasModel; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class FeatureFlagSettingValuesV2Api { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public FeatureFlagSettingValuesV2Api() { - this(Configuration.getDefaultApiClient()); - } - - public FeatureFlagSettingValuesV2Api(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for getSettingValueV2 - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the setting value data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSettingValueV2Call(UUID environmentId, Integer settingId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/environments/{environmentId}/settings/{settingId}/value" - .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())) - .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getSettingValueV2ValidateBeforeCall(UUID environmentId, Integer settingId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'environmentId' is set - if (environmentId == null) { - throw new ApiException("Missing the required parameter 'environmentId' when calling getSettingValueV2(Async)"); - } - - // verify the required parameter 'settingId' is set - if (settingId == null) { - throw new ApiException("Missing the required parameter 'settingId' when calling getSettingValueV2(Async)"); - } - - return getSettingValueV2Call(environmentId, settingId, _callback); - - } - - /** - * Get value - * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the `environmentId` parameter. The most important fields in the response are the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used for [percentage evaluation](https://configcat.com/docs/targeting/percentage-options/) of the Feature Flag or Setting. - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @return SettingFormulaModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the setting value data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public SettingFormulaModel getSettingValueV2(UUID environmentId, Integer settingId) throws ApiException { - ApiResponse localVarResp = getSettingValueV2WithHttpInfo(environmentId, settingId); - return localVarResp.getData(); - } - - /** - * Get value - * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the `environmentId` parameter. The most important fields in the response are the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used for [percentage evaluation](https://configcat.com/docs/targeting/percentage-options/) of the Feature Flag or Setting. - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @return ApiResponse<SettingFormulaModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the setting value data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse getSettingValueV2WithHttpInfo(UUID environmentId, Integer settingId) throws ApiException { - okhttp3.Call localVarCall = getSettingValueV2ValidateBeforeCall(environmentId, settingId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get value (asynchronously) - * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the `environmentId` parameter. The most important fields in the response are the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used for [percentage evaluation](https://configcat.com/docs/targeting/percentage-options/) of the Feature Flag or Setting. - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the setting value data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSettingValueV2Async(UUID environmentId, Integer settingId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getSettingValueV2ValidateBeforeCall(environmentId, settingId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getSettingValuesV2 - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSettingValuesV2Call(UUID configId, UUID environmentId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/configs/{configId}/environments/{environmentId}/values" - .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())) - .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getSettingValuesV2ValidateBeforeCall(UUID configId, UUID environmentId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'configId' is set - if (configId == null) { - throw new ApiException("Missing the required parameter 'configId' when calling getSettingValuesV2(Async)"); - } - - // verify the required parameter 'environmentId' is set - if (environmentId == null) { - throw new ApiException("Missing the required parameter 'environmentId' when calling getSettingValuesV2(Async)"); - } - - return getSettingValuesV2Call(configId, environmentId, _callback); - - } - - /** - * Get values - * This endpoint returns all Feature Flag and Setting values of a Config identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. The most important fields in the response are the `defaultValue`, `targetingRules`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used for [percentage evaluation](https://configcat.com/docs/targeting/percentage-options/) of the Feature Flag or Setting. - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @return ConfigSettingFormulasModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ConfigSettingFormulasModel getSettingValuesV2(UUID configId, UUID environmentId) throws ApiException { - ApiResponse localVarResp = getSettingValuesV2WithHttpInfo(configId, environmentId); - return localVarResp.getData(); - } - - /** - * Get values - * This endpoint returns all Feature Flag and Setting values of a Config identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. The most important fields in the response are the `defaultValue`, `targetingRules`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used for [percentage evaluation](https://configcat.com/docs/targeting/percentage-options/) of the Feature Flag or Setting. - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @return ApiResponse<ConfigSettingFormulasModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse getSettingValuesV2WithHttpInfo(UUID configId, UUID environmentId) throws ApiException { - okhttp3.Call localVarCall = getSettingValuesV2ValidateBeforeCall(configId, environmentId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get values (asynchronously) - * This endpoint returns all Feature Flag and Setting values of a Config identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. The most important fields in the response are the `defaultValue`, `targetingRules`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used for [percentage evaluation](https://configcat.com/docs/targeting/percentage-options/) of the Feature Flag or Setting. - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSettingValuesV2Async(UUID configId, UUID environmentId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getSettingValuesV2ValidateBeforeCall(configId, environmentId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for postSettingValuesV2 - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @param updateEvaluationFormulasModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the updated setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call postSettingValuesV2Call(UUID configId, UUID environmentId, UpdateEvaluationFormulasModel updateEvaluationFormulasModel, String reason, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updateEvaluationFormulasModel; - - // create path and map variables - String localVarPath = "/v2/configs/{configId}/environments/{environmentId}/values" - .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())) - .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (reason != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call postSettingValuesV2ValidateBeforeCall(UUID configId, UUID environmentId, UpdateEvaluationFormulasModel updateEvaluationFormulasModel, String reason, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'configId' is set - if (configId == null) { - throw new ApiException("Missing the required parameter 'configId' when calling postSettingValuesV2(Async)"); - } - - // verify the required parameter 'environmentId' is set - if (environmentId == null) { - throw new ApiException("Missing the required parameter 'environmentId' when calling postSettingValuesV2(Async)"); - } - - // verify the required parameter 'updateEvaluationFormulasModel' is set - if (updateEvaluationFormulasModel == null) { - throw new ApiException("Missing the required parameter 'updateEvaluationFormulasModel' when calling postSettingValuesV2(Async)"); - } - - return postSettingValuesV2Call(configId, environmentId, updateEvaluationFormulasModel, reason, _callback); - - } - - /** - * Post values - * This endpoint batch updates the Feature Flags and Settings of a Config identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. Only those Feature Flags and Settings are updated which are part of the request, all the others are left untouched. **Important:** As this endpoint is doing a complete replace on those Feature Flags and Settings, which are set in the request. It's important to set every other field that you don't want to change in its original state. Not listing a field means that it will reset. For example: We have the following resource of a Feature Flag. ```json { \"settingFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ], \"settingId\": 1 } ] } ``` If we send a batch replace request body as below: ```json { \"updateFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"settingId\": 1 } ] } ``` Then besides that the default value is set to `true`, all Targeting Rules of the related Feature Flag are deleted. So we get a response like this: ```json { \"settingFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [], \"setting\": { \"settingId\": 1 } } ] } ``` - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @param updateEvaluationFormulasModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @return ConfigSettingFormulasModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the updated setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ConfigSettingFormulasModel postSettingValuesV2(UUID configId, UUID environmentId, UpdateEvaluationFormulasModel updateEvaluationFormulasModel, String reason) throws ApiException { - ApiResponse localVarResp = postSettingValuesV2WithHttpInfo(configId, environmentId, updateEvaluationFormulasModel, reason); - return localVarResp.getData(); - } - - /** - * Post values - * This endpoint batch updates the Feature Flags and Settings of a Config identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. Only those Feature Flags and Settings are updated which are part of the request, all the others are left untouched. **Important:** As this endpoint is doing a complete replace on those Feature Flags and Settings, which are set in the request. It's important to set every other field that you don't want to change in its original state. Not listing a field means that it will reset. For example: We have the following resource of a Feature Flag. ```json { \"settingFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ], \"settingId\": 1 } ] } ``` If we send a batch replace request body as below: ```json { \"updateFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"settingId\": 1 } ] } ``` Then besides that the default value is set to `true`, all Targeting Rules of the related Feature Flag are deleted. So we get a response like this: ```json { \"settingFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [], \"setting\": { \"settingId\": 1 } } ] } ``` - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @param updateEvaluationFormulasModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @return ApiResponse<ConfigSettingFormulasModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the updated setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse postSettingValuesV2WithHttpInfo(UUID configId, UUID environmentId, UpdateEvaluationFormulasModel updateEvaluationFormulasModel, String reason) throws ApiException { - okhttp3.Call localVarCall = postSettingValuesV2ValidateBeforeCall(configId, environmentId, updateEvaluationFormulasModel, reason, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Post values (asynchronously) - * This endpoint batch updates the Feature Flags and Settings of a Config identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. Only those Feature Flags and Settings are updated which are part of the request, all the others are left untouched. **Important:** As this endpoint is doing a complete replace on those Feature Flags and Settings, which are set in the request. It's important to set every other field that you don't want to change in its original state. Not listing a field means that it will reset. For example: We have the following resource of a Feature Flag. ```json { \"settingFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ], \"settingId\": 1 } ] } ``` If we send a batch replace request body as below: ```json { \"updateFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"settingId\": 1 } ] } ``` Then besides that the default value is set to `true`, all Targeting Rules of the related Feature Flag are deleted. So we get a response like this: ```json { \"settingFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [], \"setting\": { \"settingId\": 1 } } ] } ``` - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @param updateEvaluationFormulasModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the updated setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call postSettingValuesV2Async(UUID configId, UUID environmentId, UpdateEvaluationFormulasModel updateEvaluationFormulasModel, String reason, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = postSettingValuesV2ValidateBeforeCall(configId, environmentId, updateEvaluationFormulasModel, reason, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for replaceSettingValueV2 - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param updateEvaluationFormulaModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call replaceSettingValueV2Call(UUID environmentId, Integer settingId, UpdateEvaluationFormulaModel updateEvaluationFormulaModel, String reason, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updateEvaluationFormulaModel; - - // create path and map variables - String localVarPath = "/v2/environments/{environmentId}/settings/{settingId}/value" - .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())) - .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (reason != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call replaceSettingValueV2ValidateBeforeCall(UUID environmentId, Integer settingId, UpdateEvaluationFormulaModel updateEvaluationFormulaModel, String reason, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'environmentId' is set - if (environmentId == null) { - throw new ApiException("Missing the required parameter 'environmentId' when calling replaceSettingValueV2(Async)"); - } - - // verify the required parameter 'settingId' is set - if (settingId == null) { - throw new ApiException("Missing the required parameter 'settingId' when calling replaceSettingValueV2(Async)"); - } - - // verify the required parameter 'updateEvaluationFormulaModel' is set - if (updateEvaluationFormulaModel == null) { - throw new ApiException("Missing the required parameter 'updateEvaluationFormulaModel' when calling replaceSettingValueV2(Async)"); - } - - return replaceSettingValueV2Call(environmentId, settingId, updateEvaluationFormulaModel, reason, _callback); - - } - - /** - * Replace value - * This endpoint replaces the value and the Targeting Rules of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other field that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send a replace request body as below: ```json { \"defaultValue\": { \"boolValue\": true } } ``` Then besides that the default served value is set to `true`, all the Targeting Rules are deleted. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": true }, \"targetingRules\": [] } ``` - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param updateEvaluationFormulaModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @return SettingFormulaModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public SettingFormulaModel replaceSettingValueV2(UUID environmentId, Integer settingId, UpdateEvaluationFormulaModel updateEvaluationFormulaModel, String reason) throws ApiException { - ApiResponse localVarResp = replaceSettingValueV2WithHttpInfo(environmentId, settingId, updateEvaluationFormulaModel, reason); - return localVarResp.getData(); - } - - /** - * Replace value - * This endpoint replaces the value and the Targeting Rules of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other field that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send a replace request body as below: ```json { \"defaultValue\": { \"boolValue\": true } } ``` Then besides that the default served value is set to `true`, all the Targeting Rules are deleted. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": true }, \"targetingRules\": [] } ``` - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param updateEvaluationFormulaModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @return ApiResponse<SettingFormulaModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse replaceSettingValueV2WithHttpInfo(UUID environmentId, Integer settingId, UpdateEvaluationFormulaModel updateEvaluationFormulaModel, String reason) throws ApiException { - okhttp3.Call localVarCall = replaceSettingValueV2ValidateBeforeCall(environmentId, settingId, updateEvaluationFormulaModel, reason, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Replace value (asynchronously) - * This endpoint replaces the value and the Targeting Rules of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other field that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send a replace request body as below: ```json { \"defaultValue\": { \"boolValue\": true } } ``` Then besides that the default served value is set to `true`, all the Targeting Rules are deleted. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": true }, \"targetingRules\": [] } ``` - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param updateEvaluationFormulaModel (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call replaceSettingValueV2Async(UUID environmentId, Integer settingId, UpdateEvaluationFormulaModel updateEvaluationFormulaModel, String reason, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = replaceSettingValueV2ValidateBeforeCall(environmentId, settingId, updateEvaluationFormulaModel, reason, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for updateSettingValueV2 - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param jsonPatchOperation (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - - -
Status Code Description Response Headers
200 When the patch was successful. -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateSettingValueV2Call(UUID environmentId, Integer settingId, List jsonPatchOperation, String reason, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = jsonPatchOperation; - - // create path and map variables - String localVarPath = "/v2/environments/{environmentId}/settings/{settingId}/value" - .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())) - .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (reason != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateSettingValueV2ValidateBeforeCall(UUID environmentId, Integer settingId, List jsonPatchOperation, String reason, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'environmentId' is set - if (environmentId == null) { - throw new ApiException("Missing the required parameter 'environmentId' when calling updateSettingValueV2(Async)"); - } - - // verify the required parameter 'settingId' is set - if (settingId == null) { - throw new ApiException("Missing the required parameter 'settingId' when calling updateSettingValueV2(Async)"); - } - - // verify the required parameter 'jsonPatchOperation' is set - if (jsonPatchOperation == null) { - throw new ApiException("Missing the required parameter 'jsonPatchOperation' when calling updateSettingValueV2(Async)"); - } - - return updateSettingValueV2Call(environmentId, settingId, jsonPatchOperation, reason, _callback); - - } - - /** - * Update value - * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/targetingRules/0/value/boolValue\", \"value\": true } ] ``` Only the first Targeting Rule's `value` is going to be set to `false` and all the other fields are remaining unchanged. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": false } } ] } ``` - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param jsonPatchOperation (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @return SettingFormulaModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - -
Status Code Description Response Headers
200 When the patch was successful. -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public SettingFormulaModel updateSettingValueV2(UUID environmentId, Integer settingId, List jsonPatchOperation, String reason) throws ApiException { - ApiResponse localVarResp = updateSettingValueV2WithHttpInfo(environmentId, settingId, jsonPatchOperation, reason); - return localVarResp.getData(); - } - - /** - * Update value - * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/targetingRules/0/value/boolValue\", \"value\": true } ] ``` Only the first Targeting Rule's `value` is going to be set to `false` and all the other fields are remaining unchanged. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": false } } ] } ``` - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param jsonPatchOperation (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @return ApiResponse<SettingFormulaModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - -
Status Code Description Response Headers
200 When the patch was successful. -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse updateSettingValueV2WithHttpInfo(UUID environmentId, Integer settingId, List jsonPatchOperation, String reason) throws ApiException { - okhttp3.Call localVarCall = updateSettingValueV2ValidateBeforeCall(environmentId, settingId, jsonPatchOperation, reason, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update value (asynchronously) - * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/targetingRules/0/value/boolValue\", \"value\": true } ] ``` Only the first Targeting Rule's `value` is going to be set to `false` and all the other fields are remaining unchanged. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": false } } ] } ``` - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param jsonPatchOperation (required) - * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - - -
Status Code Description Response Headers
200 When the patch was successful. -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateSettingValueV2Async(UUID environmentId, Integer settingId, List jsonPatchOperation, String reason, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateSettingValueV2ValidateBeforeCall(environmentId, settingId, jsonPatchOperation, reason, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagsSettingsApi.java b/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagsSettingsApi.java deleted file mode 100644 index 1618212..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagsSettingsApi.java +++ /dev/null @@ -1,920 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.api; - -import com.configcat.publicapi.java.client.ApiCallback; -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.ApiResponse; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.Pair; -import com.configcat.publicapi.java.client.ProgressRequestBody; -import com.configcat.publicapi.java.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.configcat.publicapi.java.client.model.CreateSettingInitialValues; -import com.configcat.publicapi.java.client.model.JsonPatchOperation; -import com.configcat.publicapi.java.client.model.ReplaceSettingModel; -import com.configcat.publicapi.java.client.model.SettingModel; -import java.util.UUID; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class FeatureFlagsSettingsApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public FeatureFlagsSettingsApi() { - this(Configuration.getDefaultApiClient()); - } - - public FeatureFlagsSettingsApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for createSetting - * @param configId The identifier of the Config. (required) - * @param createSettingInitialValues (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call createSettingCall(UUID configId, CreateSettingInitialValues createSettingInitialValues, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = createSettingInitialValues; - - // create path and map variables - String localVarPath = "/v1/configs/{configId}/settings" - .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createSettingValidateBeforeCall(UUID configId, CreateSettingInitialValues createSettingInitialValues, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'configId' is set - if (configId == null) { - throw new ApiException("Missing the required parameter 'configId' when calling createSetting(Async)"); - } - - // verify the required parameter 'createSettingInitialValues' is set - if (createSettingInitialValues == null) { - throw new ApiException("Missing the required parameter 'createSettingInitialValues' when calling createSetting(Async)"); - } - - return createSettingCall(configId, createSettingInitialValues, _callback); - - } - - /** - * Create Flag - * This endpoint creates a new Feature Flag or Setting in a specified Config identified by the `configId` parameter. **Important:** The `key` attribute must be unique within the given Config. - * @param configId The identifier of the Config. (required) - * @param createSettingInitialValues (required) - * @return SettingModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public SettingModel createSetting(UUID configId, CreateSettingInitialValues createSettingInitialValues) throws ApiException { - ApiResponse localVarResp = createSettingWithHttpInfo(configId, createSettingInitialValues); - return localVarResp.getData(); - } - - /** - * Create Flag - * This endpoint creates a new Feature Flag or Setting in a specified Config identified by the `configId` parameter. **Important:** The `key` attribute must be unique within the given Config. - * @param configId The identifier of the Config. (required) - * @param createSettingInitialValues (required) - * @return ApiResponse<SettingModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse createSettingWithHttpInfo(UUID configId, CreateSettingInitialValues createSettingInitialValues) throws ApiException { - okhttp3.Call localVarCall = createSettingValidateBeforeCall(configId, createSettingInitialValues, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create Flag (asynchronously) - * This endpoint creates a new Feature Flag or Setting in a specified Config identified by the `configId` parameter. **Important:** The `key` attribute must be unique within the given Config. - * @param configId The identifier of the Config. (required) - * @param createSettingInitialValues (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call createSettingAsync(UUID configId, CreateSettingInitialValues createSettingInitialValues, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createSettingValidateBeforeCall(configId, createSettingInitialValues, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for deleteSetting - * @param settingId The identifier of the Setting. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteSettingCall(Integer settingId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/settings/{settingId}" - .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteSettingValidateBeforeCall(Integer settingId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'settingId' is set - if (settingId == null) { - throw new ApiException("Missing the required parameter 'settingId' when calling deleteSetting(Async)"); - } - - return deleteSettingCall(settingId, _callback); - - } - - /** - * Delete Flag - * This endpoint removes a Feature Flag or Setting from a specified Config, identified by the `configId` parameter. - * @param settingId The identifier of the Setting. (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public void deleteSetting(Integer settingId) throws ApiException { - deleteSettingWithHttpInfo(settingId); - } - - /** - * Delete Flag - * This endpoint removes a Feature Flag or Setting from a specified Config, identified by the `configId` parameter. - * @param settingId The identifier of the Setting. (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse deleteSettingWithHttpInfo(Integer settingId) throws ApiException { - okhttp3.Call localVarCall = deleteSettingValidateBeforeCall(settingId, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete Flag (asynchronously) - * This endpoint removes a Feature Flag or Setting from a specified Config, identified by the `configId` parameter. - * @param settingId The identifier of the Setting. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteSettingAsync(Integer settingId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deleteSettingValidateBeforeCall(settingId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for getSetting - * @param settingId The identifier of the Setting. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the setting data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSettingCall(Integer settingId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/settings/{settingId}" - .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getSettingValidateBeforeCall(Integer settingId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'settingId' is set - if (settingId == null) { - throw new ApiException("Missing the required parameter 'settingId' when calling getSetting(Async)"); - } - - return getSettingCall(settingId, _callback); - - } - - /** - * Get Flag - * This endpoint returns the metadata attributes of a Feature Flag or Setting identified by the `settingId` parameter. - * @param settingId The identifier of the Setting. (required) - * @return SettingModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the setting data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public SettingModel getSetting(Integer settingId) throws ApiException { - ApiResponse localVarResp = getSettingWithHttpInfo(settingId); - return localVarResp.getData(); - } - - /** - * Get Flag - * This endpoint returns the metadata attributes of a Feature Flag or Setting identified by the `settingId` parameter. - * @param settingId The identifier of the Setting. (required) - * @return ApiResponse<SettingModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the setting data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse getSettingWithHttpInfo(Integer settingId) throws ApiException { - okhttp3.Call localVarCall = getSettingValidateBeforeCall(settingId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Flag (asynchronously) - * This endpoint returns the metadata attributes of a Feature Flag or Setting identified by the `settingId` parameter. - * @param settingId The identifier of the Setting. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the setting data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSettingAsync(Integer settingId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getSettingValidateBeforeCall(settingId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getSettings - * @param configId The identifier of the Config. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSettingsCall(UUID configId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/configs/{configId}/settings" - .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getSettingsValidateBeforeCall(UUID configId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'configId' is set - if (configId == null) { - throw new ApiException("Missing the required parameter 'configId' when calling getSettings(Async)"); - } - - return getSettingsCall(configId, _callback); - - } - - /** - * List Flags - * This endpoint returns the list of the Feature Flags and Settings defined in a specified Config, identified by the `configId` parameter. - * @param configId The identifier of the Config. (required) - * @return List<SettingModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public List getSettings(UUID configId) throws ApiException { - ApiResponse> localVarResp = getSettingsWithHttpInfo(configId); - return localVarResp.getData(); - } - - /** - * List Flags - * This endpoint returns the list of the Feature Flags and Settings defined in a specified Config, identified by the `configId` parameter. - * @param configId The identifier of the Config. (required) - * @return ApiResponse<List<SettingModel>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse> getSettingsWithHttpInfo(UUID configId) throws ApiException { - okhttp3.Call localVarCall = getSettingsValidateBeforeCall(configId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Flags (asynchronously) - * This endpoint returns the list of the Feature Flags and Settings defined in a specified Config, identified by the `configId` parameter. - * @param configId The identifier of the Config. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSettingsAsync(UUID configId, final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = getSettingsValidateBeforeCall(configId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for replaceSetting - * @param settingId The identifier of the Setting. (required) - * @param replaceSettingModel (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the replace was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call replaceSettingCall(Integer settingId, ReplaceSettingModel replaceSettingModel, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = replaceSettingModel; - - // create path and map variables - String localVarPath = "/v1/settings/{settingId}" - .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call replaceSettingValidateBeforeCall(Integer settingId, ReplaceSettingModel replaceSettingModel, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'settingId' is set - if (settingId == null) { - throw new ApiException("Missing the required parameter 'settingId' when calling replaceSetting(Async)"); - } - - // verify the required parameter 'replaceSettingModel' is set - if (replaceSettingModel == null) { - throw new ApiException("Missing the required parameter 'replaceSettingModel' when calling replaceSetting(Async)"); - } - - return replaceSettingCall(settingId, replaceSettingModel, _callback); - - } - - /** - * Replace Flag - * This endpoint replaces the whole value of a Feature Flag or Setting identified by the `settingId` parameter. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. - * @param settingId The identifier of the Setting. (required) - * @param replaceSettingModel (required) - * @return SettingModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the replace was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public SettingModel replaceSetting(Integer settingId, ReplaceSettingModel replaceSettingModel) throws ApiException { - ApiResponse localVarResp = replaceSettingWithHttpInfo(settingId, replaceSettingModel); - return localVarResp.getData(); - } - - /** - * Replace Flag - * This endpoint replaces the whole value of a Feature Flag or Setting identified by the `settingId` parameter. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. - * @param settingId The identifier of the Setting. (required) - * @param replaceSettingModel (required) - * @return ApiResponse<SettingModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the replace was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse replaceSettingWithHttpInfo(Integer settingId, ReplaceSettingModel replaceSettingModel) throws ApiException { - okhttp3.Call localVarCall = replaceSettingValidateBeforeCall(settingId, replaceSettingModel, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Replace Flag (asynchronously) - * This endpoint replaces the whole value of a Feature Flag or Setting identified by the `settingId` parameter. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. - * @param settingId The identifier of the Setting. (required) - * @param replaceSettingModel (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the replace was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call replaceSettingAsync(Integer settingId, ReplaceSettingModel replaceSettingModel, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = replaceSettingValidateBeforeCall(settingId, replaceSettingModel, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for updateSetting - * @param settingId The identifier of the Setting. (required) - * @param jsonPatchOperation (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateSettingCall(Integer settingId, List jsonPatchOperation, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = jsonPatchOperation; - - // create path and map variables - String localVarPath = "/v1/settings/{settingId}" - .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateSettingValidateBeforeCall(Integer settingId, List jsonPatchOperation, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'settingId' is set - if (settingId == null) { - throw new ApiException("Missing the required parameter 'settingId' when calling updateSetting(Async)"); - } - - // verify the required parameter 'jsonPatchOperation' is set - if (jsonPatchOperation == null) { - throw new ApiException("Missing the required parameter 'jsonPatchOperation' when calling updateSetting(Async)"); - } - - return updateSettingCall(settingId, jsonPatchOperation, _callback); - - } - - /** - * Update Flag - * This endpoint updates the metadata of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Config. Only the `name`, `hint` and `tags` attributes are modifiable by this endpoint. The `tags` attribute is a simple collection of the [tag IDs](#operation/get-tags) attached to the given setting. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. For example: We have the following resource. ```json { \"settingId\": 5345, \"key\": \"myGrandFeature\", \"name\": \"Tihs is a naem with soem typos.\", \"hint\": \"This flag controls my grandioso feature.\", \"settingType\": \"boolean\", \"tags\": [ { \"tagId\": 0, \"name\": \"sample tag\", \"color\": \"whale\" } ] } ``` If we send an update request body as below (it changes the `name` and adds the already existing tag with the id `2`): ```json [ { \"op\": \"replace\", \"path\": \"/name\", \"value\": \"This is the name without typos.\" }, { \"op\": \"add\", \"path\": \"/tags/-\", \"value\": 2 } ] ``` Only the `name` and `tags` are updated and all the other attributes remain unchanged. So we get a response like this: ```json { \"settingId\": 5345, \"key\": \"myGrandFeature\", \"name\": \"This is the name without typos.\", \"hint\": \"This flag controls my grandioso feature.\", \"settingType\": \"boolean\", \"tags\": [ { \"tagId\": 0, \"name\": \"sample tag\", \"color\": \"whale\" }, { \"tagId\": 2, \"name\": \"another tag\", \"color\": \"koala\" } ] } ``` - * @param settingId The identifier of the Setting. (required) - * @param jsonPatchOperation (required) - * @return SettingModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public SettingModel updateSetting(Integer settingId, List jsonPatchOperation) throws ApiException { - ApiResponse localVarResp = updateSettingWithHttpInfo(settingId, jsonPatchOperation); - return localVarResp.getData(); - } - - /** - * Update Flag - * This endpoint updates the metadata of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Config. Only the `name`, `hint` and `tags` attributes are modifiable by this endpoint. The `tags` attribute is a simple collection of the [tag IDs](#operation/get-tags) attached to the given setting. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. For example: We have the following resource. ```json { \"settingId\": 5345, \"key\": \"myGrandFeature\", \"name\": \"Tihs is a naem with soem typos.\", \"hint\": \"This flag controls my grandioso feature.\", \"settingType\": \"boolean\", \"tags\": [ { \"tagId\": 0, \"name\": \"sample tag\", \"color\": \"whale\" } ] } ``` If we send an update request body as below (it changes the `name` and adds the already existing tag with the id `2`): ```json [ { \"op\": \"replace\", \"path\": \"/name\", \"value\": \"This is the name without typos.\" }, { \"op\": \"add\", \"path\": \"/tags/-\", \"value\": 2 } ] ``` Only the `name` and `tags` are updated and all the other attributes remain unchanged. So we get a response like this: ```json { \"settingId\": 5345, \"key\": \"myGrandFeature\", \"name\": \"This is the name without typos.\", \"hint\": \"This flag controls my grandioso feature.\", \"settingType\": \"boolean\", \"tags\": [ { \"tagId\": 0, \"name\": \"sample tag\", \"color\": \"whale\" }, { \"tagId\": 2, \"name\": \"another tag\", \"color\": \"koala\" } ] } ``` - * @param settingId The identifier of the Setting. (required) - * @param jsonPatchOperation (required) - * @return ApiResponse<SettingModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse updateSettingWithHttpInfo(Integer settingId, List jsonPatchOperation) throws ApiException { - okhttp3.Call localVarCall = updateSettingValidateBeforeCall(settingId, jsonPatchOperation, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update Flag (asynchronously) - * This endpoint updates the metadata of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Config. Only the `name`, `hint` and `tags` attributes are modifiable by this endpoint. The `tags` attribute is a simple collection of the [tag IDs](#operation/get-tags) attached to the given setting. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. For example: We have the following resource. ```json { \"settingId\": 5345, \"key\": \"myGrandFeature\", \"name\": \"Tihs is a naem with soem typos.\", \"hint\": \"This flag controls my grandioso feature.\", \"settingType\": \"boolean\", \"tags\": [ { \"tagId\": 0, \"name\": \"sample tag\", \"color\": \"whale\" } ] } ``` If we send an update request body as below (it changes the `name` and adds the already existing tag with the id `2`): ```json [ { \"op\": \"replace\", \"path\": \"/name\", \"value\": \"This is the name without typos.\" }, { \"op\": \"add\", \"path\": \"/tags/-\", \"value\": 2 } ] ``` Only the `name` and `tags` are updated and all the other attributes remain unchanged. So we get a response like this: ```json { \"settingId\": 5345, \"key\": \"myGrandFeature\", \"name\": \"This is the name without typos.\", \"hint\": \"This flag controls my grandioso feature.\", \"settingType\": \"boolean\", \"tags\": [ { \"tagId\": 0, \"name\": \"sample tag\", \"color\": \"whale\" }, { \"tagId\": 2, \"name\": \"another tag\", \"color\": \"koala\" } ] } ``` - * @param settingId The identifier of the Setting. (required) - * @param jsonPatchOperation (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateSettingAsync(Integer settingId, List jsonPatchOperation, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateSettingValidateBeforeCall(settingId, jsonPatchOperation, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/IntegrationLinksApi.java b/src/main/java/com/configcat/publicapi/java/client/api/IntegrationLinksApi.java deleted file mode 100644 index 21cff99..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/api/IntegrationLinksApi.java +++ /dev/null @@ -1,845 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.api; - -import com.configcat.publicapi.java.client.ApiCallback; -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.ApiResponse; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.Pair; -import com.configcat.publicapi.java.client.ProgressRequestBody; -import com.configcat.publicapi.java.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.configcat.publicapi.java.client.model.AddOrUpdateIntegrationLinkModel; -import com.configcat.publicapi.java.client.model.AddOrUpdateJiraIntegrationLinkModel; -import com.configcat.publicapi.java.client.model.ConnectRequest; -import com.configcat.publicapi.java.client.model.DeleteIntegrationLinkModel; -import com.configcat.publicapi.java.client.model.IntegrationLinkDetailsModel; -import com.configcat.publicapi.java.client.model.IntegrationLinkModel; -import com.configcat.publicapi.java.client.model.IntegrationLinkType; -import java.util.UUID; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class IntegrationLinksApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public IntegrationLinksApi() { - this(Configuration.getDefaultApiClient()); - } - - public IntegrationLinksApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for addOrUpdateIntegrationLink - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param integrationLinkType The integration link's type. (required) - * @param key The key of the integration link. (required) - * @param addOrUpdateIntegrationLinkModel (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the integration link data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call addOrUpdateIntegrationLinkCall(UUID environmentId, Integer settingId, IntegrationLinkType integrationLinkType, String key, AddOrUpdateIntegrationLinkModel addOrUpdateIntegrationLinkModel, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = addOrUpdateIntegrationLinkModel; - - // create path and map variables - String localVarPath = "/v1/environments/{environmentId}/settings/{settingId}/integrationLinks/{integrationLinkType}/{key}" - .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())) - .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())) - .replace("{" + "integrationLinkType" + "}", localVarApiClient.escapeString(integrationLinkType.toString())) - .replace("{" + "key" + "}", localVarApiClient.escapeString(key.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call addOrUpdateIntegrationLinkValidateBeforeCall(UUID environmentId, Integer settingId, IntegrationLinkType integrationLinkType, String key, AddOrUpdateIntegrationLinkModel addOrUpdateIntegrationLinkModel, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'environmentId' is set - if (environmentId == null) { - throw new ApiException("Missing the required parameter 'environmentId' when calling addOrUpdateIntegrationLink(Async)"); - } - - // verify the required parameter 'settingId' is set - if (settingId == null) { - throw new ApiException("Missing the required parameter 'settingId' when calling addOrUpdateIntegrationLink(Async)"); - } - - // verify the required parameter 'integrationLinkType' is set - if (integrationLinkType == null) { - throw new ApiException("Missing the required parameter 'integrationLinkType' when calling addOrUpdateIntegrationLink(Async)"); - } - - // verify the required parameter 'key' is set - if (key == null) { - throw new ApiException("Missing the required parameter 'key' when calling addOrUpdateIntegrationLink(Async)"); - } - - return addOrUpdateIntegrationLinkCall(environmentId, settingId, integrationLinkType, key, addOrUpdateIntegrationLinkModel, _callback); - - } - - /** - * Add or update Integration link - * - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param integrationLinkType The integration link's type. (required) - * @param key The key of the integration link. (required) - * @param addOrUpdateIntegrationLinkModel (optional) - * @return IntegrationLinkModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the integration link data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public IntegrationLinkModel addOrUpdateIntegrationLink(UUID environmentId, Integer settingId, IntegrationLinkType integrationLinkType, String key, AddOrUpdateIntegrationLinkModel addOrUpdateIntegrationLinkModel) throws ApiException { - ApiResponse localVarResp = addOrUpdateIntegrationLinkWithHttpInfo(environmentId, settingId, integrationLinkType, key, addOrUpdateIntegrationLinkModel); - return localVarResp.getData(); - } - - /** - * Add or update Integration link - * - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param integrationLinkType The integration link's type. (required) - * @param key The key of the integration link. (required) - * @param addOrUpdateIntegrationLinkModel (optional) - * @return ApiResponse<IntegrationLinkModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the integration link data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse addOrUpdateIntegrationLinkWithHttpInfo(UUID environmentId, Integer settingId, IntegrationLinkType integrationLinkType, String key, AddOrUpdateIntegrationLinkModel addOrUpdateIntegrationLinkModel) throws ApiException { - okhttp3.Call localVarCall = addOrUpdateIntegrationLinkValidateBeforeCall(environmentId, settingId, integrationLinkType, key, addOrUpdateIntegrationLinkModel, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Add or update Integration link (asynchronously) - * - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param integrationLinkType The integration link's type. (required) - * @param key The key of the integration link. (required) - * @param addOrUpdateIntegrationLinkModel (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the integration link data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call addOrUpdateIntegrationLinkAsync(UUID environmentId, Integer settingId, IntegrationLinkType integrationLinkType, String key, AddOrUpdateIntegrationLinkModel addOrUpdateIntegrationLinkModel, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = addOrUpdateIntegrationLinkValidateBeforeCall(environmentId, settingId, integrationLinkType, key, addOrUpdateIntegrationLinkModel, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for deleteIntegrationLink - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param integrationLinkType The integration's type. (required) - * @param key The key of the integration link. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteIntegrationLinkCall(UUID environmentId, Integer settingId, IntegrationLinkType integrationLinkType, String key, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/environments/{environmentId}/settings/{settingId}/integrationLinks/{integrationLinkType}/{key}" - .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())) - .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())) - .replace("{" + "integrationLinkType" + "}", localVarApiClient.escapeString(integrationLinkType.toString())) - .replace("{" + "key" + "}", localVarApiClient.escapeString(key.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteIntegrationLinkValidateBeforeCall(UUID environmentId, Integer settingId, IntegrationLinkType integrationLinkType, String key, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'environmentId' is set - if (environmentId == null) { - throw new ApiException("Missing the required parameter 'environmentId' when calling deleteIntegrationLink(Async)"); - } - - // verify the required parameter 'settingId' is set - if (settingId == null) { - throw new ApiException("Missing the required parameter 'settingId' when calling deleteIntegrationLink(Async)"); - } - - // verify the required parameter 'integrationLinkType' is set - if (integrationLinkType == null) { - throw new ApiException("Missing the required parameter 'integrationLinkType' when calling deleteIntegrationLink(Async)"); - } - - // verify the required parameter 'key' is set - if (key == null) { - throw new ApiException("Missing the required parameter 'key' when calling deleteIntegrationLink(Async)"); - } - - return deleteIntegrationLinkCall(environmentId, settingId, integrationLinkType, key, _callback); - - } - - /** - * Delete Integration link - * - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param integrationLinkType The integration's type. (required) - * @param key The key of the integration link. (required) - * @return DeleteIntegrationLinkModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public DeleteIntegrationLinkModel deleteIntegrationLink(UUID environmentId, Integer settingId, IntegrationLinkType integrationLinkType, String key) throws ApiException { - ApiResponse localVarResp = deleteIntegrationLinkWithHttpInfo(environmentId, settingId, integrationLinkType, key); - return localVarResp.getData(); - } - - /** - * Delete Integration link - * - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param integrationLinkType The integration's type. (required) - * @param key The key of the integration link. (required) - * @return ApiResponse<DeleteIntegrationLinkModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse deleteIntegrationLinkWithHttpInfo(UUID environmentId, Integer settingId, IntegrationLinkType integrationLinkType, String key) throws ApiException { - okhttp3.Call localVarCall = deleteIntegrationLinkValidateBeforeCall(environmentId, settingId, integrationLinkType, key, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Delete Integration link (asynchronously) - * - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param integrationLinkType The integration's type. (required) - * @param key The key of the integration link. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteIntegrationLinkAsync(UUID environmentId, Integer settingId, IntegrationLinkType integrationLinkType, String key, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deleteIntegrationLinkValidateBeforeCall(environmentId, settingId, integrationLinkType, key, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getIntegrationLinkDetails - * @param integrationLinkType The integration link's type. (required) - * @param key The key of the integration link. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the details for the integration link returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getIntegrationLinkDetailsCall(IntegrationLinkType integrationLinkType, String key, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/integrationLink/{integrationLinkType}/{key}/details" - .replace("{" + "integrationLinkType" + "}", localVarApiClient.escapeString(integrationLinkType.toString())) - .replace("{" + "key" + "}", localVarApiClient.escapeString(key.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getIntegrationLinkDetailsValidateBeforeCall(IntegrationLinkType integrationLinkType, String key, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'integrationLinkType' is set - if (integrationLinkType == null) { - throw new ApiException("Missing the required parameter 'integrationLinkType' when calling getIntegrationLinkDetails(Async)"); - } - - // verify the required parameter 'key' is set - if (key == null) { - throw new ApiException("Missing the required parameter 'key' when calling getIntegrationLinkDetails(Async)"); - } - - return getIntegrationLinkDetailsCall(integrationLinkType, key, _callback); - - } - - /** - * Get Integration link - * - * @param integrationLinkType The integration link's type. (required) - * @param key The key of the integration link. (required) - * @return IntegrationLinkDetailsModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the details for the integration link returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public IntegrationLinkDetailsModel getIntegrationLinkDetails(IntegrationLinkType integrationLinkType, String key) throws ApiException { - ApiResponse localVarResp = getIntegrationLinkDetailsWithHttpInfo(integrationLinkType, key); - return localVarResp.getData(); - } - - /** - * Get Integration link - * - * @param integrationLinkType The integration link's type. (required) - * @param key The key of the integration link. (required) - * @return ApiResponse<IntegrationLinkDetailsModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the details for the integration link returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse getIntegrationLinkDetailsWithHttpInfo(IntegrationLinkType integrationLinkType, String key) throws ApiException { - okhttp3.Call localVarCall = getIntegrationLinkDetailsValidateBeforeCall(integrationLinkType, key, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Integration link (asynchronously) - * - * @param integrationLinkType The integration link's type. (required) - * @param key The key of the integration link. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the details for the integration link returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getIntegrationLinkDetailsAsync(IntegrationLinkType integrationLinkType, String key, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getIntegrationLinkDetailsValidateBeforeCall(integrationLinkType, key, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for jiraAddOrUpdateIntegrationLink - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param key The key of the integration link. (required) - * @param addOrUpdateJiraIntegrationLinkModel (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the integration link data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call jiraAddOrUpdateIntegrationLinkCall(UUID environmentId, Integer settingId, String key, AddOrUpdateJiraIntegrationLinkModel addOrUpdateJiraIntegrationLinkModel, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = addOrUpdateJiraIntegrationLinkModel; - - // create path and map variables - String localVarPath = "/v1/jira/environments/{environmentId}/settings/{settingId}/integrationLinks/{key}" - .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())) - .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())) - .replace("{" + "key" + "}", localVarApiClient.escapeString(key.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call jiraAddOrUpdateIntegrationLinkValidateBeforeCall(UUID environmentId, Integer settingId, String key, AddOrUpdateJiraIntegrationLinkModel addOrUpdateJiraIntegrationLinkModel, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'environmentId' is set - if (environmentId == null) { - throw new ApiException("Missing the required parameter 'environmentId' when calling jiraAddOrUpdateIntegrationLink(Async)"); - } - - // verify the required parameter 'settingId' is set - if (settingId == null) { - throw new ApiException("Missing the required parameter 'settingId' when calling jiraAddOrUpdateIntegrationLink(Async)"); - } - - // verify the required parameter 'key' is set - if (key == null) { - throw new ApiException("Missing the required parameter 'key' when calling jiraAddOrUpdateIntegrationLink(Async)"); - } - - return jiraAddOrUpdateIntegrationLinkCall(environmentId, settingId, key, addOrUpdateJiraIntegrationLinkModel, _callback); - - } - - /** - * - * - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param key The key of the integration link. (required) - * @param addOrUpdateJiraIntegrationLinkModel (optional) - * @return IntegrationLinkModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the integration link data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public IntegrationLinkModel jiraAddOrUpdateIntegrationLink(UUID environmentId, Integer settingId, String key, AddOrUpdateJiraIntegrationLinkModel addOrUpdateJiraIntegrationLinkModel) throws ApiException { - ApiResponse localVarResp = jiraAddOrUpdateIntegrationLinkWithHttpInfo(environmentId, settingId, key, addOrUpdateJiraIntegrationLinkModel); - return localVarResp.getData(); - } - - /** - * - * - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param key The key of the integration link. (required) - * @param addOrUpdateJiraIntegrationLinkModel (optional) - * @return ApiResponse<IntegrationLinkModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the integration link data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse jiraAddOrUpdateIntegrationLinkWithHttpInfo(UUID environmentId, Integer settingId, String key, AddOrUpdateJiraIntegrationLinkModel addOrUpdateJiraIntegrationLinkModel) throws ApiException { - okhttp3.Call localVarCall = jiraAddOrUpdateIntegrationLinkValidateBeforeCall(environmentId, settingId, key, addOrUpdateJiraIntegrationLinkModel, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * - * @param environmentId The identifier of the Environment. (required) - * @param settingId The id of the Setting. (required) - * @param key The key of the integration link. (required) - * @param addOrUpdateJiraIntegrationLinkModel (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the integration link data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call jiraAddOrUpdateIntegrationLinkAsync(UUID environmentId, Integer settingId, String key, AddOrUpdateJiraIntegrationLinkModel addOrUpdateJiraIntegrationLinkModel, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = jiraAddOrUpdateIntegrationLinkValidateBeforeCall(environmentId, settingId, key, addOrUpdateJiraIntegrationLinkModel, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for jiraConnect - * @param connectRequest (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call jiraConnectCall(ConnectRequest connectRequest, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = connectRequest; - - // create path and map variables - String localVarPath = "/v1/jira/connect"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call jiraConnectValidateBeforeCall(ConnectRequest connectRequest, final ApiCallback _callback) throws ApiException { - return jiraConnectCall(connectRequest, _callback); - - } - - /** - * - * - * @param connectRequest (optional) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public void jiraConnect(ConnectRequest connectRequest) throws ApiException { - jiraConnectWithHttpInfo(connectRequest); - } - - /** - * - * - * @param connectRequest (optional) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse jiraConnectWithHttpInfo(ConnectRequest connectRequest) throws ApiException { - okhttp3.Call localVarCall = jiraConnectValidateBeforeCall(connectRequest, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * (asynchronously) - * - * @param connectRequest (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call jiraConnectAsync(ConnectRequest connectRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = jiraConnectValidateBeforeCall(connectRequest, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/IntegrationsApi.java b/src/main/java/com/configcat/publicapi/java/client/api/IntegrationsApi.java deleted file mode 100644 index 718c57b..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/api/IntegrationsApi.java +++ /dev/null @@ -1,773 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.api; - -import com.configcat.publicapi.java.client.ApiCallback; -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.ApiResponse; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.Pair; -import com.configcat.publicapi.java.client.ProgressRequestBody; -import com.configcat.publicapi.java.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.configcat.publicapi.java.client.model.CreateIntegrationModel; -import com.configcat.publicapi.java.client.model.IntegrationModel; -import com.configcat.publicapi.java.client.model.IntegrationsModel; -import com.configcat.publicapi.java.client.model.ModifyIntegrationRequest; -import java.util.UUID; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class IntegrationsApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public IntegrationsApi() { - this(Configuration.getDefaultApiClient()); - } - - public IntegrationsApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for createIntegration - * @param productId The identifier of the Product. (required) - * @param createIntegrationModel (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call createIntegrationCall(UUID productId, CreateIntegrationModel createIntegrationModel, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = createIntegrationModel; - - // create path and map variables - String localVarPath = "/v1/products/{productId}/integrations" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createIntegrationValidateBeforeCall(UUID productId, CreateIntegrationModel createIntegrationModel, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'productId' is set - if (productId == null) { - throw new ApiException("Missing the required parameter 'productId' when calling createIntegration(Async)"); - } - - // verify the required parameter 'createIntegrationModel' is set - if (createIntegrationModel == null) { - throw new ApiException("Missing the required parameter 'createIntegrationModel' when calling createIntegration(Async)"); - } - - return createIntegrationCall(productId, createIntegrationModel, _callback); - - } - - /** - * Create Integration - * This endpoint creates a new Integration in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. The Parameters dictionary differs for each IntegrationType: - Datadog - `apikey`: Required. Datadog API key. - `site`: Datadog site. Available values: `Us`, `Eu`, `Us1Fed`, `Us3`, `Us5`. Default: `Us`. - Slack Connecting the Slack integration through the Public Management API will not post messages with the ConfigCat Feature Flags Slack app but with an incoming webhook. - `incoming_webhook.url`: Required. The [incoming webhook URL](https://api.slack.com/messaging/webhooks) where the integration should post messages. - Amplitude - `apiKey`: Required. Amplitude API Key. - `secretKey`: Required. Amplitude Secret Key. - Mixpanel - `serviceAccountUserName`: Required. Mixpanel Service Account Username. - `serviceAccountSecret`: Required. Mixpanel Service Account Secret. - `projectId`: Required. Mixpanel Project ID. - `server`: Mixpanel Server. Available values: `StandardServer`, `EUResidencyServer`. Default: `StandardServer`. - Twilio Segment - `writeKey`: Required. Twilio Segment Write Key. - `server`: Twilio Segment Server. Available values: `Us`, `Eu`. Default: `Us`. - PubNub (work in progress) - * @param productId The identifier of the Product. (required) - * @param createIntegrationModel (required) - * @return IntegrationModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public IntegrationModel createIntegration(UUID productId, CreateIntegrationModel createIntegrationModel) throws ApiException { - ApiResponse localVarResp = createIntegrationWithHttpInfo(productId, createIntegrationModel); - return localVarResp.getData(); - } - - /** - * Create Integration - * This endpoint creates a new Integration in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. The Parameters dictionary differs for each IntegrationType: - Datadog - `apikey`: Required. Datadog API key. - `site`: Datadog site. Available values: `Us`, `Eu`, `Us1Fed`, `Us3`, `Us5`. Default: `Us`. - Slack Connecting the Slack integration through the Public Management API will not post messages with the ConfigCat Feature Flags Slack app but with an incoming webhook. - `incoming_webhook.url`: Required. The [incoming webhook URL](https://api.slack.com/messaging/webhooks) where the integration should post messages. - Amplitude - `apiKey`: Required. Amplitude API Key. - `secretKey`: Required. Amplitude Secret Key. - Mixpanel - `serviceAccountUserName`: Required. Mixpanel Service Account Username. - `serviceAccountSecret`: Required. Mixpanel Service Account Secret. - `projectId`: Required. Mixpanel Project ID. - `server`: Mixpanel Server. Available values: `StandardServer`, `EUResidencyServer`. Default: `StandardServer`. - Twilio Segment - `writeKey`: Required. Twilio Segment Write Key. - `server`: Twilio Segment Server. Available values: `Us`, `Eu`. Default: `Us`. - PubNub (work in progress) - * @param productId The identifier of the Product. (required) - * @param createIntegrationModel (required) - * @return ApiResponse<IntegrationModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse createIntegrationWithHttpInfo(UUID productId, CreateIntegrationModel createIntegrationModel) throws ApiException { - okhttp3.Call localVarCall = createIntegrationValidateBeforeCall(productId, createIntegrationModel, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create Integration (asynchronously) - * This endpoint creates a new Integration in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. The Parameters dictionary differs for each IntegrationType: - Datadog - `apikey`: Required. Datadog API key. - `site`: Datadog site. Available values: `Us`, `Eu`, `Us1Fed`, `Us3`, `Us5`. Default: `Us`. - Slack Connecting the Slack integration through the Public Management API will not post messages with the ConfigCat Feature Flags Slack app but with an incoming webhook. - `incoming_webhook.url`: Required. The [incoming webhook URL](https://api.slack.com/messaging/webhooks) where the integration should post messages. - Amplitude - `apiKey`: Required. Amplitude API Key. - `secretKey`: Required. Amplitude Secret Key. - Mixpanel - `serviceAccountUserName`: Required. Mixpanel Service Account Username. - `serviceAccountSecret`: Required. Mixpanel Service Account Secret. - `projectId`: Required. Mixpanel Project ID. - `server`: Mixpanel Server. Available values: `StandardServer`, `EUResidencyServer`. Default: `StandardServer`. - Twilio Segment - `writeKey`: Required. Twilio Segment Write Key. - `server`: Twilio Segment Server. Available values: `Us`, `Eu`. Default: `Us`. - PubNub (work in progress) - * @param productId The identifier of the Product. (required) - * @param createIntegrationModel (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call createIntegrationAsync(UUID productId, CreateIntegrationModel createIntegrationModel, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createIntegrationValidateBeforeCall(productId, createIntegrationModel, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for deleteIntegration - * @param integrationId The identifier of the Integration. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteIntegrationCall(UUID integrationId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/integrations/{integrationId}" - .replace("{" + "integrationId" + "}", localVarApiClient.escapeString(integrationId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteIntegrationValidateBeforeCall(UUID integrationId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'integrationId' is set - if (integrationId == null) { - throw new ApiException("Missing the required parameter 'integrationId' when calling deleteIntegration(Async)"); - } - - return deleteIntegrationCall(integrationId, _callback); - - } - - /** - * Delete Integration - * This endpoint removes a Integration identified by the `integrationId` parameter. - * @param integrationId The identifier of the Integration. (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public void deleteIntegration(UUID integrationId) throws ApiException { - deleteIntegrationWithHttpInfo(integrationId); - } - - /** - * Delete Integration - * This endpoint removes a Integration identified by the `integrationId` parameter. - * @param integrationId The identifier of the Integration. (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse deleteIntegrationWithHttpInfo(UUID integrationId) throws ApiException { - okhttp3.Call localVarCall = deleteIntegrationValidateBeforeCall(integrationId, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete Integration (asynchronously) - * This endpoint removes a Integration identified by the `integrationId` parameter. - * @param integrationId The identifier of the Integration. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteIntegrationAsync(UUID integrationId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deleteIntegrationValidateBeforeCall(integrationId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for getIntegration - * @param integrationId The identifier of the Integration. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the integration data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getIntegrationCall(UUID integrationId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/integrations/{integrationId}" - .replace("{" + "integrationId" + "}", localVarApiClient.escapeString(integrationId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getIntegrationValidateBeforeCall(UUID integrationId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'integrationId' is set - if (integrationId == null) { - throw new ApiException("Missing the required parameter 'integrationId' when calling getIntegration(Async)"); - } - - return getIntegrationCall(integrationId, _callback); - - } - - /** - * Get Integration - * This endpoint returns the metadata of an Integration identified by the `integrationId`. - * @param integrationId The identifier of the Integration. (required) - * @return IntegrationModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the integration data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public IntegrationModel getIntegration(UUID integrationId) throws ApiException { - ApiResponse localVarResp = getIntegrationWithHttpInfo(integrationId); - return localVarResp.getData(); - } - - /** - * Get Integration - * This endpoint returns the metadata of an Integration identified by the `integrationId`. - * @param integrationId The identifier of the Integration. (required) - * @return ApiResponse<IntegrationModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the integration data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse getIntegrationWithHttpInfo(UUID integrationId) throws ApiException { - okhttp3.Call localVarCall = getIntegrationValidateBeforeCall(integrationId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Integration (asynchronously) - * This endpoint returns the metadata of an Integration identified by the `integrationId`. - * @param integrationId The identifier of the Integration. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the integration data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getIntegrationAsync(UUID integrationId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getIntegrationValidateBeforeCall(integrationId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getIntegrations - * @param productId The identifier of the Product. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getIntegrationsCall(UUID productId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/products/{productId}/integrations" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getIntegrationsValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'productId' is set - if (productId == null) { - throw new ApiException("Missing the required parameter 'productId' when calling getIntegrations(Async)"); - } - - return getIntegrationsCall(productId, _callback); - - } - - /** - * List Integrations - * This endpoint returns the list of the Integrations that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @return IntegrationsModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public IntegrationsModel getIntegrations(UUID productId) throws ApiException { - ApiResponse localVarResp = getIntegrationsWithHttpInfo(productId); - return localVarResp.getData(); - } - - /** - * List Integrations - * This endpoint returns the list of the Integrations that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @return ApiResponse<IntegrationsModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse getIntegrationsWithHttpInfo(UUID productId) throws ApiException { - okhttp3.Call localVarCall = getIntegrationsValidateBeforeCall(productId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Integrations (asynchronously) - * This endpoint returns the list of the Integrations that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getIntegrationsAsync(UUID productId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getIntegrationsValidateBeforeCall(productId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for updateIntegration - * @param integrationId The identifier of the Integration. (required) - * @param modifyIntegrationRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateIntegrationCall(UUID integrationId, ModifyIntegrationRequest modifyIntegrationRequest, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = modifyIntegrationRequest; - - // create path and map variables - String localVarPath = "/v1/integrations/{integrationId}" - .replace("{" + "integrationId" + "}", localVarApiClient.escapeString(integrationId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateIntegrationValidateBeforeCall(UUID integrationId, ModifyIntegrationRequest modifyIntegrationRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'integrationId' is set - if (integrationId == null) { - throw new ApiException("Missing the required parameter 'integrationId' when calling updateIntegration(Async)"); - } - - // verify the required parameter 'modifyIntegrationRequest' is set - if (modifyIntegrationRequest == null) { - throw new ApiException("Missing the required parameter 'modifyIntegrationRequest' when calling updateIntegration(Async)"); - } - - return updateIntegrationCall(integrationId, modifyIntegrationRequest, _callback); - - } - - /** - * Update Integration - * This endpoint updates a Config identified by the `integrationId` parameter. The Parameters dictionary differs for each IntegrationType: - Datadog - `apikey`: Required. Datadog API key. - `site`: Datadog site. Available values: `Us`, `Eu`, `Us1Fed`, `Us3`, `Us5`. Default: `Us`. - Slack Connecting the Slack integration through the Public Management API will not post messages with the ConfigCat Feature Flags Slack app but with an incoming webhook. - `incoming_webhook.url`: Required. The [incoming webhook URL](https://api.slack.com/messaging/webhooks) where the integration should post messages. - Amplitude - `apiKey`: Required. Amplitude API Key. - `secretKey`: Required. Amplitude Secret Key. - Mixpanel - `serviceAccountUserName`: Required. Mixpanel Service Account Username. - `serviceAccountSecret`: Required. Mixpanel Service Account Secret. - `projectId`: Required. Mixpanel Project ID. - `server`: Mixpanel Server. Available values: `StandardServer`, `EUResidencyServer`. Default: `StandardServer`. - Twilio Segment - `writeKey`: Required. Twilio Segment Write Key. - `server`: Twilio Segment Server. Available values: `Us`, `Eu`. Default: `Us`. - PubNub (work in progress) - * @param integrationId The identifier of the Integration. (required) - * @param modifyIntegrationRequest (required) - * @return IntegrationModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public IntegrationModel updateIntegration(UUID integrationId, ModifyIntegrationRequest modifyIntegrationRequest) throws ApiException { - ApiResponse localVarResp = updateIntegrationWithHttpInfo(integrationId, modifyIntegrationRequest); - return localVarResp.getData(); - } - - /** - * Update Integration - * This endpoint updates a Config identified by the `integrationId` parameter. The Parameters dictionary differs for each IntegrationType: - Datadog - `apikey`: Required. Datadog API key. - `site`: Datadog site. Available values: `Us`, `Eu`, `Us1Fed`, `Us3`, `Us5`. Default: `Us`. - Slack Connecting the Slack integration through the Public Management API will not post messages with the ConfigCat Feature Flags Slack app but with an incoming webhook. - `incoming_webhook.url`: Required. The [incoming webhook URL](https://api.slack.com/messaging/webhooks) where the integration should post messages. - Amplitude - `apiKey`: Required. Amplitude API Key. - `secretKey`: Required. Amplitude Secret Key. - Mixpanel - `serviceAccountUserName`: Required. Mixpanel Service Account Username. - `serviceAccountSecret`: Required. Mixpanel Service Account Secret. - `projectId`: Required. Mixpanel Project ID. - `server`: Mixpanel Server. Available values: `StandardServer`, `EUResidencyServer`. Default: `StandardServer`. - Twilio Segment - `writeKey`: Required. Twilio Segment Write Key. - `server`: Twilio Segment Server. Available values: `Us`, `Eu`. Default: `Us`. - PubNub (work in progress) - * @param integrationId The identifier of the Integration. (required) - * @param modifyIntegrationRequest (required) - * @return ApiResponse<IntegrationModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse updateIntegrationWithHttpInfo(UUID integrationId, ModifyIntegrationRequest modifyIntegrationRequest) throws ApiException { - okhttp3.Call localVarCall = updateIntegrationValidateBeforeCall(integrationId, modifyIntegrationRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update Integration (asynchronously) - * This endpoint updates a Config identified by the `integrationId` parameter. The Parameters dictionary differs for each IntegrationType: - Datadog - `apikey`: Required. Datadog API key. - `site`: Datadog site. Available values: `Us`, `Eu`, `Us1Fed`, `Us3`, `Us5`. Default: `Us`. - Slack Connecting the Slack integration through the Public Management API will not post messages with the ConfigCat Feature Flags Slack app but with an incoming webhook. - `incoming_webhook.url`: Required. The [incoming webhook URL](https://api.slack.com/messaging/webhooks) where the integration should post messages. - Amplitude - `apiKey`: Required. Amplitude API Key. - `secretKey`: Required. Amplitude Secret Key. - Mixpanel - `serviceAccountUserName`: Required. Mixpanel Service Account Username. - `serviceAccountSecret`: Required. Mixpanel Service Account Secret. - `projectId`: Required. Mixpanel Project ID. - `server`: Mixpanel Server. Available values: `StandardServer`, `EUResidencyServer`. Default: `StandardServer`. - Twilio Segment - `writeKey`: Required. Twilio Segment Write Key. - `server`: Twilio Segment Server. Available values: `Us`, `Eu`. Default: `Us`. - PubNub (work in progress) - * @param integrationId The identifier of the Integration. (required) - * @param modifyIntegrationRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateIntegrationAsync(UUID integrationId, ModifyIntegrationRequest modifyIntegrationRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateIntegrationValidateBeforeCall(integrationId, modifyIntegrationRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/MeApi.java b/src/main/java/com/configcat/publicapi/java/client/api/MeApi.java deleted file mode 100644 index 5868484..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/api/MeApi.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.api; - -import com.configcat.publicapi.java.client.ApiCallback; -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.ApiResponse; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.Pair; -import com.configcat.publicapi.java.client.ProgressRequestBody; -import com.configcat.publicapi.java.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.configcat.publicapi.java.client.model.MeModel; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class MeApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public MeApi() { - this(Configuration.getDefaultApiClient()); - } - - public MeApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for getMe - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getMeCall(final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/me"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getMeValidateBeforeCall(final ApiCallback _callback) throws ApiException { - return getMeCall(_callback); - - } - - /** - * Get authenticated user details - * - * @return MeModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public MeModel getMe() throws ApiException { - ApiResponse localVarResp = getMeWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * Get authenticated user details - * - * @return ApiResponse<MeModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse getMeWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = getMeValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get authenticated user details (asynchronously) - * - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getMeAsync(final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getMeValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/MembersApi.java b/src/main/java/com/configcat/publicapi/java/client/api/MembersApi.java deleted file mode 100644 index 6121b7c..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/api/MembersApi.java +++ /dev/null @@ -1,1470 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.api; - -import com.configcat.publicapi.java.client.ApiCallback; -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.ApiResponse; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.Pair; -import com.configcat.publicapi.java.client.ProgressRequestBody; -import com.configcat.publicapi.java.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.configcat.publicapi.java.client.model.InvitationModel; -import com.configcat.publicapi.java.client.model.InviteMembersRequest; -import com.configcat.publicapi.java.client.model.MemberModel; -import com.configcat.publicapi.java.client.model.OrganizationInvitationModel; -import com.configcat.publicapi.java.client.model.OrganizationMembersModel; -import java.util.UUID; -import com.configcat.publicapi.java.client.model.UpdateMemberPermissionsRequest; -import com.configcat.publicapi.java.client.model.UserModel; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class MembersApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public MembersApi() { - this(Configuration.getDefaultApiClient()); - } - - public MembersApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for addMemberToGroup - * @param organizationId The identifier of the Organization. (required) - * @param userId The identifier of the Member. (required) - * @param updateMemberPermissionsRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call addMemberToGroupCall(UUID organizationId, String userId, UpdateMemberPermissionsRequest updateMemberPermissionsRequest, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updateMemberPermissionsRequest; - - // create path and map variables - String localVarPath = "/v1/organizations/{organizationId}/members/{userId}" - .replace("{" + "organizationId" + "}", localVarApiClient.escapeString(organizationId.toString())) - .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call addMemberToGroupValidateBeforeCall(UUID organizationId, String userId, UpdateMemberPermissionsRequest updateMemberPermissionsRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { - throw new ApiException("Missing the required parameter 'organizationId' when calling addMemberToGroup(Async)"); - } - - // verify the required parameter 'userId' is set - if (userId == null) { - throw new ApiException("Missing the required parameter 'userId' when calling addMemberToGroup(Async)"); - } - - // verify the required parameter 'updateMemberPermissionsRequest' is set - if (updateMemberPermissionsRequest == null) { - throw new ApiException("Missing the required parameter 'updateMemberPermissionsRequest' when calling addMemberToGroup(Async)"); - } - - return addMemberToGroupCall(organizationId, userId, updateMemberPermissionsRequest, _callback); - - } - - /** - * Update Member Permissions - * This endpoint updates the permissions of a Member identified by the `userId`. This endpoint can also be used to move a Member between Permission Groups within a Product. Only a single Permission Group can be set per Product. - * @param organizationId The identifier of the Organization. (required) - * @param userId The identifier of the Member. (required) - * @param updateMemberPermissionsRequest (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public void addMemberToGroup(UUID organizationId, String userId, UpdateMemberPermissionsRequest updateMemberPermissionsRequest) throws ApiException { - addMemberToGroupWithHttpInfo(organizationId, userId, updateMemberPermissionsRequest); - } - - /** - * Update Member Permissions - * This endpoint updates the permissions of a Member identified by the `userId`. This endpoint can also be used to move a Member between Permission Groups within a Product. Only a single Permission Group can be set per Product. - * @param organizationId The identifier of the Organization. (required) - * @param userId The identifier of the Member. (required) - * @param updateMemberPermissionsRequest (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse addMemberToGroupWithHttpInfo(UUID organizationId, String userId, UpdateMemberPermissionsRequest updateMemberPermissionsRequest) throws ApiException { - okhttp3.Call localVarCall = addMemberToGroupValidateBeforeCall(organizationId, userId, updateMemberPermissionsRequest, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Update Member Permissions (asynchronously) - * This endpoint updates the permissions of a Member identified by the `userId`. This endpoint can also be used to move a Member between Permission Groups within a Product. Only a single Permission Group can be set per Product. - * @param organizationId The identifier of the Organization. (required) - * @param userId The identifier of the Member. (required) - * @param updateMemberPermissionsRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call addMemberToGroupAsync(UUID organizationId, String userId, UpdateMemberPermissionsRequest updateMemberPermissionsRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = addMemberToGroupValidateBeforeCall(organizationId, userId, updateMemberPermissionsRequest, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for deleteInvitation - * @param invitationId The identifier of the Invitation. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteInvitationCall(UUID invitationId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/invitations/{invitationId}" - .replace("{" + "invitationId" + "}", localVarApiClient.escapeString(invitationId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteInvitationValidateBeforeCall(UUID invitationId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'invitationId' is set - if (invitationId == null) { - throw new ApiException("Missing the required parameter 'invitationId' when calling deleteInvitation(Async)"); - } - - return deleteInvitationCall(invitationId, _callback); - - } - - /** - * Delete Invitation - * This endpoint removes an Invitation identified by the `invitationId` parameter. - * @param invitationId The identifier of the Invitation. (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public void deleteInvitation(UUID invitationId) throws ApiException { - deleteInvitationWithHttpInfo(invitationId); - } - - /** - * Delete Invitation - * This endpoint removes an Invitation identified by the `invitationId` parameter. - * @param invitationId The identifier of the Invitation. (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse deleteInvitationWithHttpInfo(UUID invitationId) throws ApiException { - okhttp3.Call localVarCall = deleteInvitationValidateBeforeCall(invitationId, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete Invitation (asynchronously) - * This endpoint removes an Invitation identified by the `invitationId` parameter. - * @param invitationId The identifier of the Invitation. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteInvitationAsync(UUID invitationId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deleteInvitationValidateBeforeCall(invitationId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for deleteOrganizationMember - * @param organizationId The identifier of the Organization. (required) - * @param userId The identifier of the Member. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteOrganizationMemberCall(UUID organizationId, String userId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/organizations/{organizationId}/members/{userId}" - .replace("{" + "organizationId" + "}", localVarApiClient.escapeString(organizationId.toString())) - .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteOrganizationMemberValidateBeforeCall(UUID organizationId, String userId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { - throw new ApiException("Missing the required parameter 'organizationId' when calling deleteOrganizationMember(Async)"); - } - - // verify the required parameter 'userId' is set - if (userId == null) { - throw new ApiException("Missing the required parameter 'userId' when calling deleteOrganizationMember(Async)"); - } - - return deleteOrganizationMemberCall(organizationId, userId, _callback); - - } - - /** - * Delete Member from Organization - * This endpoint removes a Member identified by the `userId` from the given Organization identified by the `organizationId` parameter. - * @param organizationId The identifier of the Organization. (required) - * @param userId The identifier of the Member. (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public void deleteOrganizationMember(UUID organizationId, String userId) throws ApiException { - deleteOrganizationMemberWithHttpInfo(organizationId, userId); - } - - /** - * Delete Member from Organization - * This endpoint removes a Member identified by the `userId` from the given Organization identified by the `organizationId` parameter. - * @param organizationId The identifier of the Organization. (required) - * @param userId The identifier of the Member. (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse deleteOrganizationMemberWithHttpInfo(UUID organizationId, String userId) throws ApiException { - okhttp3.Call localVarCall = deleteOrganizationMemberValidateBeforeCall(organizationId, userId, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete Member from Organization (asynchronously) - * This endpoint removes a Member identified by the `userId` from the given Organization identified by the `organizationId` parameter. - * @param organizationId The identifier of the Organization. (required) - * @param userId The identifier of the Member. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteOrganizationMemberAsync(UUID organizationId, String userId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deleteOrganizationMemberValidateBeforeCall(organizationId, userId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for deleteProductMember - * @param productId The identifier of the Product. (required) - * @param userId The identifier of the Member. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteProductMemberCall(UUID productId, String userId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/products/{productId}/members/{userId}" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())) - .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteProductMemberValidateBeforeCall(UUID productId, String userId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'productId' is set - if (productId == null) { - throw new ApiException("Missing the required parameter 'productId' when calling deleteProductMember(Async)"); - } - - // verify the required parameter 'userId' is set - if (userId == null) { - throw new ApiException("Missing the required parameter 'userId' when calling deleteProductMember(Async)"); - } - - return deleteProductMemberCall(productId, userId, _callback); - - } - - /** - * Delete Member from Product - * This endpoint removes a Member identified by the `userId` from the given Product identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @param userId The identifier of the Member. (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public void deleteProductMember(UUID productId, String userId) throws ApiException { - deleteProductMemberWithHttpInfo(productId, userId); - } - - /** - * Delete Member from Product - * This endpoint removes a Member identified by the `userId` from the given Product identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @param userId The identifier of the Member. (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse deleteProductMemberWithHttpInfo(UUID productId, String userId) throws ApiException { - okhttp3.Call localVarCall = deleteProductMemberValidateBeforeCall(productId, userId, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete Member from Product (asynchronously) - * This endpoint removes a Member identified by the `userId` from the given Product identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @param userId The identifier of the Member. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteProductMemberAsync(UUID productId, String userId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deleteProductMemberValidateBeforeCall(productId, userId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for getOrganizationMembers - * @param organizationId The identifier of the Organization. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getOrganizationMembersCall(UUID organizationId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/organizations/{organizationId}/members" - .replace("{" + "organizationId" + "}", localVarApiClient.escapeString(organizationId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call getOrganizationMembersValidateBeforeCall(UUID organizationId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { - throw new ApiException("Missing the required parameter 'organizationId' when calling getOrganizationMembers(Async)"); - } - - return getOrganizationMembersCall(organizationId, _callback); - - } - - /** - * List Organization Members - * This endpoint returns the list of Members that belongs to the given Organization, identified by the `organizationId` parameter. The results may vary based on the access level of the user who calls the endpoint: - When it's called with Organization Admin privileges, the result will contain each member in the Organization. - When it's called without Organization Admin privileges, the result will contain each Organization Admin along with members of those products where the caller has `Team members and permission groups` (`canManageMembers`) permission. - * @param organizationId The identifier of the Organization. (required) - * @return List<UserModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- * @deprecated - */ - @Deprecated - public List getOrganizationMembers(UUID organizationId) throws ApiException { - ApiResponse> localVarResp = getOrganizationMembersWithHttpInfo(organizationId); - return localVarResp.getData(); - } - - /** - * List Organization Members - * This endpoint returns the list of Members that belongs to the given Organization, identified by the `organizationId` parameter. The results may vary based on the access level of the user who calls the endpoint: - When it's called with Organization Admin privileges, the result will contain each member in the Organization. - When it's called without Organization Admin privileges, the result will contain each Organization Admin along with members of those products where the caller has `Team members and permission groups` (`canManageMembers`) permission. - * @param organizationId The identifier of the Organization. (required) - * @return ApiResponse<List<UserModel>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- * @deprecated - */ - @Deprecated - public ApiResponse> getOrganizationMembersWithHttpInfo(UUID organizationId) throws ApiException { - okhttp3.Call localVarCall = getOrganizationMembersValidateBeforeCall(organizationId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Organization Members (asynchronously) - * This endpoint returns the list of Members that belongs to the given Organization, identified by the `organizationId` parameter. The results may vary based on the access level of the user who calls the endpoint: - When it's called with Organization Admin privileges, the result will contain each member in the Organization. - When it's called without Organization Admin privileges, the result will contain each Organization Admin along with members of those products where the caller has `Team members and permission groups` (`canManageMembers`) permission. - * @param organizationId The identifier of the Organization. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getOrganizationMembersAsync(UUID organizationId, final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = getOrganizationMembersValidateBeforeCall(organizationId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getOrganizationMembersV2 - * @param organizationId The identifier of the Organization. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getOrganizationMembersV2Call(UUID organizationId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/organizations/{organizationId}/members" - .replace("{" + "organizationId" + "}", localVarApiClient.escapeString(organizationId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getOrganizationMembersV2ValidateBeforeCall(UUID organizationId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { - throw new ApiException("Missing the required parameter 'organizationId' when calling getOrganizationMembersV2(Async)"); - } - - return getOrganizationMembersV2Call(organizationId, _callback); - - } - - /** - * List Organization Members - * This endpoint returns the list of Members that belongs to the given Organization, identified by the `organizationId` parameter. The results may vary based on the access level of the user who calls the endpoint: - When it's called with Organization Admin privileges, the result will contain each member in the Organization. - When it's called without Organization Admin privileges, the result will contain each Organization Admin along with members of those products where the caller has `Team members and permission groups` (`canManageMembers`) permission. - * @param organizationId The identifier of the Organization. (required) - * @return OrganizationMembersModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public OrganizationMembersModel getOrganizationMembersV2(UUID organizationId) throws ApiException { - ApiResponse localVarResp = getOrganizationMembersV2WithHttpInfo(organizationId); - return localVarResp.getData(); - } - - /** - * List Organization Members - * This endpoint returns the list of Members that belongs to the given Organization, identified by the `organizationId` parameter. The results may vary based on the access level of the user who calls the endpoint: - When it's called with Organization Admin privileges, the result will contain each member in the Organization. - When it's called without Organization Admin privileges, the result will contain each Organization Admin along with members of those products where the caller has `Team members and permission groups` (`canManageMembers`) permission. - * @param organizationId The identifier of the Organization. (required) - * @return ApiResponse<OrganizationMembersModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse getOrganizationMembersV2WithHttpInfo(UUID organizationId) throws ApiException { - okhttp3.Call localVarCall = getOrganizationMembersV2ValidateBeforeCall(organizationId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Organization Members (asynchronously) - * This endpoint returns the list of Members that belongs to the given Organization, identified by the `organizationId` parameter. The results may vary based on the access level of the user who calls the endpoint: - When it's called with Organization Admin privileges, the result will contain each member in the Organization. - When it's called without Organization Admin privileges, the result will contain each Organization Admin along with members of those products where the caller has `Team members and permission groups` (`canManageMembers`) permission. - * @param organizationId The identifier of the Organization. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getOrganizationMembersV2Async(UUID organizationId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getOrganizationMembersV2ValidateBeforeCall(organizationId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getPendingInvitations - * @param productId The identifier of the Product. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getPendingInvitationsCall(UUID productId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/products/{productId}/invitations" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getPendingInvitationsValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'productId' is set - if (productId == null) { - throw new ApiException("Missing the required parameter 'productId' when calling getPendingInvitations(Async)"); - } - - return getPendingInvitationsCall(productId, _callback); - - } - - /** - * List Pending Invitations in Product - * This endpoint returns the list of pending invitations within the given Product identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @return List<InvitationModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public List getPendingInvitations(UUID productId) throws ApiException { - ApiResponse> localVarResp = getPendingInvitationsWithHttpInfo(productId); - return localVarResp.getData(); - } - - /** - * List Pending Invitations in Product - * This endpoint returns the list of pending invitations within the given Product identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @return ApiResponse<List<InvitationModel>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse> getPendingInvitationsWithHttpInfo(UUID productId) throws ApiException { - okhttp3.Call localVarCall = getPendingInvitationsValidateBeforeCall(productId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Pending Invitations in Product (asynchronously) - * This endpoint returns the list of pending invitations within the given Product identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getPendingInvitationsAsync(UUID productId, final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = getPendingInvitationsValidateBeforeCall(productId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getPendingInvitationsOrg - * @param organizationId The identifier of the Organization. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getPendingInvitationsOrgCall(UUID organizationId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/organizations/{organizationId}/invitations" - .replace("{" + "organizationId" + "}", localVarApiClient.escapeString(organizationId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getPendingInvitationsOrgValidateBeforeCall(UUID organizationId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { - throw new ApiException("Missing the required parameter 'organizationId' when calling getPendingInvitationsOrg(Async)"); - } - - return getPendingInvitationsOrgCall(organizationId, _callback); - - } - - /** - * List Pending Invitations in Organization - * This endpoint returns the list of pending invitations within the given Organization identified by the `organizationId` parameter. - * @param organizationId The identifier of the Organization. (required) - * @return List<OrganizationInvitationModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public List getPendingInvitationsOrg(UUID organizationId) throws ApiException { - ApiResponse> localVarResp = getPendingInvitationsOrgWithHttpInfo(organizationId); - return localVarResp.getData(); - } - - /** - * List Pending Invitations in Organization - * This endpoint returns the list of pending invitations within the given Organization identified by the `organizationId` parameter. - * @param organizationId The identifier of the Organization. (required) - * @return ApiResponse<List<OrganizationInvitationModel>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse> getPendingInvitationsOrgWithHttpInfo(UUID organizationId) throws ApiException { - okhttp3.Call localVarCall = getPendingInvitationsOrgValidateBeforeCall(organizationId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Pending Invitations in Organization (asynchronously) - * This endpoint returns the list of pending invitations within the given Organization identified by the `organizationId` parameter. - * @param organizationId The identifier of the Organization. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getPendingInvitationsOrgAsync(UUID organizationId, final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = getPendingInvitationsOrgValidateBeforeCall(organizationId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getProductMembers - * @param productId The identifier of the Product. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getProductMembersCall(UUID productId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/products/{productId}/members" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getProductMembersValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'productId' is set - if (productId == null) { - throw new ApiException("Missing the required parameter 'productId' when calling getProductMembers(Async)"); - } - - return getProductMembersCall(productId, _callback); - - } - - /** - * List Product Members - * This endpoint returns the list of Members that belongs to the given Product, identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @return List<MemberModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public List getProductMembers(UUID productId) throws ApiException { - ApiResponse> localVarResp = getProductMembersWithHttpInfo(productId); - return localVarResp.getData(); - } - - /** - * List Product Members - * This endpoint returns the list of Members that belongs to the given Product, identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @return ApiResponse<List<MemberModel>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse> getProductMembersWithHttpInfo(UUID productId) throws ApiException { - okhttp3.Call localVarCall = getProductMembersValidateBeforeCall(productId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Product Members (asynchronously) - * This endpoint returns the list of Members that belongs to the given Product, identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getProductMembersAsync(UUID productId, final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = getProductMembersValidateBeforeCall(productId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for inviteMember - * @param productId The identifier of the Product. (required) - * @param inviteMembersRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the invite was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call inviteMemberCall(UUID productId, InviteMembersRequest inviteMembersRequest, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = inviteMembersRequest; - - // create path and map variables - String localVarPath = "/v1/products/{productId}/members/invite" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call inviteMemberValidateBeforeCall(UUID productId, InviteMembersRequest inviteMembersRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'productId' is set - if (productId == null) { - throw new ApiException("Missing the required parameter 'productId' when calling inviteMember(Async)"); - } - - // verify the required parameter 'inviteMembersRequest' is set - if (inviteMembersRequest == null) { - throw new ApiException("Missing the required parameter 'inviteMembersRequest' when calling inviteMember(Async)"); - } - - return inviteMemberCall(productId, inviteMembersRequest, _callback); - - } - - /** - * Invite Member - * This endpoint invites a Member into the given Product identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @param inviteMembersRequest (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the invite was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public void inviteMember(UUID productId, InviteMembersRequest inviteMembersRequest) throws ApiException { - inviteMemberWithHttpInfo(productId, inviteMembersRequest); - } - - /** - * Invite Member - * This endpoint invites a Member into the given Product identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @param inviteMembersRequest (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the invite was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse inviteMemberWithHttpInfo(UUID productId, InviteMembersRequest inviteMembersRequest) throws ApiException { - okhttp3.Call localVarCall = inviteMemberValidateBeforeCall(productId, inviteMembersRequest, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Invite Member (asynchronously) - * This endpoint invites a Member into the given Product identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @param inviteMembersRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the invite was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call inviteMemberAsync(UUID productId, InviteMembersRequest inviteMembersRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = inviteMemberValidateBeforeCall(productId, inviteMembersRequest, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/OrganizationsApi.java b/src/main/java/com/configcat/publicapi/java/client/api/OrganizationsApi.java deleted file mode 100644 index 2db33b1..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/api/OrganizationsApi.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.api; - -import com.configcat.publicapi.java.client.ApiCallback; -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.ApiResponse; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.Pair; -import com.configcat.publicapi.java.client.ProgressRequestBody; -import com.configcat.publicapi.java.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.configcat.publicapi.java.client.model.OrganizationModel; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class OrganizationsApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public OrganizationsApi() { - this(Configuration.getDefaultApiClient()); - } - - public OrganizationsApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for getOrganizations - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getOrganizationsCall(final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/organizations"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getOrganizationsValidateBeforeCall(final ApiCallback _callback) throws ApiException { - return getOrganizationsCall(_callback); - - } - - /** - * List Organizations - * This endpoint returns the list of the Organizations that belongs to the user. - * @return List<OrganizationModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public List getOrganizations() throws ApiException { - ApiResponse> localVarResp = getOrganizationsWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * List Organizations - * This endpoint returns the list of the Organizations that belongs to the user. - * @return ApiResponse<List<OrganizationModel>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse> getOrganizationsWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = getOrganizationsValidateBeforeCall(null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Organizations (asynchronously) - * This endpoint returns the list of the Organizations that belongs to the user. - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getOrganizationsAsync(final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = getOrganizationsValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/PermissionGroupsApi.java b/src/main/java/com/configcat/publicapi/java/client/api/PermissionGroupsApi.java deleted file mode 100644 index ac65669..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/api/PermissionGroupsApi.java +++ /dev/null @@ -1,772 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.api; - -import com.configcat.publicapi.java.client.ApiCallback; -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.ApiResponse; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.Pair; -import com.configcat.publicapi.java.client.ProgressRequestBody; -import com.configcat.publicapi.java.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.configcat.publicapi.java.client.model.CreatePermissionGroupRequest; -import com.configcat.publicapi.java.client.model.PermissionGroupModel; -import java.util.UUID; -import com.configcat.publicapi.java.client.model.UpdatePermissionGroupRequest; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class PermissionGroupsApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public PermissionGroupsApi() { - this(Configuration.getDefaultApiClient()); - } - - public PermissionGroupsApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for createPermissionGroup - * @param productId The identifier of the Product. (required) - * @param createPermissionGroupRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call createPermissionGroupCall(UUID productId, CreatePermissionGroupRequest createPermissionGroupRequest, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = createPermissionGroupRequest; - - // create path and map variables - String localVarPath = "/v1/products/{productId}/permissions" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createPermissionGroupValidateBeforeCall(UUID productId, CreatePermissionGroupRequest createPermissionGroupRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'productId' is set - if (productId == null) { - throw new ApiException("Missing the required parameter 'productId' when calling createPermissionGroup(Async)"); - } - - // verify the required parameter 'createPermissionGroupRequest' is set - if (createPermissionGroupRequest == null) { - throw new ApiException("Missing the required parameter 'createPermissionGroupRequest' when calling createPermissionGroup(Async)"); - } - - return createPermissionGroupCall(productId, createPermissionGroupRequest, _callback); - - } - - /** - * Create Permission Group - * This endpoint creates a new Permission Group in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @param createPermissionGroupRequest (required) - * @return PermissionGroupModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public PermissionGroupModel createPermissionGroup(UUID productId, CreatePermissionGroupRequest createPermissionGroupRequest) throws ApiException { - ApiResponse localVarResp = createPermissionGroupWithHttpInfo(productId, createPermissionGroupRequest); - return localVarResp.getData(); - } - - /** - * Create Permission Group - * This endpoint creates a new Permission Group in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @param createPermissionGroupRequest (required) - * @return ApiResponse<PermissionGroupModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse createPermissionGroupWithHttpInfo(UUID productId, CreatePermissionGroupRequest createPermissionGroupRequest) throws ApiException { - okhttp3.Call localVarCall = createPermissionGroupValidateBeforeCall(productId, createPermissionGroupRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create Permission Group (asynchronously) - * This endpoint creates a new Permission Group in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @param createPermissionGroupRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call createPermissionGroupAsync(UUID productId, CreatePermissionGroupRequest createPermissionGroupRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createPermissionGroupValidateBeforeCall(productId, createPermissionGroupRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for deletePermissionGroup - * @param permissionGroupId The identifier of the Permission Group. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deletePermissionGroupCall(Long permissionGroupId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/permissions/{permissionGroupId}" - .replace("{" + "permissionGroupId" + "}", localVarApiClient.escapeString(permissionGroupId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deletePermissionGroupValidateBeforeCall(Long permissionGroupId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'permissionGroupId' is set - if (permissionGroupId == null) { - throw new ApiException("Missing the required parameter 'permissionGroupId' when calling deletePermissionGroup(Async)"); - } - - return deletePermissionGroupCall(permissionGroupId, _callback); - - } - - /** - * Delete Permission Group - * This endpoint removes a Permission Group identified by the `permissionGroupId` parameter. - * @param permissionGroupId The identifier of the Permission Group. (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public void deletePermissionGroup(Long permissionGroupId) throws ApiException { - deletePermissionGroupWithHttpInfo(permissionGroupId); - } - - /** - * Delete Permission Group - * This endpoint removes a Permission Group identified by the `permissionGroupId` parameter. - * @param permissionGroupId The identifier of the Permission Group. (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse deletePermissionGroupWithHttpInfo(Long permissionGroupId) throws ApiException { - okhttp3.Call localVarCall = deletePermissionGroupValidateBeforeCall(permissionGroupId, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete Permission Group (asynchronously) - * This endpoint removes a Permission Group identified by the `permissionGroupId` parameter. - * @param permissionGroupId The identifier of the Permission Group. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deletePermissionGroupAsync(Long permissionGroupId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deletePermissionGroupValidateBeforeCall(permissionGroupId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for getPermissionGroup - * @param permissionGroupId The identifier of the Permission Group. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the permission group data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getPermissionGroupCall(Long permissionGroupId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/permissions/{permissionGroupId}" - .replace("{" + "permissionGroupId" + "}", localVarApiClient.escapeString(permissionGroupId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getPermissionGroupValidateBeforeCall(Long permissionGroupId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'permissionGroupId' is set - if (permissionGroupId == null) { - throw new ApiException("Missing the required parameter 'permissionGroupId' when calling getPermissionGroup(Async)"); - } - - return getPermissionGroupCall(permissionGroupId, _callback); - - } - - /** - * Get Permission Group - * This endpoint returns the metadata of a Permission Group identified by the `permissionGroupId`. - * @param permissionGroupId The identifier of the Permission Group. (required) - * @return PermissionGroupModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the permission group data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public PermissionGroupModel getPermissionGroup(Long permissionGroupId) throws ApiException { - ApiResponse localVarResp = getPermissionGroupWithHttpInfo(permissionGroupId); - return localVarResp.getData(); - } - - /** - * Get Permission Group - * This endpoint returns the metadata of a Permission Group identified by the `permissionGroupId`. - * @param permissionGroupId The identifier of the Permission Group. (required) - * @return ApiResponse<PermissionGroupModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the permission group data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse getPermissionGroupWithHttpInfo(Long permissionGroupId) throws ApiException { - okhttp3.Call localVarCall = getPermissionGroupValidateBeforeCall(permissionGroupId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Permission Group (asynchronously) - * This endpoint returns the metadata of a Permission Group identified by the `permissionGroupId`. - * @param permissionGroupId The identifier of the Permission Group. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the permission group data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getPermissionGroupAsync(Long permissionGroupId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getPermissionGroupValidateBeforeCall(permissionGroupId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getPermissionGroups - * @param productId The identifier of the Product. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getPermissionGroupsCall(UUID productId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/products/{productId}/permissions" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getPermissionGroupsValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'productId' is set - if (productId == null) { - throw new ApiException("Missing the required parameter 'productId' when calling getPermissionGroups(Async)"); - } - - return getPermissionGroupsCall(productId, _callback); - - } - - /** - * List Permission Groups - * This endpoint returns the list of the Permission Groups that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @return List<PermissionGroupModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public List getPermissionGroups(UUID productId) throws ApiException { - ApiResponse> localVarResp = getPermissionGroupsWithHttpInfo(productId); - return localVarResp.getData(); - } - - /** - * List Permission Groups - * This endpoint returns the list of the Permission Groups that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @return ApiResponse<List<PermissionGroupModel>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse> getPermissionGroupsWithHttpInfo(UUID productId) throws ApiException { - okhttp3.Call localVarCall = getPermissionGroupsValidateBeforeCall(productId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Permission Groups (asynchronously) - * This endpoint returns the list of the Permission Groups that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getPermissionGroupsAsync(UUID productId, final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = getPermissionGroupsValidateBeforeCall(productId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for updatePermissionGroup - * @param permissionGroupId The identifier of the Permission Group. (required) - * @param updatePermissionGroupRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updatePermissionGroupCall(Long permissionGroupId, UpdatePermissionGroupRequest updatePermissionGroupRequest, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updatePermissionGroupRequest; - - // create path and map variables - String localVarPath = "/v1/permissions/{permissionGroupId}" - .replace("{" + "permissionGroupId" + "}", localVarApiClient.escapeString(permissionGroupId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updatePermissionGroupValidateBeforeCall(Long permissionGroupId, UpdatePermissionGroupRequest updatePermissionGroupRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'permissionGroupId' is set - if (permissionGroupId == null) { - throw new ApiException("Missing the required parameter 'permissionGroupId' when calling updatePermissionGroup(Async)"); - } - - // verify the required parameter 'updatePermissionGroupRequest' is set - if (updatePermissionGroupRequest == null) { - throw new ApiException("Missing the required parameter 'updatePermissionGroupRequest' when calling updatePermissionGroup(Async)"); - } - - return updatePermissionGroupCall(permissionGroupId, updatePermissionGroupRequest, _callback); - - } - - /** - * Update Permission Group - * This endpoint updates a Permission Group identified by the `permissionGroupId` parameter. - * @param permissionGroupId The identifier of the Permission Group. (required) - * @param updatePermissionGroupRequest (required) - * @return PermissionGroupModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public PermissionGroupModel updatePermissionGroup(Long permissionGroupId, UpdatePermissionGroupRequest updatePermissionGroupRequest) throws ApiException { - ApiResponse localVarResp = updatePermissionGroupWithHttpInfo(permissionGroupId, updatePermissionGroupRequest); - return localVarResp.getData(); - } - - /** - * Update Permission Group - * This endpoint updates a Permission Group identified by the `permissionGroupId` parameter. - * @param permissionGroupId The identifier of the Permission Group. (required) - * @param updatePermissionGroupRequest (required) - * @return ApiResponse<PermissionGroupModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse updatePermissionGroupWithHttpInfo(Long permissionGroupId, UpdatePermissionGroupRequest updatePermissionGroupRequest) throws ApiException { - okhttp3.Call localVarCall = updatePermissionGroupValidateBeforeCall(permissionGroupId, updatePermissionGroupRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update Permission Group (asynchronously) - * This endpoint updates a Permission Group identified by the `permissionGroupId` parameter. - * @param permissionGroupId The identifier of the Permission Group. (required) - * @param updatePermissionGroupRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updatePermissionGroupAsync(Long permissionGroupId, UpdatePermissionGroupRequest updatePermissionGroupRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updatePermissionGroupValidateBeforeCall(permissionGroupId, updatePermissionGroupRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/ProductsApi.java b/src/main/java/com/configcat/publicapi/java/client/api/ProductsApi.java deleted file mode 100644 index d48b4a6..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/api/ProductsApi.java +++ /dev/null @@ -1,1038 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.api; - -import com.configcat.publicapi.java.client.ApiCallback; -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.ApiResponse; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.Pair; -import com.configcat.publicapi.java.client.ProgressRequestBody; -import com.configcat.publicapi.java.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.configcat.publicapi.java.client.model.CreateProductRequest; -import com.configcat.publicapi.java.client.model.PreferencesModel; -import com.configcat.publicapi.java.client.model.ProductModel; -import java.util.UUID; -import com.configcat.publicapi.java.client.model.UpdatePreferencesRequest; -import com.configcat.publicapi.java.client.model.UpdateProductRequest; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class ProductsApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public ProductsApi() { - this(Configuration.getDefaultApiClient()); - } - - public ProductsApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for createProduct - * @param organizationId The identifier of the Organization. (required) - * @param createProductRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call createProductCall(UUID organizationId, CreateProductRequest createProductRequest, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = createProductRequest; - - // create path and map variables - String localVarPath = "/v1/organizations/{organizationId}/products" - .replace("{" + "organizationId" + "}", localVarApiClient.escapeString(organizationId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createProductValidateBeforeCall(UUID organizationId, CreateProductRequest createProductRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { - throw new ApiException("Missing the required parameter 'organizationId' when calling createProduct(Async)"); - } - - // verify the required parameter 'createProductRequest' is set - if (createProductRequest == null) { - throw new ApiException("Missing the required parameter 'createProductRequest' when calling createProduct(Async)"); - } - - return createProductCall(organizationId, createProductRequest, _callback); - - } - - /** - * Create Product - * This endpoint creates a new Product in a specified Organization identified by the `organizationId` parameter, which can be obtained from the [List Organizations](#operation/get-organizations) endpoint. - * @param organizationId The identifier of the Organization. (required) - * @param createProductRequest (required) - * @return ProductModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ProductModel createProduct(UUID organizationId, CreateProductRequest createProductRequest) throws ApiException { - ApiResponse localVarResp = createProductWithHttpInfo(organizationId, createProductRequest); - return localVarResp.getData(); - } - - /** - * Create Product - * This endpoint creates a new Product in a specified Organization identified by the `organizationId` parameter, which can be obtained from the [List Organizations](#operation/get-organizations) endpoint. - * @param organizationId The identifier of the Organization. (required) - * @param createProductRequest (required) - * @return ApiResponse<ProductModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse createProductWithHttpInfo(UUID organizationId, CreateProductRequest createProductRequest) throws ApiException { - okhttp3.Call localVarCall = createProductValidateBeforeCall(organizationId, createProductRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create Product (asynchronously) - * This endpoint creates a new Product in a specified Organization identified by the `organizationId` parameter, which can be obtained from the [List Organizations](#operation/get-organizations) endpoint. - * @param organizationId The identifier of the Organization. (required) - * @param createProductRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call createProductAsync(UUID organizationId, CreateProductRequest createProductRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createProductValidateBeforeCall(organizationId, createProductRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for deleteProduct - * @param productId The identifier of the Product. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteProductCall(UUID productId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/products/{productId}" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteProductValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'productId' is set - if (productId == null) { - throw new ApiException("Missing the required parameter 'productId' when calling deleteProduct(Async)"); - } - - return deleteProductCall(productId, _callback); - - } - - /** - * Delete Product - * This endpoint removes a Product identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public void deleteProduct(UUID productId) throws ApiException { - deleteProductWithHttpInfo(productId); - } - - /** - * Delete Product - * This endpoint removes a Product identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse deleteProductWithHttpInfo(UUID productId) throws ApiException { - okhttp3.Call localVarCall = deleteProductValidateBeforeCall(productId, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete Product (asynchronously) - * This endpoint removes a Product identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteProductAsync(UUID productId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deleteProductValidateBeforeCall(productId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for getProduct - * @param productId The identifier of the Product. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the product data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getProductCall(UUID productId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/products/{productId}" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getProductValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'productId' is set - if (productId == null) { - throw new ApiException("Missing the required parameter 'productId' when calling getProduct(Async)"); - } - - return getProductCall(productId, _callback); - - } - - /** - * Get Product - * This endpoint returns the metadata of a Product identified by the `productId`. - * @param productId The identifier of the Product. (required) - * @return ProductModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the product data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ProductModel getProduct(UUID productId) throws ApiException { - ApiResponse localVarResp = getProductWithHttpInfo(productId); - return localVarResp.getData(); - } - - /** - * Get Product - * This endpoint returns the metadata of a Product identified by the `productId`. - * @param productId The identifier of the Product. (required) - * @return ApiResponse<ProductModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the product data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse getProductWithHttpInfo(UUID productId) throws ApiException { - okhttp3.Call localVarCall = getProductValidateBeforeCall(productId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Product (asynchronously) - * This endpoint returns the metadata of a Product identified by the `productId`. - * @param productId The identifier of the Product. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the product data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getProductAsync(UUID productId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getProductValidateBeforeCall(productId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getProductPreferences - * @param productId The identifier of the Product. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the product preferences data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getProductPreferencesCall(UUID productId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/products/{productId}/preferences" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getProductPreferencesValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'productId' is set - if (productId == null) { - throw new ApiException("Missing the required parameter 'productId' when calling getProductPreferences(Async)"); - } - - return getProductPreferencesCall(productId, _callback); - - } - - /** - * Get Product Preferences - * This endpoint returns the preferences of a Product identified by the `productId`. - * @param productId The identifier of the Product. (required) - * @return PreferencesModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the product preferences data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public PreferencesModel getProductPreferences(UUID productId) throws ApiException { - ApiResponse localVarResp = getProductPreferencesWithHttpInfo(productId); - return localVarResp.getData(); - } - - /** - * Get Product Preferences - * This endpoint returns the preferences of a Product identified by the `productId`. - * @param productId The identifier of the Product. (required) - * @return ApiResponse<PreferencesModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the product preferences data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse getProductPreferencesWithHttpInfo(UUID productId) throws ApiException { - okhttp3.Call localVarCall = getProductPreferencesValidateBeforeCall(productId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Product Preferences (asynchronously) - * This endpoint returns the preferences of a Product identified by the `productId`. - * @param productId The identifier of the Product. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the product preferences data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getProductPreferencesAsync(UUID productId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getProductPreferencesValidateBeforeCall(productId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getProducts - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getProductsCall(final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/products"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getProductsValidateBeforeCall(final ApiCallback _callback) throws ApiException { - return getProductsCall(_callback); - - } - - /** - * List Products - * This endpoint returns the list of the Products that belongs to the user. - * @return List<ProductModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public List getProducts() throws ApiException { - ApiResponse> localVarResp = getProductsWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * List Products - * This endpoint returns the list of the Products that belongs to the user. - * @return ApiResponse<List<ProductModel>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse> getProductsWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = getProductsValidateBeforeCall(null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Products (asynchronously) - * This endpoint returns the list of the Products that belongs to the user. - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getProductsAsync(final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = getProductsValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for updateProduct - * @param productId The identifier of the Product. (required) - * @param updateProductRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateProductCall(UUID productId, UpdateProductRequest updateProductRequest, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updateProductRequest; - - // create path and map variables - String localVarPath = "/v1/products/{productId}" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateProductValidateBeforeCall(UUID productId, UpdateProductRequest updateProductRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'productId' is set - if (productId == null) { - throw new ApiException("Missing the required parameter 'productId' when calling updateProduct(Async)"); - } - - // verify the required parameter 'updateProductRequest' is set - if (updateProductRequest == null) { - throw new ApiException("Missing the required parameter 'updateProductRequest' when calling updateProduct(Async)"); - } - - return updateProductCall(productId, updateProductRequest, _callback); - - } - - /** - * Update Product - * This endpoint updates a Product identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @param updateProductRequest (required) - * @return ProductModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ProductModel updateProduct(UUID productId, UpdateProductRequest updateProductRequest) throws ApiException { - ApiResponse localVarResp = updateProductWithHttpInfo(productId, updateProductRequest); - return localVarResp.getData(); - } - - /** - * Update Product - * This endpoint updates a Product identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @param updateProductRequest (required) - * @return ApiResponse<ProductModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse updateProductWithHttpInfo(UUID productId, UpdateProductRequest updateProductRequest) throws ApiException { - okhttp3.Call localVarCall = updateProductValidateBeforeCall(productId, updateProductRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update Product (asynchronously) - * This endpoint updates a Product identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @param updateProductRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateProductAsync(UUID productId, UpdateProductRequest updateProductRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateProductValidateBeforeCall(productId, updateProductRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for updateProductPreferences - * @param productId The identifier of the Product. (required) - * @param updatePreferencesRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateProductPreferencesCall(UUID productId, UpdatePreferencesRequest updatePreferencesRequest, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updatePreferencesRequest; - - // create path and map variables - String localVarPath = "/v1/products/{productId}/preferences" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateProductPreferencesValidateBeforeCall(UUID productId, UpdatePreferencesRequest updatePreferencesRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'productId' is set - if (productId == null) { - throw new ApiException("Missing the required parameter 'productId' when calling updateProductPreferences(Async)"); - } - - // verify the required parameter 'updatePreferencesRequest' is set - if (updatePreferencesRequest == null) { - throw new ApiException("Missing the required parameter 'updatePreferencesRequest' when calling updateProductPreferences(Async)"); - } - - return updateProductPreferencesCall(productId, updatePreferencesRequest, _callback); - - } - - /** - * Update Product Preferences - * This endpoint updates the preferences of a Product identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @param updatePreferencesRequest (required) - * @return PreferencesModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public PreferencesModel updateProductPreferences(UUID productId, UpdatePreferencesRequest updatePreferencesRequest) throws ApiException { - ApiResponse localVarResp = updateProductPreferencesWithHttpInfo(productId, updatePreferencesRequest); - return localVarResp.getData(); - } - - /** - * Update Product Preferences - * This endpoint updates the preferences of a Product identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @param updatePreferencesRequest (required) - * @return ApiResponse<PreferencesModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse updateProductPreferencesWithHttpInfo(UUID productId, UpdatePreferencesRequest updatePreferencesRequest) throws ApiException { - okhttp3.Call localVarCall = updateProductPreferencesValidateBeforeCall(productId, updatePreferencesRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update Product Preferences (asynchronously) - * This endpoint updates the preferences of a Product identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @param updatePreferencesRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateProductPreferencesAsync(UUID productId, UpdatePreferencesRequest updatePreferencesRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateProductPreferencesValidateBeforeCall(productId, updatePreferencesRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/SdkKeysApi.java b/src/main/java/com/configcat/publicapi/java/client/api/SdkKeysApi.java deleted file mode 100644 index 7de5cac..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/api/SdkKeysApi.java +++ /dev/null @@ -1,221 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.api; - -import com.configcat.publicapi.java.client.ApiCallback; -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.ApiResponse; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.Pair; -import com.configcat.publicapi.java.client.ProgressRequestBody; -import com.configcat.publicapi.java.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.configcat.publicapi.java.client.model.SdkKeysModel; -import java.util.UUID; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class SdkKeysApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public SdkKeysApi() { - this(Configuration.getDefaultApiClient()); - } - - public SdkKeysApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for getSdkKeys - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSdkKeysCall(UUID configId, UUID environmentId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/configs/{configId}/environments/{environmentId}" - .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())) - .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getSdkKeysValidateBeforeCall(UUID configId, UUID environmentId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'configId' is set - if (configId == null) { - throw new ApiException("Missing the required parameter 'configId' when calling getSdkKeys(Async)"); - } - - // verify the required parameter 'environmentId' is set - if (environmentId == null) { - throw new ApiException("Missing the required parameter 'environmentId' when calling getSdkKeys(Async)"); - } - - return getSdkKeysCall(configId, environmentId, _callback); - - } - - /** - * Get SDK Key - * This endpoint returns the SDK Key for your Config in a specified Environment. - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @return SdkKeysModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public SdkKeysModel getSdkKeys(UUID configId, UUID environmentId) throws ApiException { - ApiResponse localVarResp = getSdkKeysWithHttpInfo(configId, environmentId); - return localVarResp.getData(); - } - - /** - * Get SDK Key - * This endpoint returns the SDK Key for your Config in a specified Environment. - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @return ApiResponse<SdkKeysModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse getSdkKeysWithHttpInfo(UUID configId, UUID environmentId) throws ApiException { - okhttp3.Call localVarCall = getSdkKeysValidateBeforeCall(configId, environmentId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get SDK Key (asynchronously) - * This endpoint returns the SDK Key for your Config in a specified Environment. - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSdkKeysAsync(UUID configId, UUID environmentId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getSdkKeysValidateBeforeCall(configId, environmentId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/SegmentsApi.java b/src/main/java/com/configcat/publicapi/java/client/api/SegmentsApi.java deleted file mode 100644 index 5057acc..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/api/SegmentsApi.java +++ /dev/null @@ -1,773 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.api; - -import com.configcat.publicapi.java.client.ApiCallback; -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.ApiResponse; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.Pair; -import com.configcat.publicapi.java.client.ProgressRequestBody; -import com.configcat.publicapi.java.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.configcat.publicapi.java.client.model.CreateSegmentModel; -import com.configcat.publicapi.java.client.model.SegmentListModel; -import com.configcat.publicapi.java.client.model.SegmentModel; -import java.util.UUID; -import com.configcat.publicapi.java.client.model.UpdateSegmentModel; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class SegmentsApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public SegmentsApi() { - this(Configuration.getDefaultApiClient()); - } - - public SegmentsApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for createSegment - * @param productId The identifier of the Product. (required) - * @param createSegmentModel (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call createSegmentCall(UUID productId, CreateSegmentModel createSegmentModel, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = createSegmentModel; - - // create path and map variables - String localVarPath = "/v1/products/{productId}/segments" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createSegmentValidateBeforeCall(UUID productId, CreateSegmentModel createSegmentModel, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'productId' is set - if (productId == null) { - throw new ApiException("Missing the required parameter 'productId' when calling createSegment(Async)"); - } - - // verify the required parameter 'createSegmentModel' is set - if (createSegmentModel == null) { - throw new ApiException("Missing the required parameter 'createSegmentModel' when calling createSegment(Async)"); - } - - return createSegmentCall(productId, createSegmentModel, _callback); - - } - - /** - * Create Segment - * This endpoint creates a new Segment in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @param createSegmentModel (required) - * @return SegmentModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public SegmentModel createSegment(UUID productId, CreateSegmentModel createSegmentModel) throws ApiException { - ApiResponse localVarResp = createSegmentWithHttpInfo(productId, createSegmentModel); - return localVarResp.getData(); - } - - /** - * Create Segment - * This endpoint creates a new Segment in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @param createSegmentModel (required) - * @return ApiResponse<SegmentModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse createSegmentWithHttpInfo(UUID productId, CreateSegmentModel createSegmentModel) throws ApiException { - okhttp3.Call localVarCall = createSegmentValidateBeforeCall(productId, createSegmentModel, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create Segment (asynchronously) - * This endpoint creates a new Segment in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @param createSegmentModel (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call createSegmentAsync(UUID productId, CreateSegmentModel createSegmentModel, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createSegmentValidateBeforeCall(productId, createSegmentModel, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for deleteSegment - * @param segmentId The identifier of the Segment. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteSegmentCall(UUID segmentId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/segments/{segmentId}" - .replace("{" + "segmentId" + "}", localVarApiClient.escapeString(segmentId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteSegmentValidateBeforeCall(UUID segmentId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'segmentId' is set - if (segmentId == null) { - throw new ApiException("Missing the required parameter 'segmentId' when calling deleteSegment(Async)"); - } - - return deleteSegmentCall(segmentId, _callback); - - } - - /** - * Delete Segment - * This endpoint removes a Segment identified by the `segmentId` parameter. - * @param segmentId The identifier of the Segment. (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public void deleteSegment(UUID segmentId) throws ApiException { - deleteSegmentWithHttpInfo(segmentId); - } - - /** - * Delete Segment - * This endpoint removes a Segment identified by the `segmentId` parameter. - * @param segmentId The identifier of the Segment. (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse deleteSegmentWithHttpInfo(UUID segmentId) throws ApiException { - okhttp3.Call localVarCall = deleteSegmentValidateBeforeCall(segmentId, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete Segment (asynchronously) - * This endpoint removes a Segment identified by the `segmentId` parameter. - * @param segmentId The identifier of the Segment. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteSegmentAsync(UUID segmentId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deleteSegmentValidateBeforeCall(segmentId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for getSegment - * @param segmentId The identifier of the Segment. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the config data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSegmentCall(UUID segmentId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/segments/{segmentId}" - .replace("{" + "segmentId" + "}", localVarApiClient.escapeString(segmentId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getSegmentValidateBeforeCall(UUID segmentId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'segmentId' is set - if (segmentId == null) { - throw new ApiException("Missing the required parameter 'segmentId' when calling getSegment(Async)"); - } - - return getSegmentCall(segmentId, _callback); - - } - - /** - * Get Segment - * This endpoint returns the metadata of a Segment identified by the `segmentId`. - * @param segmentId The identifier of the Segment. (required) - * @return SegmentModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the config data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public SegmentModel getSegment(UUID segmentId) throws ApiException { - ApiResponse localVarResp = getSegmentWithHttpInfo(segmentId); - return localVarResp.getData(); - } - - /** - * Get Segment - * This endpoint returns the metadata of a Segment identified by the `segmentId`. - * @param segmentId The identifier of the Segment. (required) - * @return ApiResponse<SegmentModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the config data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse getSegmentWithHttpInfo(UUID segmentId) throws ApiException { - okhttp3.Call localVarCall = getSegmentValidateBeforeCall(segmentId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Segment (asynchronously) - * This endpoint returns the metadata of a Segment identified by the `segmentId`. - * @param segmentId The identifier of the Segment. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the config data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSegmentAsync(UUID segmentId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getSegmentValidateBeforeCall(segmentId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getSegments - * @param productId The identifier of the Product. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSegmentsCall(UUID productId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/products/{productId}/segments" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getSegmentsValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'productId' is set - if (productId == null) { - throw new ApiException("Missing the required parameter 'productId' when calling getSegments(Async)"); - } - - return getSegmentsCall(productId, _callback); - - } - - /** - * List Segments - * This endpoint returns the list of the Segments that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @return List<SegmentListModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public List getSegments(UUID productId) throws ApiException { - ApiResponse> localVarResp = getSegmentsWithHttpInfo(productId); - return localVarResp.getData(); - } - - /** - * List Segments - * This endpoint returns the list of the Segments that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @return ApiResponse<List<SegmentListModel>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse> getSegmentsWithHttpInfo(UUID productId) throws ApiException { - okhttp3.Call localVarCall = getSegmentsValidateBeforeCall(productId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Segments (asynchronously) - * This endpoint returns the list of the Segments that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSegmentsAsync(UUID productId, final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = getSegmentsValidateBeforeCall(productId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for updateSegment - * @param segmentId The identifier of the Segment. (required) - * @param updateSegmentModel (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateSegmentCall(UUID segmentId, UpdateSegmentModel updateSegmentModel, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updateSegmentModel; - - // create path and map variables - String localVarPath = "/v1/segments/{segmentId}" - .replace("{" + "segmentId" + "}", localVarApiClient.escapeString(segmentId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateSegmentValidateBeforeCall(UUID segmentId, UpdateSegmentModel updateSegmentModel, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'segmentId' is set - if (segmentId == null) { - throw new ApiException("Missing the required parameter 'segmentId' when calling updateSegment(Async)"); - } - - // verify the required parameter 'updateSegmentModel' is set - if (updateSegmentModel == null) { - throw new ApiException("Missing the required parameter 'updateSegmentModel' when calling updateSegment(Async)"); - } - - return updateSegmentCall(segmentId, updateSegmentModel, _callback); - - } - - /** - * Update Segment - * This endpoint updates a Segment identified by the `segmentId` parameter. - * @param segmentId The identifier of the Segment. (required) - * @param updateSegmentModel (required) - * @return SegmentModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public SegmentModel updateSegment(UUID segmentId, UpdateSegmentModel updateSegmentModel) throws ApiException { - ApiResponse localVarResp = updateSegmentWithHttpInfo(segmentId, updateSegmentModel); - return localVarResp.getData(); - } - - /** - * Update Segment - * This endpoint updates a Segment identified by the `segmentId` parameter. - * @param segmentId The identifier of the Segment. (required) - * @param updateSegmentModel (required) - * @return ApiResponse<SegmentModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse updateSegmentWithHttpInfo(UUID segmentId, UpdateSegmentModel updateSegmentModel) throws ApiException { - okhttp3.Call localVarCall = updateSegmentValidateBeforeCall(segmentId, updateSegmentModel, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update Segment (asynchronously) - * This endpoint updates a Segment identified by the `segmentId` parameter. - * @param segmentId The identifier of the Segment. (required) - * @param updateSegmentModel (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateSegmentAsync(UUID segmentId, UpdateSegmentModel updateSegmentModel, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateSegmentValidateBeforeCall(segmentId, updateSegmentModel, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/TagsApi.java b/src/main/java/com/configcat/publicapi/java/client/api/TagsApi.java deleted file mode 100644 index 6f7b523..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/api/TagsApi.java +++ /dev/null @@ -1,900 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.api; - -import com.configcat.publicapi.java.client.ApiCallback; -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.ApiResponse; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.Pair; -import com.configcat.publicapi.java.client.ProgressRequestBody; -import com.configcat.publicapi.java.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.configcat.publicapi.java.client.model.CreateTagModel; -import com.configcat.publicapi.java.client.model.SettingModel; -import com.configcat.publicapi.java.client.model.TagModel; -import java.util.UUID; -import com.configcat.publicapi.java.client.model.UpdateTagModel; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class TagsApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public TagsApi() { - this(Configuration.getDefaultApiClient()); - } - - public TagsApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for createTag - * @param productId The identifier of the Organization. (required) - * @param createTagModel (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call createTagCall(UUID productId, CreateTagModel createTagModel, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = createTagModel; - - // create path and map variables - String localVarPath = "/v1/products/{productId}/tags" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createTagValidateBeforeCall(UUID productId, CreateTagModel createTagModel, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'productId' is set - if (productId == null) { - throw new ApiException("Missing the required parameter 'productId' when calling createTag(Async)"); - } - - // verify the required parameter 'createTagModel' is set - if (createTagModel == null) { - throw new ApiException("Missing the required parameter 'createTagModel' when calling createTag(Async)"); - } - - return createTagCall(productId, createTagModel, _callback); - - } - - /** - * Create Tag - * This endpoint creates a new Tag in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Organization. (required) - * @param createTagModel (required) - * @return TagModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public TagModel createTag(UUID productId, CreateTagModel createTagModel) throws ApiException { - ApiResponse localVarResp = createTagWithHttpInfo(productId, createTagModel); - return localVarResp.getData(); - } - - /** - * Create Tag - * This endpoint creates a new Tag in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Organization. (required) - * @param createTagModel (required) - * @return ApiResponse<TagModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse createTagWithHttpInfo(UUID productId, CreateTagModel createTagModel) throws ApiException { - okhttp3.Call localVarCall = createTagValidateBeforeCall(productId, createTagModel, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create Tag (asynchronously) - * This endpoint creates a new Tag in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Organization. (required) - * @param createTagModel (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call createTagAsync(UUID productId, CreateTagModel createTagModel, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createTagValidateBeforeCall(productId, createTagModel, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for deleteTag - * @param tagId The identifier of the Tag. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteTagCall(Long tagId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/tags/{tagId}" - .replace("{" + "tagId" + "}", localVarApiClient.escapeString(tagId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteTagValidateBeforeCall(Long tagId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'tagId' is set - if (tagId == null) { - throw new ApiException("Missing the required parameter 'tagId' when calling deleteTag(Async)"); - } - - return deleteTagCall(tagId, _callback); - - } - - /** - * Delete Tag - * This endpoint deletes a Tag identified by the `tagId` parameter. To remove a Tag from a Feature Flag or Setting use the [Update Flag](#operation/update-setting) endpoint. - * @param tagId The identifier of the Tag. (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public void deleteTag(Long tagId) throws ApiException { - deleteTagWithHttpInfo(tagId); - } - - /** - * Delete Tag - * This endpoint deletes a Tag identified by the `tagId` parameter. To remove a Tag from a Feature Flag or Setting use the [Update Flag](#operation/update-setting) endpoint. - * @param tagId The identifier of the Tag. (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse deleteTagWithHttpInfo(Long tagId) throws ApiException { - okhttp3.Call localVarCall = deleteTagValidateBeforeCall(tagId, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete Tag (asynchronously) - * This endpoint deletes a Tag identified by the `tagId` parameter. To remove a Tag from a Feature Flag or Setting use the [Update Flag](#operation/update-setting) endpoint. - * @param tagId The identifier of the Tag. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteTagAsync(Long tagId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deleteTagValidateBeforeCall(tagId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for getSettingsByTag - * @param tagId The identifier of the Tag. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the settings data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSettingsByTagCall(Long tagId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/tags/{tagId}/settings" - .replace("{" + "tagId" + "}", localVarApiClient.escapeString(tagId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getSettingsByTagValidateBeforeCall(Long tagId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'tagId' is set - if (tagId == null) { - throw new ApiException("Missing the required parameter 'tagId' when calling getSettingsByTag(Async)"); - } - - return getSettingsByTagCall(tagId, _callback); - - } - - /** - * List Settings by Tag - * This endpoint returns the list of the Settings that has the specified Tag, identified by the `tagId` parameter. - * @param tagId The identifier of the Tag. (required) - * @return List<SettingModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the settings data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public List getSettingsByTag(Long tagId) throws ApiException { - ApiResponse> localVarResp = getSettingsByTagWithHttpInfo(tagId); - return localVarResp.getData(); - } - - /** - * List Settings by Tag - * This endpoint returns the list of the Settings that has the specified Tag, identified by the `tagId` parameter. - * @param tagId The identifier of the Tag. (required) - * @return ApiResponse<List<SettingModel>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the settings data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse> getSettingsByTagWithHttpInfo(Long tagId) throws ApiException { - okhttp3.Call localVarCall = getSettingsByTagValidateBeforeCall(tagId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Settings by Tag (asynchronously) - * This endpoint returns the list of the Settings that has the specified Tag, identified by the `tagId` parameter. - * @param tagId The identifier of the Tag. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the settings data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getSettingsByTagAsync(Long tagId, final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = getSettingsByTagValidateBeforeCall(tagId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getTag - * @param tagId The identifier of the Tag. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the tag data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getTagCall(Long tagId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/tags/{tagId}" - .replace("{" + "tagId" + "}", localVarApiClient.escapeString(tagId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getTagValidateBeforeCall(Long tagId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'tagId' is set - if (tagId == null) { - throw new ApiException("Missing the required parameter 'tagId' when calling getTag(Async)"); - } - - return getTagCall(tagId, _callback); - - } - - /** - * Get Tag - * This endpoint returns the metadata of a Tag identified by the `tagId`. - * @param tagId The identifier of the Tag. (required) - * @return TagModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the tag data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public TagModel getTag(Long tagId) throws ApiException { - ApiResponse localVarResp = getTagWithHttpInfo(tagId); - return localVarResp.getData(); - } - - /** - * Get Tag - * This endpoint returns the metadata of a Tag identified by the `tagId`. - * @param tagId The identifier of the Tag. (required) - * @return ApiResponse<TagModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the tag data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse getTagWithHttpInfo(Long tagId) throws ApiException { - okhttp3.Call localVarCall = getTagValidateBeforeCall(tagId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Tag (asynchronously) - * This endpoint returns the metadata of a Tag identified by the `tagId`. - * @param tagId The identifier of the Tag. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the tag data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getTagAsync(Long tagId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getTagValidateBeforeCall(tagId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getTags - * @param productId The identifier of the Product. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getTagsCall(UUID productId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/products/{productId}/tags" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getTagsValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'productId' is set - if (productId == null) { - throw new ApiException("Missing the required parameter 'productId' when calling getTags(Async)"); - } - - return getTagsCall(productId, _callback); - - } - - /** - * List Tags - * This endpoint returns the list of the Tags in a specified Product, identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @return List<TagModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public List getTags(UUID productId) throws ApiException { - ApiResponse> localVarResp = getTagsWithHttpInfo(productId); - return localVarResp.getData(); - } - - /** - * List Tags - * This endpoint returns the list of the Tags in a specified Product, identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @return ApiResponse<List<TagModel>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse> getTagsWithHttpInfo(UUID productId) throws ApiException { - okhttp3.Call localVarCall = getTagsValidateBeforeCall(productId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Tags (asynchronously) - * This endpoint returns the list of the Tags in a specified Product, identified by the `productId` parameter. - * @param productId The identifier of the Product. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getTagsAsync(UUID productId, final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = getTagsValidateBeforeCall(productId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for updateTag - * @param tagId The identifier of the Tag. (required) - * @param updateTagModel (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateTagCall(Long tagId, UpdateTagModel updateTagModel, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updateTagModel; - - // create path and map variables - String localVarPath = "/v1/tags/{tagId}" - .replace("{" + "tagId" + "}", localVarApiClient.escapeString(tagId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateTagValidateBeforeCall(Long tagId, UpdateTagModel updateTagModel, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'tagId' is set - if (tagId == null) { - throw new ApiException("Missing the required parameter 'tagId' when calling updateTag(Async)"); - } - - // verify the required parameter 'updateTagModel' is set - if (updateTagModel == null) { - throw new ApiException("Missing the required parameter 'updateTagModel' when calling updateTag(Async)"); - } - - return updateTagCall(tagId, updateTagModel, _callback); - - } - - /** - * Update Tag - * This endpoint updates a Tag identified by the `tagId` parameter. - * @param tagId The identifier of the Tag. (required) - * @param updateTagModel (required) - * @return TagModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public TagModel updateTag(Long tagId, UpdateTagModel updateTagModel) throws ApiException { - ApiResponse localVarResp = updateTagWithHttpInfo(tagId, updateTagModel); - return localVarResp.getData(); - } - - /** - * Update Tag - * This endpoint updates a Tag identified by the `tagId` parameter. - * @param tagId The identifier of the Tag. (required) - * @param updateTagModel (required) - * @return ApiResponse<TagModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse updateTagWithHttpInfo(Long tagId, UpdateTagModel updateTagModel) throws ApiException { - okhttp3.Call localVarCall = updateTagValidateBeforeCall(tagId, updateTagModel, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update Tag (asynchronously) - * This endpoint updates a Tag identified by the `tagId` parameter. - * @param tagId The identifier of the Tag. (required) - * @param updateTagModel (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateTagAsync(Long tagId, UpdateTagModel updateTagModel, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateTagValidateBeforeCall(tagId, updateTagModel, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/WebhooksApi.java b/src/main/java/com/configcat/publicapi/java/client/api/WebhooksApi.java deleted file mode 100644 index e0e4189..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/api/WebhooksApi.java +++ /dev/null @@ -1,1057 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.api; - -import com.configcat.publicapi.java.client.ApiCallback; -import com.configcat.publicapi.java.client.ApiClient; -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.ApiResponse; -import com.configcat.publicapi.java.client.Configuration; -import com.configcat.publicapi.java.client.Pair; -import com.configcat.publicapi.java.client.ProgressRequestBody; -import com.configcat.publicapi.java.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.configcat.publicapi.java.client.model.JsonPatchOperation; -import java.util.UUID; -import com.configcat.publicapi.java.client.model.WebHookRequest; -import com.configcat.publicapi.java.client.model.WebhookModel; -import com.configcat.publicapi.java.client.model.WebhookSigningKeysModel; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class WebhooksApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public WebhooksApi() { - this(Configuration.getDefaultApiClient()); - } - - public WebhooksApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for createWebhook - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @param webHookRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call createWebhookCall(UUID configId, UUID environmentId, WebHookRequest webHookRequest, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = webHookRequest; - - // create path and map variables - String localVarPath = "/v1/configs/{configId}/environments/{environmentId}/webhooks" - .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())) - .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createWebhookValidateBeforeCall(UUID configId, UUID environmentId, WebHookRequest webHookRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'configId' is set - if (configId == null) { - throw new ApiException("Missing the required parameter 'configId' when calling createWebhook(Async)"); - } - - // verify the required parameter 'environmentId' is set - if (environmentId == null) { - throw new ApiException("Missing the required parameter 'environmentId' when calling createWebhook(Async)"); - } - - // verify the required parameter 'webHookRequest' is set - if (webHookRequest == null) { - throw new ApiException("Missing the required parameter 'webHookRequest' when calling createWebhook(Async)"); - } - - return createWebhookCall(configId, environmentId, webHookRequest, _callback); - - } - - /** - * Create Webhook - * This endpoint creates a new Webhook in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @param webHookRequest (required) - * @return WebhookModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public WebhookModel createWebhook(UUID configId, UUID environmentId, WebHookRequest webHookRequest) throws ApiException { - ApiResponse localVarResp = createWebhookWithHttpInfo(configId, environmentId, webHookRequest); - return localVarResp.getData(); - } - - /** - * Create Webhook - * This endpoint creates a new Webhook in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @param webHookRequest (required) - * @return ApiResponse<WebhookModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse createWebhookWithHttpInfo(UUID configId, UUID environmentId, WebHookRequest webHookRequest) throws ApiException { - okhttp3.Call localVarCall = createWebhookValidateBeforeCall(configId, environmentId, webHookRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create Webhook (asynchronously) - * This endpoint creates a new Webhook in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param configId The identifier of the Config. (required) - * @param environmentId The identifier of the Environment. (required) - * @param webHookRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call createWebhookAsync(UUID configId, UUID environmentId, WebHookRequest webHookRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createWebhookValidateBeforeCall(configId, environmentId, webHookRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for deleteWebhook - * @param webhookId The identifier of the Webhook. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteWebhookCall(Integer webhookId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/webhooks/{webhookId}" - .replace("{" + "webhookId" + "}", localVarApiClient.escapeString(webhookId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteWebhookValidateBeforeCall(Integer webhookId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'webhookId' is set - if (webhookId == null) { - throw new ApiException("Missing the required parameter 'webhookId' when calling deleteWebhook(Async)"); - } - - return deleteWebhookCall(webhookId, _callback); - - } - - /** - * Delete Webhook - * This endpoint removes a Webhook identified by the `webhookId` parameter. - * @param webhookId The identifier of the Webhook. (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public void deleteWebhook(Integer webhookId) throws ApiException { - deleteWebhookWithHttpInfo(webhookId); - } - - /** - * Delete Webhook - * This endpoint removes a Webhook identified by the `webhookId` parameter. - * @param webhookId The identifier of the Webhook. (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse deleteWebhookWithHttpInfo(Integer webhookId) throws ApiException { - okhttp3.Call localVarCall = deleteWebhookValidateBeforeCall(webhookId, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete Webhook (asynchronously) - * This endpoint removes a Webhook identified by the `webhookId` parameter. - * @param webhookId The identifier of the Webhook. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call deleteWebhookAsync(Integer webhookId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deleteWebhookValidateBeforeCall(webhookId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for getWebhook - * @param webhookId The identifier of the Webhook. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the webhook data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getWebhookCall(Integer webhookId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/webhooks/{webhookId}" - .replace("{" + "webhookId" + "}", localVarApiClient.escapeString(webhookId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getWebhookValidateBeforeCall(Integer webhookId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'webhookId' is set - if (webhookId == null) { - throw new ApiException("Missing the required parameter 'webhookId' when calling getWebhook(Async)"); - } - - return getWebhookCall(webhookId, _callback); - - } - - /** - * Get Webhook - * This endpoint returns the metadata of a Webhook identified by the `webhookId`. - * @param webhookId The identifier of the Webhook. (required) - * @return WebhookModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the webhook data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public WebhookModel getWebhook(Integer webhookId) throws ApiException { - ApiResponse localVarResp = getWebhookWithHttpInfo(webhookId); - return localVarResp.getData(); - } - - /** - * Get Webhook - * This endpoint returns the metadata of a Webhook identified by the `webhookId`. - * @param webhookId The identifier of the Webhook. (required) - * @return ApiResponse<WebhookModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the webhook data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse getWebhookWithHttpInfo(Integer webhookId) throws ApiException { - okhttp3.Call localVarCall = getWebhookValidateBeforeCall(webhookId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Webhook (asynchronously) - * This endpoint returns the metadata of a Webhook identified by the `webhookId`. - * @param webhookId The identifier of the Webhook. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the webhook data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getWebhookAsync(Integer webhookId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getWebhookValidateBeforeCall(webhookId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getWebhookSigningKeys - * @param webhookId The identifier of the Webhook. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the webhook signing keys are returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getWebhookSigningKeysCall(Integer webhookId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/webhooks/{webhookId}/keys" - .replace("{" + "webhookId" + "}", localVarApiClient.escapeString(webhookId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getWebhookSigningKeysValidateBeforeCall(Integer webhookId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'webhookId' is set - if (webhookId == null) { - throw new ApiException("Missing the required parameter 'webhookId' when calling getWebhookSigningKeys(Async)"); - } - - return getWebhookSigningKeysCall(webhookId, _callback); - - } - - /** - * Get Webhook Signing Keys - * This endpoint returns the signing keys of a Webhook identified by the `webhookId`. Signing keys are used for ensuring the Webhook requests you receive are actually sent by ConfigCat. <a href=\"https://configcat.com/docs/advanced/notifications-webhooks/#verifying-webhook-requests\" target=\"_blank\" rel=\"noopener noreferrer\">Here</a> you can read more about Webhook request verification. - * @param webhookId The identifier of the Webhook. (required) - * @return WebhookSigningKeysModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the webhook signing keys are returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public WebhookSigningKeysModel getWebhookSigningKeys(Integer webhookId) throws ApiException { - ApiResponse localVarResp = getWebhookSigningKeysWithHttpInfo(webhookId); - return localVarResp.getData(); - } - - /** - * Get Webhook Signing Keys - * This endpoint returns the signing keys of a Webhook identified by the `webhookId`. Signing keys are used for ensuring the Webhook requests you receive are actually sent by ConfigCat. <a href=\"https://configcat.com/docs/advanced/notifications-webhooks/#verifying-webhook-requests\" target=\"_blank\" rel=\"noopener noreferrer\">Here</a> you can read more about Webhook request verification. - * @param webhookId The identifier of the Webhook. (required) - * @return ApiResponse<WebhookSigningKeysModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the webhook signing keys are returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse getWebhookSigningKeysWithHttpInfo(Integer webhookId) throws ApiException { - okhttp3.Call localVarCall = getWebhookSigningKeysValidateBeforeCall(webhookId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Webhook Signing Keys (asynchronously) - * This endpoint returns the signing keys of a Webhook identified by the `webhookId`. Signing keys are used for ensuring the Webhook requests you receive are actually sent by ConfigCat. <a href=\"https://configcat.com/docs/advanced/notifications-webhooks/#verifying-webhook-requests\" target=\"_blank\" rel=\"noopener noreferrer\">Here</a> you can read more about Webhook request verification. - * @param webhookId The identifier of the Webhook. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When everything is ok, the webhook signing keys are returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getWebhookSigningKeysAsync(Integer webhookId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getWebhookSigningKeysValidateBeforeCall(webhookId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getWebhooks - * @param productId The identifier of the Product. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getWebhooksCall(UUID productId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/products/{productId}/webhooks" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getWebhooksValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'productId' is set - if (productId == null) { - throw new ApiException("Missing the required parameter 'productId' when calling getWebhooks(Async)"); - } - - return getWebhooksCall(productId, _callback); - - } - - /** - * List Webhooks - * This endpoint returns the list of the Webhooks that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @return List<WebhookModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public List getWebhooks(UUID productId) throws ApiException { - ApiResponse> localVarResp = getWebhooksWithHttpInfo(productId); - return localVarResp.getData(); - } - - /** - * List Webhooks - * This endpoint returns the list of the Webhooks that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @return ApiResponse<List<WebhookModel>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse> getWebhooksWithHttpInfo(UUID productId) throws ApiException { - okhttp3.Call localVarCall = getWebhooksValidateBeforeCall(productId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Webhooks (asynchronously) - * This endpoint returns the list of the Webhooks that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. - * @param productId The identifier of the Product. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call getWebhooksAsync(UUID productId, final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = getWebhooksValidateBeforeCall(productId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for replaceWebhook - * @param webhookId The identifier of the Webhook. (required) - * @param webHookRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the replace was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call replaceWebhookCall(Integer webhookId, WebHookRequest webHookRequest, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = webHookRequest; - - // create path and map variables - String localVarPath = "/v1/webhooks/{webhookId}" - .replace("{" + "webhookId" + "}", localVarApiClient.escapeString(webhookId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call replaceWebhookValidateBeforeCall(Integer webhookId, WebHookRequest webHookRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'webhookId' is set - if (webhookId == null) { - throw new ApiException("Missing the required parameter 'webhookId' when calling replaceWebhook(Async)"); - } - - // verify the required parameter 'webHookRequest' is set - if (webHookRequest == null) { - throw new ApiException("Missing the required parameter 'webHookRequest' when calling replaceWebhook(Async)"); - } - - return replaceWebhookCall(webhookId, webHookRequest, _callback); - - } - - /** - * Replace Webhook - * This endpoint replaces the whole value of a Webhook identified by the `webhookId` parameter. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. - * @param webhookId The identifier of the Webhook. (required) - * @param webHookRequest (required) - * @return WebhookModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the replace was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public WebhookModel replaceWebhook(Integer webhookId, WebHookRequest webHookRequest) throws ApiException { - ApiResponse localVarResp = replaceWebhookWithHttpInfo(webhookId, webHookRequest); - return localVarResp.getData(); - } - - /** - * Replace Webhook - * This endpoint replaces the whole value of a Webhook identified by the `webhookId` parameter. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. - * @param webhookId The identifier of the Webhook. (required) - * @param webHookRequest (required) - * @return ApiResponse<WebhookModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the replace was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse replaceWebhookWithHttpInfo(Integer webhookId, WebHookRequest webHookRequest) throws ApiException { - okhttp3.Call localVarCall = replaceWebhookValidateBeforeCall(webhookId, webHookRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Replace Webhook (asynchronously) - * This endpoint replaces the whole value of a Webhook identified by the `webhookId` parameter. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. - * @param webhookId The identifier of the Webhook. (required) - * @param webHookRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the replace was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call replaceWebhookAsync(Integer webhookId, WebHookRequest webHookRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = replaceWebhookValidateBeforeCall(webhookId, webHookRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for updateWebhook - * @param webhookId The identifier of the Webhook. (required) - * @param jsonPatchOperation (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateWebhookCall(Integer webhookId, List jsonPatchOperation, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = jsonPatchOperation; - - // create path and map variables - String localVarPath = "/v1/webhooks/{webhookId}" - .replace("{" + "webhookId" + "}", localVarApiClient.escapeString(webhookId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", - "text/json", - "application/*+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "Basic" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateWebhookValidateBeforeCall(Integer webhookId, List jsonPatchOperation, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'webhookId' is set - if (webhookId == null) { - throw new ApiException("Missing the required parameter 'webhookId' when calling updateWebhook(Async)"); - } - - // verify the required parameter 'jsonPatchOperation' is set - if (jsonPatchOperation == null) { - throw new ApiException("Missing the required parameter 'jsonPatchOperation' when calling updateWebhook(Async)"); - } - - return updateWebhookCall(webhookId, jsonPatchOperation, _callback); - - } - - /** - * Update Webhook - * This endpoint updates a Webhook identified by the `webhookId` parameter with a collection of [JSON Patch](https://jsonpatch.com) operations. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. For example: We have the following resource. ```json { \"webhookId\": 6, \"url\": \"https://example.com/hook\", \"httpMethod\": \"post\", \"content\": \"null\", \"webHookHeaders\": [] } ``` If we send an update request body as below (it changes the `content` field and adds a new HTTP header): ```json [ { \"op\": \"replace\", \"path\": \"/content\", \"value\": \"Some webhook content.\" }, { \"op\": \"add\", \"path\": \"/webHookHeaders/-\", \"value\": { \"key\": \"X-Custom-Header\", \"value\": \"Custom header value\" } } ] ``` Only the `content` and `webHookHeaders` are updated and all the other attributes remain unchanged. So we get a response like this: ```json { \"webhookId\": 6, \"url\": \"https://example.com/hook\", \"httpMethod\": \"post\", \"content\": \"Some webhook content.\", \"webHookHeaders\": [ { \"key\": \"X-Custom-Header\", \"value\": \"Custom header value\", \"isSecure\": false } ] } ``` - * @param webhookId The identifier of the Webhook. (required) - * @param jsonPatchOperation (required) - * @return WebhookModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public WebhookModel updateWebhook(Integer webhookId, List jsonPatchOperation) throws ApiException { - ApiResponse localVarResp = updateWebhookWithHttpInfo(webhookId, jsonPatchOperation); - return localVarResp.getData(); - } - - /** - * Update Webhook - * This endpoint updates a Webhook identified by the `webhookId` parameter with a collection of [JSON Patch](https://jsonpatch.com) operations. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. For example: We have the following resource. ```json { \"webhookId\": 6, \"url\": \"https://example.com/hook\", \"httpMethod\": \"post\", \"content\": \"null\", \"webHookHeaders\": [] } ``` If we send an update request body as below (it changes the `content` field and adds a new HTTP header): ```json [ { \"op\": \"replace\", \"path\": \"/content\", \"value\": \"Some webhook content.\" }, { \"op\": \"add\", \"path\": \"/webHookHeaders/-\", \"value\": { \"key\": \"X-Custom-Header\", \"value\": \"Custom header value\" } } ] ``` Only the `content` and `webHookHeaders` are updated and all the other attributes remain unchanged. So we get a response like this: ```json { \"webhookId\": 6, \"url\": \"https://example.com/hook\", \"httpMethod\": \"post\", \"content\": \"Some webhook content.\", \"webHookHeaders\": [ { \"key\": \"X-Custom-Header\", \"value\": \"Custom header value\", \"isSecure\": false } ] } ``` - * @param webhookId The identifier of the Webhook. (required) - * @param jsonPatchOperation (required) - * @return ApiResponse<WebhookModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public ApiResponse updateWebhookWithHttpInfo(Integer webhookId, List jsonPatchOperation) throws ApiException { - okhttp3.Call localVarCall = updateWebhookValidateBeforeCall(webhookId, jsonPatchOperation, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update Webhook (asynchronously) - * This endpoint updates a Webhook identified by the `webhookId` parameter with a collection of [JSON Patch](https://jsonpatch.com) operations. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. For example: We have the following resource. ```json { \"webhookId\": 6, \"url\": \"https://example.com/hook\", \"httpMethod\": \"post\", \"content\": \"null\", \"webHookHeaders\": [] } ``` If we send an update request body as below (it changes the `content` field and adds a new HTTP header): ```json [ { \"op\": \"replace\", \"path\": \"/content\", \"value\": \"Some webhook content.\" }, { \"op\": \"add\", \"path\": \"/webHookHeaders/-\", \"value\": { \"key\": \"X-Custom-Header\", \"value\": \"Custom header value\" } } ] ``` Only the `content` and `webHookHeaders` are updated and all the other attributes remain unchanged. So we get a response like this: ```json { \"webhookId\": 6, \"url\": \"https://example.com/hook\", \"httpMethod\": \"post\", \"content\": \"Some webhook content.\", \"webHookHeaders\": [ { \"key\": \"X-Custom-Header\", \"value\": \"Custom header value\", \"isSecure\": false } ] } ``` - * @param webhookId The identifier of the Webhook. (required) - * @param jsonPatchOperation (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
- */ - public okhttp3.Call updateWebhookAsync(Integer webhookId, List jsonPatchOperation, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateWebhookValidateBeforeCall(webhookId, jsonPatchOperation, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/auth/ApiKeyAuth.java b/src/main/java/com/configcat/publicapi/java/client/auth/ApiKeyAuth.java deleted file mode 100644 index 36a056f..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/auth/ApiKeyAuth.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.auth; - -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Pair; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class ApiKeyAuth implements Authentication { - private final String location; - private final String paramName; - - private String apiKey; - private String apiKeyPrefix; - - public ApiKeyAuth(String location, String paramName) { - this.location = location; - this.paramName = paramName; - } - - public String getLocation() { - return location; - } - - public String getParamName() { - return paramName; - } - - public String getApiKey() { - return apiKey; - } - - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } - - public String getApiKeyPrefix() { - return apiKeyPrefix; - } - - public void setApiKeyPrefix(String apiKeyPrefix) { - this.apiKeyPrefix = apiKeyPrefix; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (apiKey == null) { - return; - } - String value; - if (apiKeyPrefix != null) { - value = apiKeyPrefix + " " + apiKey; - } else { - value = apiKey; - } - if ("query".equals(location)) { - queryParams.add(new Pair(paramName, value)); - } else if ("header".equals(location)) { - headerParams.put(paramName, value); - } else if ("cookie".equals(location)) { - cookieParams.put(paramName, value); - } - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/auth/Authentication.java b/src/main/java/com/configcat/publicapi/java/client/auth/Authentication.java deleted file mode 100644 index 9e0c12f..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/auth/Authentication.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.auth; - -import com.configcat.publicapi.java.client.Pair; -import com.configcat.publicapi.java.client.ApiException; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -public interface Authentication { - /** - * Apply authentication settings to header and query params. - * - * @param queryParams List of query parameters - * @param headerParams Map of header parameters - * @param cookieParams Map of cookie parameters - * @param payload HTTP request body - * @param method HTTP method - * @param uri URI - * @throws ApiException if failed to update the parameters - */ - void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; -} diff --git a/src/main/java/com/configcat/publicapi/java/client/auth/HttpBasicAuth.java b/src/main/java/com/configcat/publicapi/java/client/auth/HttpBasicAuth.java deleted file mode 100644 index f5abe41..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/auth/HttpBasicAuth.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.auth; - -import com.configcat.publicapi.java.client.Pair; -import com.configcat.publicapi.java.client.ApiException; - -import okhttp3.Credentials; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -public class HttpBasicAuth implements Authentication { - private String username; - private String password; - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (username == null && password == null) { - return; - } - headerParams.put("Authorization", Credentials.basic( - username == null ? "" : username, - password == null ? "" : password)); - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/auth/HttpBearerAuth.java b/src/main/java/com/configcat/publicapi/java/client/auth/HttpBearerAuth.java deleted file mode 100644 index 209d7ce..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/auth/HttpBearerAuth.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.auth; - -import com.configcat.publicapi.java.client.ApiException; -import com.configcat.publicapi.java.client.Pair; - -import java.net.URI; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.function.Supplier; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class HttpBearerAuth implements Authentication { - private final String scheme; - private Supplier tokenSupplier; - - public HttpBearerAuth(String scheme) { - this.scheme = scheme; - } - - /** - * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @return The bearer token - */ - public String getBearerToken() { - return tokenSupplier.get(); - } - - /** - * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @param bearerToken The bearer token to send in the Authorization header - */ - public void setBearerToken(String bearerToken) { - this.tokenSupplier = () -> bearerToken; - } - - /** - * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. - * - * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header - */ - public void setBearerToken(Supplier tokenSupplier) { - this.tokenSupplier = tokenSupplier; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); - if (bearerToken == null) { - return; - } - - headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); - } - - private static String upperCaseBearer(String scheme) { - return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; - } -} diff --git a/src/main/java/com/configcat/publicapi/java/client/model/AbstractOpenApiSchema.java b/src/main/java/com/configcat/publicapi/java/client/model/AbstractOpenApiSchema.java deleted file mode 100644 index 805cb9b..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/AbstractOpenApiSchema.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import com.configcat.publicapi.java.client.ApiException; -import java.util.Objects; -import java.lang.reflect.Type; -import java.util.Map; - -/** - * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public abstract class AbstractOpenApiSchema { - - // store the actual instance of the schema/object - private Object instance; - - // is nullable - private Boolean isNullable; - - // schema type (e.g. oneOf, anyOf) - private final String schemaType; - - public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { - this.schemaType = schemaType; - this.isNullable = isNullable; - } - - /** - * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object - * - * @return an instance of the actual schema/object - */ - public abstract Map> getSchemas(); - - /** - * Get the actual instance - * - * @return an instance of the actual schema/object - */ - //@JsonValue - public Object getActualInstance() {return instance;} - - /** - * Set the actual instance - * - * @param instance the actual instance of the schema/object - */ - public void setActualInstance(Object instance) {this.instance = instance;} - - /** - * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well - * - * @return an instance of the actual schema/object - */ - public Object getActualInstanceRecursively() { - return getActualInstanceRecursively(this); - } - - private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { - if (object.getActualInstance() == null) { - return null; - } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { - return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); - } else { - return object.getActualInstance(); - } - } - - /** - * Get the schema type (e.g. anyOf, oneOf) - * - * @return the schema type - */ - public String getSchemaType() { - return schemaType; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ").append(getClass()).append(" {\n"); - sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); - sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); - sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; - return Objects.equals(this.instance, a.instance) && - Objects.equals(this.isNullable, a.isNullable) && - Objects.equals(this.schemaType, a.schemaType); - } - - @Override - public int hashCode() { - return Objects.hash(instance, isNullable, schemaType); - } - - /** - * Is nullable - * - * @return true if it's nullable - */ - public Boolean isNullable() { - if (Boolean.TRUE.equals(isNullable)) { - return Boolean.TRUE; - } else { - return Boolean.FALSE; - } - } - - - -} diff --git a/src/main/java/com/configcat/publicapi/java/client/model/AccessType.java b/src/main/java/com/configcat/publicapi/java/client/model/AccessType.java deleted file mode 100644 index e32ffb9..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/AccessType.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Represent the Feature Management permission. - */ -@JsonAdapter(AccessType.Adapter.class) -public enum AccessType { - - READ_ONLY("readOnly"), - - FULL("full"), - - CUSTOM("custom"); - - private String value; - - AccessType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AccessType fromValue(String value) { - for (AccessType b : AccessType.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AccessType enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AccessType read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AccessType.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - AccessType.fromValue(value); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/AddOrUpdateIntegrationLinkModel.java b/src/main/java/com/configcat/publicapi/java/client/model/AddOrUpdateIntegrationLinkModel.java deleted file mode 100644 index 6375f81..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/AddOrUpdateIntegrationLinkModel.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * AddOrUpdateIntegrationLinkModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class AddOrUpdateIntegrationLinkModel { - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_URL = "url"; - @SerializedName(SERIALIZED_NAME_URL) - private String url; - - public AddOrUpdateIntegrationLinkModel() { - } - - public AddOrUpdateIntegrationLinkModel description(String description) { - this.description = description; - return this; - } - - /** - * Get description - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - - public AddOrUpdateIntegrationLinkModel url(String url) { - this.url = url; - return this; - } - - /** - * Get url - * @return url - */ - @javax.annotation.Nullable - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the AddOrUpdateIntegrationLinkModel instance itself - */ - public AddOrUpdateIntegrationLinkModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AddOrUpdateIntegrationLinkModel addOrUpdateIntegrationLinkModel = (AddOrUpdateIntegrationLinkModel) o; - return Objects.equals(this.description, addOrUpdateIntegrationLinkModel.description) && - Objects.equals(this.url, addOrUpdateIntegrationLinkModel.url)&& - Objects.equals(this.additionalProperties, addOrUpdateIntegrationLinkModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(description, url, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddOrUpdateIntegrationLinkModel {\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" url: ").append(toIndentedString(url)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("description"); - openapiFields.add("url"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AddOrUpdateIntegrationLinkModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AddOrUpdateIntegrationLinkModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AddOrUpdateIntegrationLinkModel is not found in the empty JSON string", AddOrUpdateIntegrationLinkModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if ((jsonObj.get("url") != null && !jsonObj.get("url").isJsonNull()) && !jsonObj.get("url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddOrUpdateIntegrationLinkModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddOrUpdateIntegrationLinkModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AddOrUpdateIntegrationLinkModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AddOrUpdateIntegrationLinkModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public AddOrUpdateIntegrationLinkModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AddOrUpdateIntegrationLinkModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AddOrUpdateIntegrationLinkModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddOrUpdateIntegrationLinkModel - * @throws IOException if the JSON string is invalid with respect to AddOrUpdateIntegrationLinkModel - */ - public static AddOrUpdateIntegrationLinkModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddOrUpdateIntegrationLinkModel.class); - } - - /** - * Convert an instance of AddOrUpdateIntegrationLinkModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/AddOrUpdateJiraIntegrationLinkModel.java b/src/main/java/com/configcat/publicapi/java/client/model/AddOrUpdateJiraIntegrationLinkModel.java deleted file mode 100644 index e64df47..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/AddOrUpdateJiraIntegrationLinkModel.java +++ /dev/null @@ -1,395 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * AddOrUpdateJiraIntegrationLinkModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class AddOrUpdateJiraIntegrationLinkModel { - public static final String SERIALIZED_NAME_JIRA_JWT_TOKEN = "jiraJwtToken"; - @SerializedName(SERIALIZED_NAME_JIRA_JWT_TOKEN) - private String jiraJwtToken; - - public static final String SERIALIZED_NAME_CLIENT_KEY = "clientKey"; - @SerializedName(SERIALIZED_NAME_CLIENT_KEY) - private String clientKey; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_URL = "url"; - @SerializedName(SERIALIZED_NAME_URL) - private String url; - - public AddOrUpdateJiraIntegrationLinkModel() { - } - - public AddOrUpdateJiraIntegrationLinkModel jiraJwtToken(String jiraJwtToken) { - this.jiraJwtToken = jiraJwtToken; - return this; - } - - /** - * Get jiraJwtToken - * @return jiraJwtToken - */ - @javax.annotation.Nonnull - public String getJiraJwtToken() { - return jiraJwtToken; - } - - public void setJiraJwtToken(String jiraJwtToken) { - this.jiraJwtToken = jiraJwtToken; - } - - - public AddOrUpdateJiraIntegrationLinkModel clientKey(String clientKey) { - this.clientKey = clientKey; - return this; - } - - /** - * Get clientKey - * @return clientKey - */ - @javax.annotation.Nonnull - public String getClientKey() { - return clientKey; - } - - public void setClientKey(String clientKey) { - this.clientKey = clientKey; - } - - - public AddOrUpdateJiraIntegrationLinkModel description(String description) { - this.description = description; - return this; - } - - /** - * Get description - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - - public AddOrUpdateJiraIntegrationLinkModel url(String url) { - this.url = url; - return this; - } - - /** - * Get url - * @return url - */ - @javax.annotation.Nullable - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the AddOrUpdateJiraIntegrationLinkModel instance itself - */ - public AddOrUpdateJiraIntegrationLinkModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AddOrUpdateJiraIntegrationLinkModel addOrUpdateJiraIntegrationLinkModel = (AddOrUpdateJiraIntegrationLinkModel) o; - return Objects.equals(this.jiraJwtToken, addOrUpdateJiraIntegrationLinkModel.jiraJwtToken) && - Objects.equals(this.clientKey, addOrUpdateJiraIntegrationLinkModel.clientKey) && - Objects.equals(this.description, addOrUpdateJiraIntegrationLinkModel.description) && - Objects.equals(this.url, addOrUpdateJiraIntegrationLinkModel.url)&& - Objects.equals(this.additionalProperties, addOrUpdateJiraIntegrationLinkModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(jiraJwtToken, clientKey, description, url, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddOrUpdateJiraIntegrationLinkModel {\n"); - sb.append(" jiraJwtToken: ").append(toIndentedString(jiraJwtToken)).append("\n"); - sb.append(" clientKey: ").append(toIndentedString(clientKey)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" url: ").append(toIndentedString(url)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("jiraJwtToken"); - openapiFields.add("clientKey"); - openapiFields.add("description"); - openapiFields.add("url"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("jiraJwtToken"); - openapiRequiredFields.add("clientKey"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AddOrUpdateJiraIntegrationLinkModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AddOrUpdateJiraIntegrationLinkModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AddOrUpdateJiraIntegrationLinkModel is not found in the empty JSON string", AddOrUpdateJiraIntegrationLinkModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AddOrUpdateJiraIntegrationLinkModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("jiraJwtToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `jiraJwtToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jiraJwtToken").toString())); - } - if (!jsonObj.get("clientKey").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `clientKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientKey").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if ((jsonObj.get("url") != null && !jsonObj.get("url").isJsonNull()) && !jsonObj.get("url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddOrUpdateJiraIntegrationLinkModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddOrUpdateJiraIntegrationLinkModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AddOrUpdateJiraIntegrationLinkModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AddOrUpdateJiraIntegrationLinkModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public AddOrUpdateJiraIntegrationLinkModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AddOrUpdateJiraIntegrationLinkModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AddOrUpdateJiraIntegrationLinkModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddOrUpdateJiraIntegrationLinkModel - * @throws IOException if the JSON string is invalid with respect to AddOrUpdateJiraIntegrationLinkModel - */ - public static AddOrUpdateJiraIntegrationLinkModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddOrUpdateJiraIntegrationLinkModel.class); - } - - /** - * Convert an instance of AddOrUpdateJiraIntegrationLinkModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/AuditLogItemModel.java b/src/main/java/com/configcat/publicapi/java/client/model/AuditLogItemModel.java deleted file mode 100644 index a16fdc4..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/AuditLogItemModel.java +++ /dev/null @@ -1,613 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.AuditLogType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * AuditLogItemModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class AuditLogItemModel { - public static final String SERIALIZED_NAME_AUDIT_LOG_ID = "auditLogId"; - @SerializedName(SERIALIZED_NAME_AUDIT_LOG_ID) - private Long auditLogId; - - public static final String SERIALIZED_NAME_AUDIT_LOG_DATE_TIME = "auditLogDateTime"; - @SerializedName(SERIALIZED_NAME_AUDIT_LOG_DATE_TIME) - private OffsetDateTime auditLogDateTime; - - public static final String SERIALIZED_NAME_AUDIT_LOG_TYPE_ENUM = "auditLogTypeEnum"; - @SerializedName(SERIALIZED_NAME_AUDIT_LOG_TYPE_ENUM) - private AuditLogType auditLogTypeEnum; - - public static final String SERIALIZED_NAME_CHANGE_SET_ID = "changeSetId"; - @SerializedName(SERIALIZED_NAME_CHANGE_SET_ID) - private UUID changeSetId; - - public static final String SERIALIZED_NAME_TRUNCATED = "truncated"; - @SerializedName(SERIALIZED_NAME_TRUNCATED) - private Boolean truncated; - - public static final String SERIALIZED_NAME_AUDIT_LOG_TYPE = "auditLogType"; - @SerializedName(SERIALIZED_NAME_AUDIT_LOG_TYPE) - private String auditLogType; - - public static final String SERIALIZED_NAME_USER_EMAIL = "userEmail"; - @SerializedName(SERIALIZED_NAME_USER_EMAIL) - private String userEmail; - - public static final String SERIALIZED_NAME_USER_NAME = "userName"; - @SerializedName(SERIALIZED_NAME_USER_NAME) - private String userName; - - public static final String SERIALIZED_NAME_WHERE = "where"; - @SerializedName(SERIALIZED_NAME_WHERE) - private String where; - - public static final String SERIALIZED_NAME_WHY = "why"; - @SerializedName(SERIALIZED_NAME_WHY) - private String why; - - public static final String SERIALIZED_NAME_ACTION_TARGET = "actionTarget"; - @SerializedName(SERIALIZED_NAME_ACTION_TARGET) - private String actionTarget; - - public static final String SERIALIZED_NAME_DETAILS = "details"; - @SerializedName(SERIALIZED_NAME_DETAILS) - private String details; - - public AuditLogItemModel() { - } - - public AuditLogItemModel auditLogId(Long auditLogId) { - this.auditLogId = auditLogId; - return this; - } - - /** - * Get auditLogId - * @return auditLogId - */ - @javax.annotation.Nullable - public Long getAuditLogId() { - return auditLogId; - } - - public void setAuditLogId(Long auditLogId) { - this.auditLogId = auditLogId; - } - - - public AuditLogItemModel auditLogDateTime(OffsetDateTime auditLogDateTime) { - this.auditLogDateTime = auditLogDateTime; - return this; - } - - /** - * Get auditLogDateTime - * @return auditLogDateTime - */ - @javax.annotation.Nullable - public OffsetDateTime getAuditLogDateTime() { - return auditLogDateTime; - } - - public void setAuditLogDateTime(OffsetDateTime auditLogDateTime) { - this.auditLogDateTime = auditLogDateTime; - } - - - public AuditLogItemModel auditLogTypeEnum(AuditLogType auditLogTypeEnum) { - this.auditLogTypeEnum = auditLogTypeEnum; - return this; - } - - /** - * Get auditLogTypeEnum - * @return auditLogTypeEnum - */ - @javax.annotation.Nullable - public AuditLogType getAuditLogTypeEnum() { - return auditLogTypeEnum; - } - - public void setAuditLogTypeEnum(AuditLogType auditLogTypeEnum) { - this.auditLogTypeEnum = auditLogTypeEnum; - } - - - public AuditLogItemModel changeSetId(UUID changeSetId) { - this.changeSetId = changeSetId; - return this; - } - - /** - * Get changeSetId - * @return changeSetId - */ - @javax.annotation.Nullable - public UUID getChangeSetId() { - return changeSetId; - } - - public void setChangeSetId(UUID changeSetId) { - this.changeSetId = changeSetId; - } - - - public AuditLogItemModel truncated(Boolean truncated) { - this.truncated = truncated; - return this; - } - - /** - * Get truncated - * @return truncated - */ - @javax.annotation.Nullable - public Boolean getTruncated() { - return truncated; - } - - public void setTruncated(Boolean truncated) { - this.truncated = truncated; - } - - - public AuditLogItemModel auditLogType(String auditLogType) { - this.auditLogType = auditLogType; - return this; - } - - /** - * Get auditLogType - * @return auditLogType - */ - @javax.annotation.Nullable - public String getAuditLogType() { - return auditLogType; - } - - public void setAuditLogType(String auditLogType) { - this.auditLogType = auditLogType; - } - - - public AuditLogItemModel userEmail(String userEmail) { - this.userEmail = userEmail; - return this; - } - - /** - * Get userEmail - * @return userEmail - */ - @javax.annotation.Nullable - public String getUserEmail() { - return userEmail; - } - - public void setUserEmail(String userEmail) { - this.userEmail = userEmail; - } - - - public AuditLogItemModel userName(String userName) { - this.userName = userName; - return this; - } - - /** - * Get userName - * @return userName - */ - @javax.annotation.Nullable - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - - public AuditLogItemModel where(String where) { - this.where = where; - return this; - } - - /** - * Get where - * @return where - */ - @javax.annotation.Nullable - public String getWhere() { - return where; - } - - public void setWhere(String where) { - this.where = where; - } - - - public AuditLogItemModel why(String why) { - this.why = why; - return this; - } - - /** - * Get why - * @return why - */ - @javax.annotation.Nullable - public String getWhy() { - return why; - } - - public void setWhy(String why) { - this.why = why; - } - - - public AuditLogItemModel actionTarget(String actionTarget) { - this.actionTarget = actionTarget; - return this; - } - - /** - * Get actionTarget - * @return actionTarget - */ - @javax.annotation.Nullable - public String getActionTarget() { - return actionTarget; - } - - public void setActionTarget(String actionTarget) { - this.actionTarget = actionTarget; - } - - - public AuditLogItemModel details(String details) { - this.details = details; - return this; - } - - /** - * Get details - * @return details - */ - @javax.annotation.Nullable - public String getDetails() { - return details; - } - - public void setDetails(String details) { - this.details = details; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the AuditLogItemModel instance itself - */ - public AuditLogItemModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AuditLogItemModel auditLogItemModel = (AuditLogItemModel) o; - return Objects.equals(this.auditLogId, auditLogItemModel.auditLogId) && - Objects.equals(this.auditLogDateTime, auditLogItemModel.auditLogDateTime) && - Objects.equals(this.auditLogTypeEnum, auditLogItemModel.auditLogTypeEnum) && - Objects.equals(this.changeSetId, auditLogItemModel.changeSetId) && - Objects.equals(this.truncated, auditLogItemModel.truncated) && - Objects.equals(this.auditLogType, auditLogItemModel.auditLogType) && - Objects.equals(this.userEmail, auditLogItemModel.userEmail) && - Objects.equals(this.userName, auditLogItemModel.userName) && - Objects.equals(this.where, auditLogItemModel.where) && - Objects.equals(this.why, auditLogItemModel.why) && - Objects.equals(this.actionTarget, auditLogItemModel.actionTarget) && - Objects.equals(this.details, auditLogItemModel.details)&& - Objects.equals(this.additionalProperties, auditLogItemModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(auditLogId, auditLogDateTime, auditLogTypeEnum, changeSetId, truncated, auditLogType, userEmail, userName, where, why, actionTarget, details, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AuditLogItemModel {\n"); - sb.append(" auditLogId: ").append(toIndentedString(auditLogId)).append("\n"); - sb.append(" auditLogDateTime: ").append(toIndentedString(auditLogDateTime)).append("\n"); - sb.append(" auditLogTypeEnum: ").append(toIndentedString(auditLogTypeEnum)).append("\n"); - sb.append(" changeSetId: ").append(toIndentedString(changeSetId)).append("\n"); - sb.append(" truncated: ").append(toIndentedString(truncated)).append("\n"); - sb.append(" auditLogType: ").append(toIndentedString(auditLogType)).append("\n"); - sb.append(" userEmail: ").append(toIndentedString(userEmail)).append("\n"); - sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); - sb.append(" where: ").append(toIndentedString(where)).append("\n"); - sb.append(" why: ").append(toIndentedString(why)).append("\n"); - sb.append(" actionTarget: ").append(toIndentedString(actionTarget)).append("\n"); - sb.append(" details: ").append(toIndentedString(details)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("auditLogId"); - openapiFields.add("auditLogDateTime"); - openapiFields.add("auditLogTypeEnum"); - openapiFields.add("changeSetId"); - openapiFields.add("truncated"); - openapiFields.add("auditLogType"); - openapiFields.add("userEmail"); - openapiFields.add("userName"); - openapiFields.add("where"); - openapiFields.add("why"); - openapiFields.add("actionTarget"); - openapiFields.add("details"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AuditLogItemModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AuditLogItemModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AuditLogItemModel is not found in the empty JSON string", AuditLogItemModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `auditLogTypeEnum` - if (jsonObj.get("auditLogTypeEnum") != null && !jsonObj.get("auditLogTypeEnum").isJsonNull()) { - AuditLogType.validateJsonElement(jsonObj.get("auditLogTypeEnum")); - } - if ((jsonObj.get("changeSetId") != null && !jsonObj.get("changeSetId").isJsonNull()) && !jsonObj.get("changeSetId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `changeSetId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("changeSetId").toString())); - } - if ((jsonObj.get("auditLogType") != null && !jsonObj.get("auditLogType").isJsonNull()) && !jsonObj.get("auditLogType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `auditLogType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("auditLogType").toString())); - } - if ((jsonObj.get("userEmail") != null && !jsonObj.get("userEmail").isJsonNull()) && !jsonObj.get("userEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userEmail").toString())); - } - if ((jsonObj.get("userName") != null && !jsonObj.get("userName").isJsonNull()) && !jsonObj.get("userName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userName").toString())); - } - if ((jsonObj.get("where") != null && !jsonObj.get("where").isJsonNull()) && !jsonObj.get("where").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `where` to be a primitive type in the JSON string but got `%s`", jsonObj.get("where").toString())); - } - if ((jsonObj.get("why") != null && !jsonObj.get("why").isJsonNull()) && !jsonObj.get("why").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `why` to be a primitive type in the JSON string but got `%s`", jsonObj.get("why").toString())); - } - if ((jsonObj.get("actionTarget") != null && !jsonObj.get("actionTarget").isJsonNull()) && !jsonObj.get("actionTarget").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `actionTarget` to be a primitive type in the JSON string but got `%s`", jsonObj.get("actionTarget").toString())); - } - if ((jsonObj.get("details") != null && !jsonObj.get("details").isJsonNull()) && !jsonObj.get("details").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `details` to be a primitive type in the JSON string but got `%s`", jsonObj.get("details").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AuditLogItemModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AuditLogItemModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AuditLogItemModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AuditLogItemModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public AuditLogItemModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AuditLogItemModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AuditLogItemModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of AuditLogItemModel - * @throws IOException if the JSON string is invalid with respect to AuditLogItemModel - */ - public static AuditLogItemModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AuditLogItemModel.class); - } - - /** - * Convert an instance of AuditLogItemModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/AuditLogType.java b/src/main/java/com/configcat/publicapi/java/client/model/AuditLogType.java deleted file mode 100644 index d3c7a56..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/AuditLogType.java +++ /dev/null @@ -1,252 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets AuditLogType - */ -@JsonAdapter(AuditLogType.Adapter.class) -public enum AuditLogType { - - PRODUCT_CREATED("productCreated"), - - PRODUCT_CHANGED("productChanged"), - - PRODUCT_OWNERSHIP_TRANSFERRED("productOwnershipTransferred"), - - PRODUCT_DELETED("productDeleted"), - - PRODUCTS_REORDERED("productsReordered"), - - TEAM_MEMBER_INVITED("teamMemberInvited"), - - TEAM_MEMBER_INVITATION_REVOKED("teamMemberInvitationRevoked"), - - TEAM_MEMBER_JOINED("teamMemberJoined"), - - TEAM_MEMBER_PERMISSION_GROUP_CHANGED("teamMemberPermissionGroupChanged"), - - TEAM_MEMBER_REMOVED("teamMemberRemoved"), - - TEAM_MEMBER_LEFT("teamMemberLeft"), - - TEAM_MEMBER_INVITATION_CHANGED("teamMemberInvitationChanged"), - - TEAM_MEMBER_INVITATION_RESENT("teamMemberInvitationResent"), - - TEAM_MEMBER_INVITATION_REJECTED("teamMemberInvitationRejected"), - - CONFIG_CREATED("configCreated"), - - CONFIG_CHANGED("configChanged"), - - CONFIG_DELETED("configDeleted"), - - CONFIGS_REORDERED("configsReordered"), - - ENVIRONMENT_CREATED("environmentCreated"), - - ENVIRONMENT_CHANGED("environmentChanged"), - - ENVIRONMENT_DELETED("environmentDeleted"), - - ENVIRONMENTS_REORDERED("environmentsReordered"), - - SETTING_CREATED("settingCreated"), - - SETTING_CHANGED("settingChanged"), - - SETTING_DELETED("settingDeleted"), - - SETTINGS_REORDERED("settingsReordered"), - - SETTING_VALUE_CHANGED("settingValueChanged"), - - WEB_HOOK_CREATED("webHookCreated"), - - WEB_HOOK_CHANGED("webHookChanged"), - - WEB_HOOK_DELETED("webHookDeleted"), - - PERMISSION_GROUP_CREATED("permissionGroupCreated"), - - PERMISSION_GROUP_CHANGED("permissionGroupChanged"), - - PERMISSION_GROUP_DELETED("permissionGroupDeleted"), - - PERMISSION_GROUP_DEFAULT("permissionGroupDefault"), - - API_KEY_ADDED("apiKeyAdded"), - - API_KEY_REMOVED("apiKeyRemoved"), - - INTEGRATION_ADDED("integrationAdded"), - - INTEGRATION_CHANGED("integrationChanged"), - - INTEGRATION_REMOVED("integrationRemoved"), - - API_KEY_CONNECTED("apiKeyConnected"), - - INTEGRATION_LINK_ADDED("integrationLinkAdded"), - - INTEGRATION_LINK_REMOVED("integrationLinkRemoved"), - - ORGANIZATION_ADDED("organizationAdded"), - - ORGANIZATION_REMOVED("organizationRemoved"), - - ORGANIZATION_CHANGED("organizationChanged"), - - ORGANIZATION_SUBSCRIPTION_TYPE_CHANGED("organizationSubscriptionTypeChanged"), - - ORGANIZATION_ADMIN_CHANGED("organizationAdminChanged"), - - ORGANIZATION_ADMIN_LEFT("organizationAdminLeft"), - - TWO_FACTOR_DISABLED_FOR_MEMBER("twoFactorDisabledForMember"), - - TAG_ADDED("tagAdded"), - - TAG_CHANGED("tagChanged"), - - TAG_REMOVED("tagRemoved"), - - SETTING_TAG_ADDED("settingTagAdded"), - - SETTING_TAG_REMOVED("settingTagRemoved"), - - PUBLIC_API_ACCESS_TOKEN_ADDED("publicApiAccessTokenAdded"), - - PUBLIC_API_ACCESS_TOKEN_REMOVED("publicApiAccessTokenRemoved"), - - DOMAIN_ADDED("domainAdded"), - - DOMAIN_VERIFIED("domainVerified"), - - DOMAIN_REMOVED("domainRemoved"), - - DOMAIN_SAML_CONFIGURED("domainSamlConfigured"), - - DOMAIN_SAML_DELETED("domainSamlDeleted"), - - AUTO_PROVISIONING_CONFIGURATION_CHANGED("autoProvisioningConfigurationChanged"), - - SAML_IDP_CONFIGURATION_ADDED("samlIdpConfigurationAdded"), - - SAML_IDP_CONFIGURATION_REMOVED("samlIdpConfigurationRemoved"), - - SAML_IDP_CONFIGURATION_UPDATED("samlIdpConfigurationUpdated"), - - AUTO_PROVISIONING_ENABLED_CHANGED("autoProvisioningEnabledChanged"), - - ORGANIZATION_MEMBER_JOINED("organizationMemberJoined"), - - ORGANIZATION_MEMBER_PRODUCT_JOIN_REQUESTED("organizationMemberProductJoinRequested"), - - ORGANIZATION_MEMBER_PRODUCT_JOIN_REQUEST_REJECTED("organizationMemberProductJoinRequestRejected"), - - ORGANIZATION_MEMBER_PRODUCT_JOIN_REQUEST_APPROVED("organizationMemberProductJoinRequestApproved"), - - ORGANIZATION_MEMBER_REMOVED("organizationMemberRemoved"), - - CODE_REFERENCES_UPLOADED("codeReferencesUploaded"), - - CODE_REFERENCE_DELETED("codeReferenceDeleted"), - - CODE_REFERENCE_STALE_BRANCH_DELETED("codeReferenceStaleBranchDeleted"), - - SEGMENT_CREATED("segmentCreated"), - - SEGMENT_CHANGED("segmentChanged"), - - SEGMENT_DELETED("segmentDeleted"), - - WEBHOOK_SIGNING_KEY_DELETED("webhookSigningKeyDeleted"), - - WEBHOOK_SIGNING_KEY_CREATED("webhookSigningKeyCreated"), - - USER_PROVISIONING_CONFIGURATION_CHANGED("userProvisioningConfigurationChanged"), - - SYNC_GROUP_PROVISIONING_RULE_CHANGED("syncGroupProvisioningRuleChanged"), - - SYNC_GROUPS_REORDERED("syncGroupsReordered"), - - SYNC_USER_PROVISIONING_ENABLED("syncUserProvisioningEnabled"), - - SYNC_USER_PROVISIONING_DISABLED("syncUserProvisioningDisabled"), - - USER_EMAIL_CHANGED("userEmailChanged"), - - USER_FULL_NAME_CHANGED("userFullNameChanged"), - - USER_DISABLED("userDisabled"), - - AWS_CONNECTED("awsConnected"), - - AWS_DISCONNECTED("awsDisconnected"); - - private String value; - - AuditLogType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AuditLogType fromValue(String value) { - for (AuditLogType b : AuditLogType.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AuditLogType enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AuditLogType read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AuditLogType.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - AuditLogType.fromValue(value); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/CodeReferenceModel.java b/src/main/java/com/configcat/publicapi/java/client/model/CodeReferenceModel.java deleted file mode 100644 index 1164cbf..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/CodeReferenceModel.java +++ /dev/null @@ -1,523 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.ReferenceLines; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * CodeReferenceModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class CodeReferenceModel { - public static final String SERIALIZED_NAME_BRANCH = "branch"; - @SerializedName(SERIALIZED_NAME_BRANCH) - private String branch; - - public static final String SERIALIZED_NAME_REFERENCES = "references"; - @SerializedName(SERIALIZED_NAME_REFERENCES) - private List references; - - public static final String SERIALIZED_NAME_COMMIT_URL = "commitUrl"; - @SerializedName(SERIALIZED_NAME_COMMIT_URL) - private String commitUrl; - - public static final String SERIALIZED_NAME_COMMIT_HASH = "commitHash"; - @SerializedName(SERIALIZED_NAME_COMMIT_HASH) - private String commitHash; - - public static final String SERIALIZED_NAME_SYNCED_AT = "syncedAt"; - @SerializedName(SERIALIZED_NAME_SYNCED_AT) - private OffsetDateTime syncedAt; - - public static final String SERIALIZED_NAME_REPOSITORY = "repository"; - @SerializedName(SERIALIZED_NAME_REPOSITORY) - private String repository; - - public static final String SERIALIZED_NAME_CODE_REFERENCE_ID = "codeReferenceId"; - @SerializedName(SERIALIZED_NAME_CODE_REFERENCE_ID) - private UUID codeReferenceId; - - public static final String SERIALIZED_NAME_UPLOADER = "uploader"; - @SerializedName(SERIALIZED_NAME_UPLOADER) - private String uploader; - - public CodeReferenceModel() { - } - - public CodeReferenceModel branch(String branch) { - this.branch = branch; - return this; - } - - /** - * The source control branch on where the scan was performed. (Source of the branch selector on the ConfigCat Dashboard) - * @return branch - */ - @javax.annotation.Nullable - public String getBranch() { - return branch; - } - - public void setBranch(String branch) { - this.branch = branch; - } - - - public CodeReferenceModel references(List references) { - this.references = references; - return this; - } - - public CodeReferenceModel addReferencesItem(ReferenceLines referencesItem) { - if (this.references == null) { - this.references = new ArrayList<>(); - } - this.references.add(referencesItem); - return this; - } - - /** - * The actual references to the given Feature Flag or Setting. - * @return references - */ - @javax.annotation.Nullable - public List getReferences() { - return references; - } - - public void setReferences(List references) { - this.references = references; - } - - - public CodeReferenceModel commitUrl(String commitUrl) { - this.commitUrl = commitUrl; - return this; - } - - /** - * The related commit's URL. - * @return commitUrl - */ - @javax.annotation.Nullable - public String getCommitUrl() { - return commitUrl; - } - - public void setCommitUrl(String commitUrl) { - this.commitUrl = commitUrl; - } - - - public CodeReferenceModel commitHash(String commitHash) { - this.commitHash = commitHash; - return this; - } - - /** - * The related commit's hash. - * @return commitHash - */ - @javax.annotation.Nullable - public String getCommitHash() { - return commitHash; - } - - public void setCommitHash(String commitHash) { - this.commitHash = commitHash; - } - - - public CodeReferenceModel syncedAt(OffsetDateTime syncedAt) { - this.syncedAt = syncedAt; - return this; - } - - /** - * The date and time when the reference report was uploaded. - * @return syncedAt - */ - @javax.annotation.Nullable - public OffsetDateTime getSyncedAt() { - return syncedAt; - } - - public void setSyncedAt(OffsetDateTime syncedAt) { - this.syncedAt = syncedAt; - } - - - public CodeReferenceModel repository(String repository) { - this.repository = repository; - return this; - } - - /** - * The source control repository that contains the scanned code. - * @return repository - */ - @javax.annotation.Nullable - public String getRepository() { - return repository; - } - - public void setRepository(String repository) { - this.repository = repository; - } - - - public CodeReferenceModel codeReferenceId(UUID codeReferenceId) { - this.codeReferenceId = codeReferenceId; - return this; - } - - /** - * The identifier of the reference report. - * @return codeReferenceId - */ - @javax.annotation.Nullable - public UUID getCodeReferenceId() { - return codeReferenceId; - } - - public void setCodeReferenceId(UUID codeReferenceId) { - this.codeReferenceId = codeReferenceId; - } - - - public CodeReferenceModel uploader(String uploader) { - this.uploader = uploader; - return this; - } - - /** - * The code reference scanning tool's name. - * @return uploader - */ - @javax.annotation.Nullable - public String getUploader() { - return uploader; - } - - public void setUploader(String uploader) { - this.uploader = uploader; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the CodeReferenceModel instance itself - */ - public CodeReferenceModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CodeReferenceModel codeReferenceModel = (CodeReferenceModel) o; - return Objects.equals(this.branch, codeReferenceModel.branch) && - Objects.equals(this.references, codeReferenceModel.references) && - Objects.equals(this.commitUrl, codeReferenceModel.commitUrl) && - Objects.equals(this.commitHash, codeReferenceModel.commitHash) && - Objects.equals(this.syncedAt, codeReferenceModel.syncedAt) && - Objects.equals(this.repository, codeReferenceModel.repository) && - Objects.equals(this.codeReferenceId, codeReferenceModel.codeReferenceId) && - Objects.equals(this.uploader, codeReferenceModel.uploader)&& - Objects.equals(this.additionalProperties, codeReferenceModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(branch, references, commitUrl, commitHash, syncedAt, repository, codeReferenceId, uploader, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CodeReferenceModel {\n"); - sb.append(" branch: ").append(toIndentedString(branch)).append("\n"); - sb.append(" references: ").append(toIndentedString(references)).append("\n"); - sb.append(" commitUrl: ").append(toIndentedString(commitUrl)).append("\n"); - sb.append(" commitHash: ").append(toIndentedString(commitHash)).append("\n"); - sb.append(" syncedAt: ").append(toIndentedString(syncedAt)).append("\n"); - sb.append(" repository: ").append(toIndentedString(repository)).append("\n"); - sb.append(" codeReferenceId: ").append(toIndentedString(codeReferenceId)).append("\n"); - sb.append(" uploader: ").append(toIndentedString(uploader)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("branch"); - openapiFields.add("references"); - openapiFields.add("commitUrl"); - openapiFields.add("commitHash"); - openapiFields.add("syncedAt"); - openapiFields.add("repository"); - openapiFields.add("codeReferenceId"); - openapiFields.add("uploader"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CodeReferenceModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CodeReferenceModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CodeReferenceModel is not found in the empty JSON string", CodeReferenceModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("branch") != null && !jsonObj.get("branch").isJsonNull()) && !jsonObj.get("branch").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `branch` to be a primitive type in the JSON string but got `%s`", jsonObj.get("branch").toString())); - } - if (jsonObj.get("references") != null && !jsonObj.get("references").isJsonNull()) { - JsonArray jsonArrayreferences = jsonObj.getAsJsonArray("references"); - if (jsonArrayreferences != null) { - // ensure the json data is an array - if (!jsonObj.get("references").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `references` to be an array in the JSON string but got `%s`", jsonObj.get("references").toString())); - } - - // validate the optional field `references` (array) - for (int i = 0; i < jsonArrayreferences.size(); i++) { - ReferenceLines.validateJsonElement(jsonArrayreferences.get(i)); - }; - } - } - if ((jsonObj.get("commitUrl") != null && !jsonObj.get("commitUrl").isJsonNull()) && !jsonObj.get("commitUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `commitUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitUrl").toString())); - } - if ((jsonObj.get("commitHash") != null && !jsonObj.get("commitHash").isJsonNull()) && !jsonObj.get("commitHash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `commitHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitHash").toString())); - } - if ((jsonObj.get("repository") != null && !jsonObj.get("repository").isJsonNull()) && !jsonObj.get("repository").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `repository` to be a primitive type in the JSON string but got `%s`", jsonObj.get("repository").toString())); - } - if ((jsonObj.get("codeReferenceId") != null && !jsonObj.get("codeReferenceId").isJsonNull()) && !jsonObj.get("codeReferenceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `codeReferenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("codeReferenceId").toString())); - } - if ((jsonObj.get("uploader") != null && !jsonObj.get("uploader").isJsonNull()) && !jsonObj.get("uploader").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `uploader` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uploader").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CodeReferenceModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CodeReferenceModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CodeReferenceModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CodeReferenceModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public CodeReferenceModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CodeReferenceModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CodeReferenceModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of CodeReferenceModel - * @throws IOException if the JSON string is invalid with respect to CodeReferenceModel - */ - public static CodeReferenceModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CodeReferenceModel.class); - } - - /** - * Convert an instance of CodeReferenceModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/CodeReferenceRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/CodeReferenceRequest.java deleted file mode 100644 index 741c117..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/CodeReferenceRequest.java +++ /dev/null @@ -1,544 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.FlagReference; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * CodeReferenceRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class CodeReferenceRequest { - public static final String SERIALIZED_NAME_CONFIG_ID = "configId"; - @SerializedName(SERIALIZED_NAME_CONFIG_ID) - private UUID configId; - - public static final String SERIALIZED_NAME_REPOSITORY = "repository"; - @SerializedName(SERIALIZED_NAME_REPOSITORY) - private String repository; - - public static final String SERIALIZED_NAME_BRANCH = "branch"; - @SerializedName(SERIALIZED_NAME_BRANCH) - private String branch; - - public static final String SERIALIZED_NAME_COMMIT_URL = "commitUrl"; - @SerializedName(SERIALIZED_NAME_COMMIT_URL) - private String commitUrl; - - public static final String SERIALIZED_NAME_COMMIT_HASH = "commitHash"; - @SerializedName(SERIALIZED_NAME_COMMIT_HASH) - private String commitHash; - - public static final String SERIALIZED_NAME_UPLOADER = "uploader"; - @SerializedName(SERIALIZED_NAME_UPLOADER) - private String uploader; - - public static final String SERIALIZED_NAME_ACTIVE_BRANCHES = "activeBranches"; - @SerializedName(SERIALIZED_NAME_ACTIVE_BRANCHES) - private List activeBranches; - - public static final String SERIALIZED_NAME_FLAG_REFERENCES = "flagReferences"; - @SerializedName(SERIALIZED_NAME_FLAG_REFERENCES) - private List flagReferences; - - public CodeReferenceRequest() { - } - - public CodeReferenceRequest configId(UUID configId) { - this.configId = configId; - return this; - } - - /** - * The Config's identifier the scanning was performed against. - * @return configId - */ - @javax.annotation.Nonnull - public UUID getConfigId() { - return configId; - } - - public void setConfigId(UUID configId) { - this.configId = configId; - } - - - public CodeReferenceRequest repository(String repository) { - this.repository = repository; - return this; - } - - /** - * The source control repository that contains the scanned code. (Source of the repository selector on the ConfigCat Dashboard) - * @return repository - */ - @javax.annotation.Nonnull - public String getRepository() { - return repository; - } - - public void setRepository(String repository) { - this.repository = repository; - } - - - public CodeReferenceRequest branch(String branch) { - this.branch = branch; - return this; - } - - /** - * The source control branch on where the scan was performed. (Source of the branch selector on the ConfigCat Dashboard) - * @return branch - */ - @javax.annotation.Nonnull - public String getBranch() { - return branch; - } - - public void setBranch(String branch) { - this.branch = branch; - } - - - public CodeReferenceRequest commitUrl(String commitUrl) { - this.commitUrl = commitUrl; - return this; - } - - /** - * The related commit's URL. (Appears on the ConfigCat Dashboard) - * @return commitUrl - */ - @javax.annotation.Nullable - public String getCommitUrl() { - return commitUrl; - } - - public void setCommitUrl(String commitUrl) { - this.commitUrl = commitUrl; - } - - - public CodeReferenceRequest commitHash(String commitHash) { - this.commitHash = commitHash; - return this; - } - - /** - * The related commit's hash. (Appears on the ConfigCat Dashboard) - * @return commitHash - */ - @javax.annotation.Nullable - public String getCommitHash() { - return commitHash; - } - - public void setCommitHash(String commitHash) { - this.commitHash = commitHash; - } - - - public CodeReferenceRequest uploader(String uploader) { - this.uploader = uploader; - return this; - } - - /** - * The scanning tool's name. (Appears on the ConfigCat Dashboard) - * @return uploader - */ - @javax.annotation.Nullable - public String getUploader() { - return uploader; - } - - public void setUploader(String uploader) { - this.uploader = uploader; - } - - - public CodeReferenceRequest activeBranches(List activeBranches) { - this.activeBranches = activeBranches; - return this; - } - - public CodeReferenceRequest addActiveBranchesItem(String activeBranchesItem) { - if (this.activeBranches == null) { - this.activeBranches = new ArrayList<>(); - } - this.activeBranches.add(activeBranchesItem); - return this; - } - - /** - * The currently active branches of the repository. Each previously uploaded report that belongs to a non-reported active branch is being deleted. - * @return activeBranches - */ - @javax.annotation.Nullable - public List getActiveBranches() { - return activeBranches; - } - - public void setActiveBranches(List activeBranches) { - this.activeBranches = activeBranches; - } - - - public CodeReferenceRequest flagReferences(List flagReferences) { - this.flagReferences = flagReferences; - return this; - } - - public CodeReferenceRequest addFlagReferencesItem(FlagReference flagReferencesItem) { - if (this.flagReferences == null) { - this.flagReferences = new ArrayList<>(); - } - this.flagReferences.add(flagReferencesItem); - return this; - } - - /** - * The actual code reference collection. - * @return flagReferences - */ - @javax.annotation.Nullable - public List getFlagReferences() { - return flagReferences; - } - - public void setFlagReferences(List flagReferences) { - this.flagReferences = flagReferences; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the CodeReferenceRequest instance itself - */ - public CodeReferenceRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CodeReferenceRequest codeReferenceRequest = (CodeReferenceRequest) o; - return Objects.equals(this.configId, codeReferenceRequest.configId) && - Objects.equals(this.repository, codeReferenceRequest.repository) && - Objects.equals(this.branch, codeReferenceRequest.branch) && - Objects.equals(this.commitUrl, codeReferenceRequest.commitUrl) && - Objects.equals(this.commitHash, codeReferenceRequest.commitHash) && - Objects.equals(this.uploader, codeReferenceRequest.uploader) && - Objects.equals(this.activeBranches, codeReferenceRequest.activeBranches) && - Objects.equals(this.flagReferences, codeReferenceRequest.flagReferences)&& - Objects.equals(this.additionalProperties, codeReferenceRequest.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(configId, repository, branch, commitUrl, commitHash, uploader, activeBranches, flagReferences, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CodeReferenceRequest {\n"); - sb.append(" configId: ").append(toIndentedString(configId)).append("\n"); - sb.append(" repository: ").append(toIndentedString(repository)).append("\n"); - sb.append(" branch: ").append(toIndentedString(branch)).append("\n"); - sb.append(" commitUrl: ").append(toIndentedString(commitUrl)).append("\n"); - sb.append(" commitHash: ").append(toIndentedString(commitHash)).append("\n"); - sb.append(" uploader: ").append(toIndentedString(uploader)).append("\n"); - sb.append(" activeBranches: ").append(toIndentedString(activeBranches)).append("\n"); - sb.append(" flagReferences: ").append(toIndentedString(flagReferences)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("configId"); - openapiFields.add("repository"); - openapiFields.add("branch"); - openapiFields.add("commitUrl"); - openapiFields.add("commitHash"); - openapiFields.add("uploader"); - openapiFields.add("activeBranches"); - openapiFields.add("flagReferences"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("configId"); - openapiRequiredFields.add("repository"); - openapiRequiredFields.add("branch"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CodeReferenceRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CodeReferenceRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CodeReferenceRequest is not found in the empty JSON string", CodeReferenceRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CodeReferenceRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("configId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `configId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("configId").toString())); - } - if (!jsonObj.get("repository").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `repository` to be a primitive type in the JSON string but got `%s`", jsonObj.get("repository").toString())); - } - if (!jsonObj.get("branch").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `branch` to be a primitive type in the JSON string but got `%s`", jsonObj.get("branch").toString())); - } - if ((jsonObj.get("commitUrl") != null && !jsonObj.get("commitUrl").isJsonNull()) && !jsonObj.get("commitUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `commitUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitUrl").toString())); - } - if ((jsonObj.get("commitHash") != null && !jsonObj.get("commitHash").isJsonNull()) && !jsonObj.get("commitHash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `commitHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitHash").toString())); - } - if ((jsonObj.get("uploader") != null && !jsonObj.get("uploader").isJsonNull()) && !jsonObj.get("uploader").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `uploader` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uploader").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("activeBranches") != null && !jsonObj.get("activeBranches").isJsonNull() && !jsonObj.get("activeBranches").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `activeBranches` to be an array in the JSON string but got `%s`", jsonObj.get("activeBranches").toString())); - } - if (jsonObj.get("flagReferences") != null && !jsonObj.get("flagReferences").isJsonNull()) { - JsonArray jsonArrayflagReferences = jsonObj.getAsJsonArray("flagReferences"); - if (jsonArrayflagReferences != null) { - // ensure the json data is an array - if (!jsonObj.get("flagReferences").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `flagReferences` to be an array in the JSON string but got `%s`", jsonObj.get("flagReferences").toString())); - } - - // validate the optional field `flagReferences` (array) - for (int i = 0; i < jsonArrayflagReferences.size(); i++) { - FlagReference.validateJsonElement(jsonArrayflagReferences.get(i)); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CodeReferenceRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CodeReferenceRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CodeReferenceRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CodeReferenceRequest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public CodeReferenceRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CodeReferenceRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CodeReferenceRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of CodeReferenceRequest - * @throws IOException if the JSON string is invalid with respect to CodeReferenceRequest - */ - public static CodeReferenceRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CodeReferenceRequest.class); - } - - /** - * Convert an instance of CodeReferenceRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ComparisonValueListModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ComparisonValueListModel.java deleted file mode 100644 index e217ed2..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/ComparisonValueListModel.java +++ /dev/null @@ -1,336 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * ComparisonValueListModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class ComparisonValueListModel { - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private String value; - - public static final String SERIALIZED_NAME_HINT = "hint"; - @SerializedName(SERIALIZED_NAME_HINT) - private String hint; - - public ComparisonValueListModel() { - } - - public ComparisonValueListModel value(String value) { - this.value = value; - return this; - } - - /** - * The actual comparison value. - * @return value - */ - @javax.annotation.Nonnull - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - - public ComparisonValueListModel hint(String hint) { - this.hint = hint; - return this; - } - - /** - * An optional hint for the comparison value. - * @return hint - */ - @javax.annotation.Nullable - public String getHint() { - return hint; - } - - public void setHint(String hint) { - this.hint = hint; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the ComparisonValueListModel instance itself - */ - public ComparisonValueListModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ComparisonValueListModel comparisonValueListModel = (ComparisonValueListModel) o; - return Objects.equals(this.value, comparisonValueListModel.value) && - Objects.equals(this.hint, comparisonValueListModel.hint)&& - Objects.equals(this.additionalProperties, comparisonValueListModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(value, hint, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ComparisonValueListModel {\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" hint: ").append(toIndentedString(hint)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("value"); - openapiFields.add("hint"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("value"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ComparisonValueListModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ComparisonValueListModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ComparisonValueListModel is not found in the empty JSON string", ComparisonValueListModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ComparisonValueListModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); - } - if ((jsonObj.get("hint") != null && !jsonObj.get("hint").isJsonNull()) && !jsonObj.get("hint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hint").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ComparisonValueListModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ComparisonValueListModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ComparisonValueListModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ComparisonValueListModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public ComparisonValueListModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ComparisonValueListModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ComparisonValueListModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of ComparisonValueListModel - * @throws IOException if the JSON string is invalid with respect to ComparisonValueListModel - */ - public static ComparisonValueListModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ComparisonValueListModel.class); - } - - /** - * Convert an instance of ComparisonValueListModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ComparisonValueModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ComparisonValueModel.java deleted file mode 100644 index b62a0da..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/ComparisonValueModel.java +++ /dev/null @@ -1,376 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.ComparisonValueListModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * The value that the user object's attribute is compared to. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class ComparisonValueModel { - public static final String SERIALIZED_NAME_STRING_VALUE = "stringValue"; - @SerializedName(SERIALIZED_NAME_STRING_VALUE) - private String stringValue; - - public static final String SERIALIZED_NAME_DOUBLE_VALUE = "doubleValue"; - @SerializedName(SERIALIZED_NAME_DOUBLE_VALUE) - private Double doubleValue; - - public static final String SERIALIZED_NAME_LIST_VALUE = "listValue"; - @SerializedName(SERIALIZED_NAME_LIST_VALUE) - private List listValue; - - public ComparisonValueModel() { - } - - public ComparisonValueModel stringValue(String stringValue) { - this.stringValue = stringValue; - return this; - } - - /** - * The string representation of the comparison value. - * @return stringValue - */ - @javax.annotation.Nullable - public String getStringValue() { - return stringValue; - } - - public void setStringValue(String stringValue) { - this.stringValue = stringValue; - } - - - public ComparisonValueModel doubleValue(Double doubleValue) { - this.doubleValue = doubleValue; - return this; - } - - /** - * The number representation of the comparison value. - * @return doubleValue - */ - @javax.annotation.Nullable - public Double getDoubleValue() { - return doubleValue; - } - - public void setDoubleValue(Double doubleValue) { - this.doubleValue = doubleValue; - } - - - public ComparisonValueModel listValue(List listValue) { - this.listValue = listValue; - return this; - } - - public ComparisonValueModel addListValueItem(ComparisonValueListModel listValueItem) { - if (this.listValue == null) { - this.listValue = new ArrayList<>(); - } - this.listValue.add(listValueItem); - return this; - } - - /** - * The list representation of the comparison value. - * @return listValue - */ - @javax.annotation.Nullable - public List getListValue() { - return listValue; - } - - public void setListValue(List listValue) { - this.listValue = listValue; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the ComparisonValueModel instance itself - */ - public ComparisonValueModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ComparisonValueModel comparisonValueModel = (ComparisonValueModel) o; - return Objects.equals(this.stringValue, comparisonValueModel.stringValue) && - Objects.equals(this.doubleValue, comparisonValueModel.doubleValue) && - Objects.equals(this.listValue, comparisonValueModel.listValue)&& - Objects.equals(this.additionalProperties, comparisonValueModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(stringValue, doubleValue, listValue, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ComparisonValueModel {\n"); - sb.append(" stringValue: ").append(toIndentedString(stringValue)).append("\n"); - sb.append(" doubleValue: ").append(toIndentedString(doubleValue)).append("\n"); - sb.append(" listValue: ").append(toIndentedString(listValue)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("stringValue"); - openapiFields.add("doubleValue"); - openapiFields.add("listValue"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ComparisonValueModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ComparisonValueModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ComparisonValueModel is not found in the empty JSON string", ComparisonValueModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("stringValue") != null && !jsonObj.get("stringValue").isJsonNull()) && !jsonObj.get("stringValue").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `stringValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stringValue").toString())); - } - if (jsonObj.get("listValue") != null && !jsonObj.get("listValue").isJsonNull()) { - JsonArray jsonArraylistValue = jsonObj.getAsJsonArray("listValue"); - if (jsonArraylistValue != null) { - // ensure the json data is an array - if (!jsonObj.get("listValue").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `listValue` to be an array in the JSON string but got `%s`", jsonObj.get("listValue").toString())); - } - - // validate the optional field `listValue` (array) - for (int i = 0; i < jsonArraylistValue.size(); i++) { - ComparisonValueListModel.validateJsonElement(jsonArraylistValue.get(i)); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ComparisonValueModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ComparisonValueModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ComparisonValueModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ComparisonValueModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public ComparisonValueModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ComparisonValueModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ComparisonValueModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of ComparisonValueModel - * @throws IOException if the JSON string is invalid with respect to ComparisonValueModel - */ - public static ComparisonValueModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ComparisonValueModel.class); - } - - /** - * Convert an instance of ComparisonValueModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ConditionModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ConditionModel.java deleted file mode 100644 index 513aa9c..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/ConditionModel.java +++ /dev/null @@ -1,351 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.PrerequisiteFlagConditionModel; -import com.configcat.publicapi.java.client.model.SegmentConditionModel; -import com.configcat.publicapi.java.client.model.UserConditionModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * ConditionModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class ConditionModel { - public static final String SERIALIZED_NAME_USER_CONDITION = "userCondition"; - @SerializedName(SERIALIZED_NAME_USER_CONDITION) - private UserConditionModel userCondition; - - public static final String SERIALIZED_NAME_SEGMENT_CONDITION = "segmentCondition"; - @SerializedName(SERIALIZED_NAME_SEGMENT_CONDITION) - private SegmentConditionModel segmentCondition; - - public static final String SERIALIZED_NAME_PREREQUISITE_FLAG_CONDITION = "prerequisiteFlagCondition"; - @SerializedName(SERIALIZED_NAME_PREREQUISITE_FLAG_CONDITION) - private PrerequisiteFlagConditionModel prerequisiteFlagCondition; - - public ConditionModel() { - } - - public ConditionModel userCondition(UserConditionModel userCondition) { - this.userCondition = userCondition; - return this; - } - - /** - * Get userCondition - * @return userCondition - */ - @javax.annotation.Nullable - public UserConditionModel getUserCondition() { - return userCondition; - } - - public void setUserCondition(UserConditionModel userCondition) { - this.userCondition = userCondition; - } - - - public ConditionModel segmentCondition(SegmentConditionModel segmentCondition) { - this.segmentCondition = segmentCondition; - return this; - } - - /** - * Get segmentCondition - * @return segmentCondition - */ - @javax.annotation.Nullable - public SegmentConditionModel getSegmentCondition() { - return segmentCondition; - } - - public void setSegmentCondition(SegmentConditionModel segmentCondition) { - this.segmentCondition = segmentCondition; - } - - - public ConditionModel prerequisiteFlagCondition(PrerequisiteFlagConditionModel prerequisiteFlagCondition) { - this.prerequisiteFlagCondition = prerequisiteFlagCondition; - return this; - } - - /** - * Get prerequisiteFlagCondition - * @return prerequisiteFlagCondition - */ - @javax.annotation.Nullable - public PrerequisiteFlagConditionModel getPrerequisiteFlagCondition() { - return prerequisiteFlagCondition; - } - - public void setPrerequisiteFlagCondition(PrerequisiteFlagConditionModel prerequisiteFlagCondition) { - this.prerequisiteFlagCondition = prerequisiteFlagCondition; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the ConditionModel instance itself - */ - public ConditionModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ConditionModel conditionModel = (ConditionModel) o; - return Objects.equals(this.userCondition, conditionModel.userCondition) && - Objects.equals(this.segmentCondition, conditionModel.segmentCondition) && - Objects.equals(this.prerequisiteFlagCondition, conditionModel.prerequisiteFlagCondition)&& - Objects.equals(this.additionalProperties, conditionModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(userCondition, segmentCondition, prerequisiteFlagCondition, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ConditionModel {\n"); - sb.append(" userCondition: ").append(toIndentedString(userCondition)).append("\n"); - sb.append(" segmentCondition: ").append(toIndentedString(segmentCondition)).append("\n"); - sb.append(" prerequisiteFlagCondition: ").append(toIndentedString(prerequisiteFlagCondition)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("userCondition"); - openapiFields.add("segmentCondition"); - openapiFields.add("prerequisiteFlagCondition"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ConditionModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ConditionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ConditionModel is not found in the empty JSON string", ConditionModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `userCondition` - if (jsonObj.get("userCondition") != null && !jsonObj.get("userCondition").isJsonNull()) { - UserConditionModel.validateJsonElement(jsonObj.get("userCondition")); - } - // validate the optional field `segmentCondition` - if (jsonObj.get("segmentCondition") != null && !jsonObj.get("segmentCondition").isJsonNull()) { - SegmentConditionModel.validateJsonElement(jsonObj.get("segmentCondition")); - } - // validate the optional field `prerequisiteFlagCondition` - if (jsonObj.get("prerequisiteFlagCondition") != null && !jsonObj.get("prerequisiteFlagCondition").isJsonNull()) { - PrerequisiteFlagConditionModel.validateJsonElement(jsonObj.get("prerequisiteFlagCondition")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ConditionModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ConditionModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ConditionModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ConditionModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public ConditionModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ConditionModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ConditionModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of ConditionModel - * @throws IOException if the JSON string is invalid with respect to ConditionModel - */ - public static ConditionModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ConditionModel.class); - } - - /** - * Convert an instance of ConditionModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ConfigModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ConfigModel.java deleted file mode 100644 index 99038c5..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/ConfigModel.java +++ /dev/null @@ -1,475 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.EvaluationVersion; -import com.configcat.publicapi.java.client.model.ProductModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * Details of the Config. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class ConfigModel { - public static final String SERIALIZED_NAME_PRODUCT = "product"; - @SerializedName(SERIALIZED_NAME_PRODUCT) - private ProductModel product; - - public static final String SERIALIZED_NAME_CONFIG_ID = "configId"; - @SerializedName(SERIALIZED_NAME_CONFIG_ID) - private UUID configId; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_ORDER = "order"; - @SerializedName(SERIALIZED_NAME_ORDER) - private Integer order; - - public static final String SERIALIZED_NAME_MIGRATED_CONFIG_ID = "migratedConfigId"; - @SerializedName(SERIALIZED_NAME_MIGRATED_CONFIG_ID) - private UUID migratedConfigId; - - public static final String SERIALIZED_NAME_EVALUATION_VERSION = "evaluationVersion"; - @SerializedName(SERIALIZED_NAME_EVALUATION_VERSION) - private EvaluationVersion evaluationVersion; - - public ConfigModel() { - } - - public ConfigModel product(ProductModel product) { - this.product = product; - return this; - } - - /** - * Get product - * @return product - */ - @javax.annotation.Nullable - public ProductModel getProduct() { - return product; - } - - public void setProduct(ProductModel product) { - this.product = product; - } - - - public ConfigModel configId(UUID configId) { - this.configId = configId; - return this; - } - - /** - * Identifier of the Config. - * @return configId - */ - @javax.annotation.Nullable - public UUID getConfigId() { - return configId; - } - - public void setConfigId(UUID configId) { - this.configId = configId; - } - - - public ConfigModel name(String name) { - this.name = name; - return this; - } - - /** - * Name of the Config. - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public ConfigModel description(String description) { - this.description = description; - return this; - } - - /** - * Description of the Config. - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - - public ConfigModel order(Integer order) { - this.order = order; - return this; - } - - /** - * The order of the Config represented on the ConfigCat Dashboard. - * @return order - */ - @javax.annotation.Nullable - public Integer getOrder() { - return order; - } - - public void setOrder(Integer order) { - this.order = order; - } - - - public ConfigModel migratedConfigId(UUID migratedConfigId) { - this.migratedConfigId = migratedConfigId; - return this; - } - - /** - * Get migratedConfigId - * @return migratedConfigId - */ - @javax.annotation.Nullable - public UUID getMigratedConfigId() { - return migratedConfigId; - } - - public void setMigratedConfigId(UUID migratedConfigId) { - this.migratedConfigId = migratedConfigId; - } - - - public ConfigModel evaluationVersion(EvaluationVersion evaluationVersion) { - this.evaluationVersion = evaluationVersion; - return this; - } - - /** - * Get evaluationVersion - * @return evaluationVersion - */ - @javax.annotation.Nullable - public EvaluationVersion getEvaluationVersion() { - return evaluationVersion; - } - - public void setEvaluationVersion(EvaluationVersion evaluationVersion) { - this.evaluationVersion = evaluationVersion; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the ConfigModel instance itself - */ - public ConfigModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ConfigModel configModel = (ConfigModel) o; - return Objects.equals(this.product, configModel.product) && - Objects.equals(this.configId, configModel.configId) && - Objects.equals(this.name, configModel.name) && - Objects.equals(this.description, configModel.description) && - Objects.equals(this.order, configModel.order) && - Objects.equals(this.migratedConfigId, configModel.migratedConfigId) && - Objects.equals(this.evaluationVersion, configModel.evaluationVersion)&& - Objects.equals(this.additionalProperties, configModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(product, configId, name, description, order, migratedConfigId, evaluationVersion, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ConfigModel {\n"); - sb.append(" product: ").append(toIndentedString(product)).append("\n"); - sb.append(" configId: ").append(toIndentedString(configId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append(" migratedConfigId: ").append(toIndentedString(migratedConfigId)).append("\n"); - sb.append(" evaluationVersion: ").append(toIndentedString(evaluationVersion)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("product"); - openapiFields.add("configId"); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("order"); - openapiFields.add("migratedConfigId"); - openapiFields.add("evaluationVersion"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ConfigModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ConfigModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ConfigModel is not found in the empty JSON string", ConfigModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `product` - if (jsonObj.get("product") != null && !jsonObj.get("product").isJsonNull()) { - ProductModel.validateJsonElement(jsonObj.get("product")); - } - if ((jsonObj.get("configId") != null && !jsonObj.get("configId").isJsonNull()) && !jsonObj.get("configId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `configId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("configId").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if ((jsonObj.get("migratedConfigId") != null && !jsonObj.get("migratedConfigId").isJsonNull()) && !jsonObj.get("migratedConfigId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `migratedConfigId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("migratedConfigId").toString())); - } - // validate the optional field `evaluationVersion` - if (jsonObj.get("evaluationVersion") != null && !jsonObj.get("evaluationVersion").isJsonNull()) { - EvaluationVersion.validateJsonElement(jsonObj.get("evaluationVersion")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ConfigModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ConfigModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ConfigModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ConfigModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public ConfigModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ConfigModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ConfigModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of ConfigModel - * @throws IOException if the JSON string is invalid with respect to ConfigModel - */ - public static ConfigModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ConfigModel.class); - } - - /** - * Convert an instance of ConfigModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulaModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulaModel.java deleted file mode 100644 index 677e3a1..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulaModel.java +++ /dev/null @@ -1,663 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.IntegrationLinkModel; -import com.configcat.publicapi.java.client.model.SettingDataModel; -import com.configcat.publicapi.java.client.model.SettingTagModel; -import com.configcat.publicapi.java.client.model.TargetingRuleModel; -import com.configcat.publicapi.java.client.model.ValueModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * ConfigSettingFormulaModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class ConfigSettingFormulaModel { - public static final String SERIALIZED_NAME_LAST_VERSION_ID = "lastVersionId"; - @SerializedName(SERIALIZED_NAME_LAST_VERSION_ID) - private UUID lastVersionId; - - public static final String SERIALIZED_NAME_DEFAULT_VALUE = "defaultValue"; - @SerializedName(SERIALIZED_NAME_DEFAULT_VALUE) - private ValueModel defaultValue; - - public static final String SERIALIZED_NAME_TARGETING_RULES = "targetingRules"; - @SerializedName(SERIALIZED_NAME_TARGETING_RULES) - private List targetingRules; - - public static final String SERIALIZED_NAME_SETTING = "setting"; - @SerializedName(SERIALIZED_NAME_SETTING) - private SettingDataModel setting; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private OffsetDateTime updatedAt; - - public static final String SERIALIZED_NAME_PERCENTAGE_EVALUATION_ATTRIBUTE = "percentageEvaluationAttribute"; - @SerializedName(SERIALIZED_NAME_PERCENTAGE_EVALUATION_ATTRIBUTE) - private String percentageEvaluationAttribute; - - public static final String SERIALIZED_NAME_LAST_UPDATER_USER_EMAIL = "lastUpdaterUserEmail"; - @SerializedName(SERIALIZED_NAME_LAST_UPDATER_USER_EMAIL) - private String lastUpdaterUserEmail; - - public static final String SERIALIZED_NAME_LAST_UPDATER_USER_FULL_NAME = "lastUpdaterUserFullName"; - @SerializedName(SERIALIZED_NAME_LAST_UPDATER_USER_FULL_NAME) - private String lastUpdaterUserFullName; - - public static final String SERIALIZED_NAME_INTEGRATION_LINKS = "integrationLinks"; - @SerializedName(SERIALIZED_NAME_INTEGRATION_LINKS) - private List integrationLinks; - - public static final String SERIALIZED_NAME_SETTING_TAGS = "settingTags"; - @SerializedName(SERIALIZED_NAME_SETTING_TAGS) - private List settingTags; - - public static final String SERIALIZED_NAME_SETTING_IDS_WHERE_PREREQUISITE = "settingIdsWherePrerequisite"; - @SerializedName(SERIALIZED_NAME_SETTING_IDS_WHERE_PREREQUISITE) - private List settingIdsWherePrerequisite; - - public ConfigSettingFormulaModel() { - } - - public ConfigSettingFormulaModel lastVersionId(UUID lastVersionId) { - this.lastVersionId = lastVersionId; - return this; - } - - /** - * Get lastVersionId - * @return lastVersionId - */ - @javax.annotation.Nullable - public UUID getLastVersionId() { - return lastVersionId; - } - - public void setLastVersionId(UUID lastVersionId) { - this.lastVersionId = lastVersionId; - } - - - public ConfigSettingFormulaModel defaultValue(ValueModel defaultValue) { - this.defaultValue = defaultValue; - return this; - } - - /** - * Get defaultValue - * @return defaultValue - */ - @javax.annotation.Nullable - public ValueModel getDefaultValue() { - return defaultValue; - } - - public void setDefaultValue(ValueModel defaultValue) { - this.defaultValue = defaultValue; - } - - - public ConfigSettingFormulaModel targetingRules(List targetingRules) { - this.targetingRules = targetingRules; - return this; - } - - public ConfigSettingFormulaModel addTargetingRulesItem(TargetingRuleModel targetingRulesItem) { - if (this.targetingRules == null) { - this.targetingRules = new ArrayList<>(); - } - this.targetingRules.add(targetingRulesItem); - return this; - } - - /** - * The targeting rules of the Feature Flag or Setting. - * @return targetingRules - */ - @javax.annotation.Nullable - public List getTargetingRules() { - return targetingRules; - } - - public void setTargetingRules(List targetingRules) { - this.targetingRules = targetingRules; - } - - - public ConfigSettingFormulaModel setting(SettingDataModel setting) { - this.setting = setting; - return this; - } - - /** - * Get setting - * @return setting - */ - @javax.annotation.Nullable - public SettingDataModel getSetting() { - return setting; - } - - public void setSetting(SettingDataModel setting) { - this.setting = setting; - } - - - public ConfigSettingFormulaModel updatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * The last updated date and time when the Feature Flag or Setting. - * @return updatedAt - */ - @javax.annotation.Nullable - public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - } - - - public ConfigSettingFormulaModel percentageEvaluationAttribute(String percentageEvaluationAttribute) { - this.percentageEvaluationAttribute = percentageEvaluationAttribute; - return this; - } - - /** - * The user attribute used for percentage evaluation. If not set, it defaults to the `Identifier` user object attribute. - * @return percentageEvaluationAttribute - */ - @javax.annotation.Nullable - public String getPercentageEvaluationAttribute() { - return percentageEvaluationAttribute; - } - - public void setPercentageEvaluationAttribute(String percentageEvaluationAttribute) { - this.percentageEvaluationAttribute = percentageEvaluationAttribute; - } - - - public ConfigSettingFormulaModel lastUpdaterUserEmail(String lastUpdaterUserEmail) { - this.lastUpdaterUserEmail = lastUpdaterUserEmail; - return this; - } - - /** - * The email of the user who last updated the Feature Flag or Setting. - * @return lastUpdaterUserEmail - */ - @javax.annotation.Nullable - public String getLastUpdaterUserEmail() { - return lastUpdaterUserEmail; - } - - public void setLastUpdaterUserEmail(String lastUpdaterUserEmail) { - this.lastUpdaterUserEmail = lastUpdaterUserEmail; - } - - - public ConfigSettingFormulaModel lastUpdaterUserFullName(String lastUpdaterUserFullName) { - this.lastUpdaterUserFullName = lastUpdaterUserFullName; - return this; - } - - /** - * The name of the user who last updated the Feature Flag or Setting. - * @return lastUpdaterUserFullName - */ - @javax.annotation.Nullable - public String getLastUpdaterUserFullName() { - return lastUpdaterUserFullName; - } - - public void setLastUpdaterUserFullName(String lastUpdaterUserFullName) { - this.lastUpdaterUserFullName = lastUpdaterUserFullName; - } - - - public ConfigSettingFormulaModel integrationLinks(List integrationLinks) { - this.integrationLinks = integrationLinks; - return this; - } - - public ConfigSettingFormulaModel addIntegrationLinksItem(IntegrationLinkModel integrationLinksItem) { - if (this.integrationLinks == null) { - this.integrationLinks = new ArrayList<>(); - } - this.integrationLinks.add(integrationLinksItem); - return this; - } - - /** - * The integration links attached to the Feature Flag or Setting. - * @return integrationLinks - */ - @javax.annotation.Nullable - public List getIntegrationLinks() { - return integrationLinks; - } - - public void setIntegrationLinks(List integrationLinks) { - this.integrationLinks = integrationLinks; - } - - - public ConfigSettingFormulaModel settingTags(List settingTags) { - this.settingTags = settingTags; - return this; - } - - public ConfigSettingFormulaModel addSettingTagsItem(SettingTagModel settingTagsItem) { - if (this.settingTags == null) { - this.settingTags = new ArrayList<>(); - } - this.settingTags.add(settingTagsItem); - return this; - } - - /** - * The tags attached to the Feature Flag or Setting. - * @return settingTags - */ - @javax.annotation.Nullable - public List getSettingTags() { - return settingTags; - } - - public void setSettingTags(List settingTags) { - this.settingTags = settingTags; - } - - - public ConfigSettingFormulaModel settingIdsWherePrerequisite(List settingIdsWherePrerequisite) { - this.settingIdsWherePrerequisite = settingIdsWherePrerequisite; - return this; - } - - public ConfigSettingFormulaModel addSettingIdsWherePrerequisiteItem(Integer settingIdsWherePrerequisiteItem) { - if (this.settingIdsWherePrerequisite == null) { - this.settingIdsWherePrerequisite = new ArrayList<>(); - } - this.settingIdsWherePrerequisite.add(settingIdsWherePrerequisiteItem); - return this; - } - - /** - * List of Feature Flag and Setting IDs where the actual Feature Flag or Setting is prerequisite. - * @return settingIdsWherePrerequisite - */ - @javax.annotation.Nullable - public List getSettingIdsWherePrerequisite() { - return settingIdsWherePrerequisite; - } - - public void setSettingIdsWherePrerequisite(List settingIdsWherePrerequisite) { - this.settingIdsWherePrerequisite = settingIdsWherePrerequisite; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the ConfigSettingFormulaModel instance itself - */ - public ConfigSettingFormulaModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ConfigSettingFormulaModel configSettingFormulaModel = (ConfigSettingFormulaModel) o; - return Objects.equals(this.lastVersionId, configSettingFormulaModel.lastVersionId) && - Objects.equals(this.defaultValue, configSettingFormulaModel.defaultValue) && - Objects.equals(this.targetingRules, configSettingFormulaModel.targetingRules) && - Objects.equals(this.setting, configSettingFormulaModel.setting) && - Objects.equals(this.updatedAt, configSettingFormulaModel.updatedAt) && - Objects.equals(this.percentageEvaluationAttribute, configSettingFormulaModel.percentageEvaluationAttribute) && - Objects.equals(this.lastUpdaterUserEmail, configSettingFormulaModel.lastUpdaterUserEmail) && - Objects.equals(this.lastUpdaterUserFullName, configSettingFormulaModel.lastUpdaterUserFullName) && - Objects.equals(this.integrationLinks, configSettingFormulaModel.integrationLinks) && - Objects.equals(this.settingTags, configSettingFormulaModel.settingTags) && - Objects.equals(this.settingIdsWherePrerequisite, configSettingFormulaModel.settingIdsWherePrerequisite)&& - Objects.equals(this.additionalProperties, configSettingFormulaModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(lastVersionId, defaultValue, targetingRules, setting, updatedAt, percentageEvaluationAttribute, lastUpdaterUserEmail, lastUpdaterUserFullName, integrationLinks, settingTags, settingIdsWherePrerequisite, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ConfigSettingFormulaModel {\n"); - sb.append(" lastVersionId: ").append(toIndentedString(lastVersionId)).append("\n"); - sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); - sb.append(" targetingRules: ").append(toIndentedString(targetingRules)).append("\n"); - sb.append(" setting: ").append(toIndentedString(setting)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" percentageEvaluationAttribute: ").append(toIndentedString(percentageEvaluationAttribute)).append("\n"); - sb.append(" lastUpdaterUserEmail: ").append(toIndentedString(lastUpdaterUserEmail)).append("\n"); - sb.append(" lastUpdaterUserFullName: ").append(toIndentedString(lastUpdaterUserFullName)).append("\n"); - sb.append(" integrationLinks: ").append(toIndentedString(integrationLinks)).append("\n"); - sb.append(" settingTags: ").append(toIndentedString(settingTags)).append("\n"); - sb.append(" settingIdsWherePrerequisite: ").append(toIndentedString(settingIdsWherePrerequisite)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("lastVersionId"); - openapiFields.add("defaultValue"); - openapiFields.add("targetingRules"); - openapiFields.add("setting"); - openapiFields.add("updatedAt"); - openapiFields.add("percentageEvaluationAttribute"); - openapiFields.add("lastUpdaterUserEmail"); - openapiFields.add("lastUpdaterUserFullName"); - openapiFields.add("integrationLinks"); - openapiFields.add("settingTags"); - openapiFields.add("settingIdsWherePrerequisite"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ConfigSettingFormulaModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ConfigSettingFormulaModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ConfigSettingFormulaModel is not found in the empty JSON string", ConfigSettingFormulaModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("lastVersionId") != null && !jsonObj.get("lastVersionId").isJsonNull()) && !jsonObj.get("lastVersionId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lastVersionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastVersionId").toString())); - } - // validate the optional field `defaultValue` - if (jsonObj.get("defaultValue") != null && !jsonObj.get("defaultValue").isJsonNull()) { - ValueModel.validateJsonElement(jsonObj.get("defaultValue")); - } - if (jsonObj.get("targetingRules") != null && !jsonObj.get("targetingRules").isJsonNull()) { - JsonArray jsonArraytargetingRules = jsonObj.getAsJsonArray("targetingRules"); - if (jsonArraytargetingRules != null) { - // ensure the json data is an array - if (!jsonObj.get("targetingRules").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `targetingRules` to be an array in the JSON string but got `%s`", jsonObj.get("targetingRules").toString())); - } - - // validate the optional field `targetingRules` (array) - for (int i = 0; i < jsonArraytargetingRules.size(); i++) { - TargetingRuleModel.validateJsonElement(jsonArraytargetingRules.get(i)); - }; - } - } - // validate the optional field `setting` - if (jsonObj.get("setting") != null && !jsonObj.get("setting").isJsonNull()) { - SettingDataModel.validateJsonElement(jsonObj.get("setting")); - } - if ((jsonObj.get("percentageEvaluationAttribute") != null && !jsonObj.get("percentageEvaluationAttribute").isJsonNull()) && !jsonObj.get("percentageEvaluationAttribute").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `percentageEvaluationAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("percentageEvaluationAttribute").toString())); - } - if ((jsonObj.get("lastUpdaterUserEmail") != null && !jsonObj.get("lastUpdaterUserEmail").isJsonNull()) && !jsonObj.get("lastUpdaterUserEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterUserEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterUserEmail").toString())); - } - if ((jsonObj.get("lastUpdaterUserFullName") != null && !jsonObj.get("lastUpdaterUserFullName").isJsonNull()) && !jsonObj.get("lastUpdaterUserFullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterUserFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterUserFullName").toString())); - } - if (jsonObj.get("integrationLinks") != null && !jsonObj.get("integrationLinks").isJsonNull()) { - JsonArray jsonArrayintegrationLinks = jsonObj.getAsJsonArray("integrationLinks"); - if (jsonArrayintegrationLinks != null) { - // ensure the json data is an array - if (!jsonObj.get("integrationLinks").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `integrationLinks` to be an array in the JSON string but got `%s`", jsonObj.get("integrationLinks").toString())); - } - - // validate the optional field `integrationLinks` (array) - for (int i = 0; i < jsonArrayintegrationLinks.size(); i++) { - IntegrationLinkModel.validateJsonElement(jsonArrayintegrationLinks.get(i)); - }; - } - } - if (jsonObj.get("settingTags") != null && !jsonObj.get("settingTags").isJsonNull()) { - JsonArray jsonArraysettingTags = jsonObj.getAsJsonArray("settingTags"); - if (jsonArraysettingTags != null) { - // ensure the json data is an array - if (!jsonObj.get("settingTags").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `settingTags` to be an array in the JSON string but got `%s`", jsonObj.get("settingTags").toString())); - } - - // validate the optional field `settingTags` (array) - for (int i = 0; i < jsonArraysettingTags.size(); i++) { - SettingTagModel.validateJsonElement(jsonArraysettingTags.get(i)); - }; - } - } - // ensure the optional json data is an array if present - if (jsonObj.get("settingIdsWherePrerequisite") != null && !jsonObj.get("settingIdsWherePrerequisite").isJsonNull() && !jsonObj.get("settingIdsWherePrerequisite").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `settingIdsWherePrerequisite` to be an array in the JSON string but got `%s`", jsonObj.get("settingIdsWherePrerequisite").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ConfigSettingFormulaModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ConfigSettingFormulaModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ConfigSettingFormulaModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ConfigSettingFormulaModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public ConfigSettingFormulaModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ConfigSettingFormulaModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ConfigSettingFormulaModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of ConfigSettingFormulaModel - * @throws IOException if the JSON string is invalid with respect to ConfigSettingFormulaModel - */ - public static ConfigSettingFormulaModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ConfigSettingFormulaModel.class); - } - - /** - * Convert an instance of ConfigSettingFormulaModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulasModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulasModel.java deleted file mode 100644 index 7518101..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulasModel.java +++ /dev/null @@ -1,440 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.ConfigModel; -import com.configcat.publicapi.java.client.model.ConfigSettingFormulaModel; -import com.configcat.publicapi.java.client.model.EnvironmentModel; -import com.configcat.publicapi.java.client.model.FeatureFlagLimitations; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * ConfigSettingFormulasModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class ConfigSettingFormulasModel { - public static final String SERIALIZED_NAME_CONFIG = "config"; - @SerializedName(SERIALIZED_NAME_CONFIG) - private ConfigModel config; - - public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT) - private EnvironmentModel environment; - - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public static final String SERIALIZED_NAME_SETTING_FORMULAS = "settingFormulas"; - @SerializedName(SERIALIZED_NAME_SETTING_FORMULAS) - private List settingFormulas; - - public static final String SERIALIZED_NAME_FEATURE_FLAG_LIMITATIONS = "featureFlagLimitations"; - @SerializedName(SERIALIZED_NAME_FEATURE_FLAG_LIMITATIONS) - private FeatureFlagLimitations featureFlagLimitations; - - public ConfigSettingFormulasModel() { - } - - public ConfigSettingFormulasModel config(ConfigModel config) { - this.config = config; - return this; - } - - /** - * Get config - * @return config - */ - @javax.annotation.Nullable - public ConfigModel getConfig() { - return config; - } - - public void setConfig(ConfigModel config) { - this.config = config; - } - - - public ConfigSettingFormulasModel environment(EnvironmentModel environment) { - this.environment = environment; - return this; - } - - /** - * Get environment - * @return environment - */ - @javax.annotation.Nullable - public EnvironmentModel getEnvironment() { - return environment; - } - - public void setEnvironment(EnvironmentModel environment) { - this.environment = environment; - } - - - public ConfigSettingFormulasModel readOnly(Boolean readOnly) { - this.readOnly = readOnly; - return this; - } - - /** - * Get readOnly - * @return readOnly - */ - @javax.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - - public ConfigSettingFormulasModel settingFormulas(List settingFormulas) { - this.settingFormulas = settingFormulas; - return this; - } - - public ConfigSettingFormulasModel addSettingFormulasItem(ConfigSettingFormulaModel settingFormulasItem) { - if (this.settingFormulas == null) { - this.settingFormulas = new ArrayList<>(); - } - this.settingFormulas.add(settingFormulasItem); - return this; - } - - /** - * Evaluation descriptors of each updated Feature Flag and Setting. - * @return settingFormulas - */ - @javax.annotation.Nullable - public List getSettingFormulas() { - return settingFormulas; - } - - public void setSettingFormulas(List settingFormulas) { - this.settingFormulas = settingFormulas; - } - - - public ConfigSettingFormulasModel featureFlagLimitations(FeatureFlagLimitations featureFlagLimitations) { - this.featureFlagLimitations = featureFlagLimitations; - return this; - } - - /** - * Get featureFlagLimitations - * @return featureFlagLimitations - */ - @javax.annotation.Nullable - public FeatureFlagLimitations getFeatureFlagLimitations() { - return featureFlagLimitations; - } - - public void setFeatureFlagLimitations(FeatureFlagLimitations featureFlagLimitations) { - this.featureFlagLimitations = featureFlagLimitations; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the ConfigSettingFormulasModel instance itself - */ - public ConfigSettingFormulasModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ConfigSettingFormulasModel configSettingFormulasModel = (ConfigSettingFormulasModel) o; - return Objects.equals(this.config, configSettingFormulasModel.config) && - Objects.equals(this.environment, configSettingFormulasModel.environment) && - Objects.equals(this.readOnly, configSettingFormulasModel.readOnly) && - Objects.equals(this.settingFormulas, configSettingFormulasModel.settingFormulas) && - Objects.equals(this.featureFlagLimitations, configSettingFormulasModel.featureFlagLimitations)&& - Objects.equals(this.additionalProperties, configSettingFormulasModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(config, environment, readOnly, settingFormulas, featureFlagLimitations, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ConfigSettingFormulasModel {\n"); - sb.append(" config: ").append(toIndentedString(config)).append("\n"); - sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); - sb.append(" settingFormulas: ").append(toIndentedString(settingFormulas)).append("\n"); - sb.append(" featureFlagLimitations: ").append(toIndentedString(featureFlagLimitations)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("config"); - openapiFields.add("environment"); - openapiFields.add("readOnly"); - openapiFields.add("settingFormulas"); - openapiFields.add("featureFlagLimitations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ConfigSettingFormulasModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ConfigSettingFormulasModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ConfigSettingFormulasModel is not found in the empty JSON string", ConfigSettingFormulasModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `config` - if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { - ConfigModel.validateJsonElement(jsonObj.get("config")); - } - // validate the optional field `environment` - if (jsonObj.get("environment") != null && !jsonObj.get("environment").isJsonNull()) { - EnvironmentModel.validateJsonElement(jsonObj.get("environment")); - } - if (jsonObj.get("settingFormulas") != null && !jsonObj.get("settingFormulas").isJsonNull()) { - JsonArray jsonArraysettingFormulas = jsonObj.getAsJsonArray("settingFormulas"); - if (jsonArraysettingFormulas != null) { - // ensure the json data is an array - if (!jsonObj.get("settingFormulas").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `settingFormulas` to be an array in the JSON string but got `%s`", jsonObj.get("settingFormulas").toString())); - } - - // validate the optional field `settingFormulas` (array) - for (int i = 0; i < jsonArraysettingFormulas.size(); i++) { - ConfigSettingFormulaModel.validateJsonElement(jsonArraysettingFormulas.get(i)); - }; - } - } - // validate the optional field `featureFlagLimitations` - if (jsonObj.get("featureFlagLimitations") != null && !jsonObj.get("featureFlagLimitations").isJsonNull()) { - FeatureFlagLimitations.validateJsonElement(jsonObj.get("featureFlagLimitations")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ConfigSettingFormulasModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ConfigSettingFormulasModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ConfigSettingFormulasModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ConfigSettingFormulasModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public ConfigSettingFormulasModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ConfigSettingFormulasModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ConfigSettingFormulasModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of ConfigSettingFormulasModel - * @throws IOException if the JSON string is invalid with respect to ConfigSettingFormulasModel - */ - public static ConfigSettingFormulasModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ConfigSettingFormulasModel.class); - } - - /** - * Convert an instance of ConfigSettingFormulasModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingValueModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingValueModel.java deleted file mode 100644 index 0e05b8c..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingValueModel.java +++ /dev/null @@ -1,610 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.IntegrationLinkModel; -import com.configcat.publicapi.java.client.model.RolloutPercentageItemModel; -import com.configcat.publicapi.java.client.model.RolloutRuleModel; -import com.configcat.publicapi.java.client.model.SettingDataModel; -import com.configcat.publicapi.java.client.model.SettingTagModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * ConfigSettingValueModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class ConfigSettingValueModel { - public static final String SERIALIZED_NAME_ROLLOUT_RULES = "rolloutRules"; - @SerializedName(SERIALIZED_NAME_ROLLOUT_RULES) - private List rolloutRules; - - public static final String SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS = "rolloutPercentageItems"; - @SerializedName(SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS) - private List rolloutPercentageItems; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private Object value = null; - - public static final String SERIALIZED_NAME_SETTING = "setting"; - @SerializedName(SERIALIZED_NAME_SETTING) - private SettingDataModel setting; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private OffsetDateTime updatedAt; - - public static final String SERIALIZED_NAME_LAST_UPDATER_USER_EMAIL = "lastUpdaterUserEmail"; - @SerializedName(SERIALIZED_NAME_LAST_UPDATER_USER_EMAIL) - private String lastUpdaterUserEmail; - - public static final String SERIALIZED_NAME_LAST_UPDATER_USER_FULL_NAME = "lastUpdaterUserFullName"; - @SerializedName(SERIALIZED_NAME_LAST_UPDATER_USER_FULL_NAME) - private String lastUpdaterUserFullName; - - public static final String SERIALIZED_NAME_INTEGRATION_LINKS = "integrationLinks"; - @SerializedName(SERIALIZED_NAME_INTEGRATION_LINKS) - private List integrationLinks; - - public static final String SERIALIZED_NAME_SETTING_TAGS = "settingTags"; - @SerializedName(SERIALIZED_NAME_SETTING_TAGS) - private List settingTags; - - public ConfigSettingValueModel() { - } - - public ConfigSettingValueModel rolloutRules(List rolloutRules) { - this.rolloutRules = rolloutRules; - return this; - } - - public ConfigSettingValueModel addRolloutRulesItem(RolloutRuleModel rolloutRulesItem) { - if (this.rolloutRules == null) { - this.rolloutRules = new ArrayList<>(); - } - this.rolloutRules.add(rolloutRulesItem); - return this; - } - - /** - * The targeting rule collection. - * @return rolloutRules - */ - @javax.annotation.Nullable - public List getRolloutRules() { - return rolloutRules; - } - - public void setRolloutRules(List rolloutRules) { - this.rolloutRules = rolloutRules; - } - - - public ConfigSettingValueModel rolloutPercentageItems(List rolloutPercentageItems) { - this.rolloutPercentageItems = rolloutPercentageItems; - return this; - } - - public ConfigSettingValueModel addRolloutPercentageItemsItem(RolloutPercentageItemModel rolloutPercentageItemsItem) { - if (this.rolloutPercentageItems == null) { - this.rolloutPercentageItems = new ArrayList<>(); - } - this.rolloutPercentageItems.add(rolloutPercentageItemsItem); - return this; - } - - /** - * The percentage rule collection. - * @return rolloutPercentageItems - */ - @javax.annotation.Nullable - public List getRolloutPercentageItems() { - return rolloutPercentageItems; - } - - public void setRolloutPercentageItems(List rolloutPercentageItems) { - this.rolloutPercentageItems = rolloutPercentageItems; - } - - - public ConfigSettingValueModel value(Object value) { - this.value = value; - return this; - } - - /** - * The value to serve. It must respect the setting type. - * @return value - */ - @javax.annotation.Nullable - public Object getValue() { - return value; - } - - public void setValue(Object value) { - this.value = value; - } - - - public ConfigSettingValueModel setting(SettingDataModel setting) { - this.setting = setting; - return this; - } - - /** - * Get setting - * @return setting - */ - @javax.annotation.Nullable - public SettingDataModel getSetting() { - return setting; - } - - public void setSetting(SettingDataModel setting) { - this.setting = setting; - } - - - public ConfigSettingValueModel updatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * The last updated date and time when the Feature Flag or Setting. - * @return updatedAt - */ - @javax.annotation.Nullable - public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - } - - - public ConfigSettingValueModel lastUpdaterUserEmail(String lastUpdaterUserEmail) { - this.lastUpdaterUserEmail = lastUpdaterUserEmail; - return this; - } - - /** - * The email of the user who last updated the Feature Flag or Setting. - * @return lastUpdaterUserEmail - */ - @javax.annotation.Nullable - public String getLastUpdaterUserEmail() { - return lastUpdaterUserEmail; - } - - public void setLastUpdaterUserEmail(String lastUpdaterUserEmail) { - this.lastUpdaterUserEmail = lastUpdaterUserEmail; - } - - - public ConfigSettingValueModel lastUpdaterUserFullName(String lastUpdaterUserFullName) { - this.lastUpdaterUserFullName = lastUpdaterUserFullName; - return this; - } - - /** - * The name of the user who last updated the Feature Flag or Setting. - * @return lastUpdaterUserFullName - */ - @javax.annotation.Nullable - public String getLastUpdaterUserFullName() { - return lastUpdaterUserFullName; - } - - public void setLastUpdaterUserFullName(String lastUpdaterUserFullName) { - this.lastUpdaterUserFullName = lastUpdaterUserFullName; - } - - - public ConfigSettingValueModel integrationLinks(List integrationLinks) { - this.integrationLinks = integrationLinks; - return this; - } - - public ConfigSettingValueModel addIntegrationLinksItem(IntegrationLinkModel integrationLinksItem) { - if (this.integrationLinks == null) { - this.integrationLinks = new ArrayList<>(); - } - this.integrationLinks.add(integrationLinksItem); - return this; - } - - /** - * The integration links attached to the Feature Flag or Setting. - * @return integrationLinks - */ - @javax.annotation.Nullable - public List getIntegrationLinks() { - return integrationLinks; - } - - public void setIntegrationLinks(List integrationLinks) { - this.integrationLinks = integrationLinks; - } - - - public ConfigSettingValueModel settingTags(List settingTags) { - this.settingTags = settingTags; - return this; - } - - public ConfigSettingValueModel addSettingTagsItem(SettingTagModel settingTagsItem) { - if (this.settingTags == null) { - this.settingTags = new ArrayList<>(); - } - this.settingTags.add(settingTagsItem); - return this; - } - - /** - * The tags attached to the Feature Flag or Setting. - * @return settingTags - */ - @javax.annotation.Nullable - public List getSettingTags() { - return settingTags; - } - - public void setSettingTags(List settingTags) { - this.settingTags = settingTags; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the ConfigSettingValueModel instance itself - */ - public ConfigSettingValueModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ConfigSettingValueModel configSettingValueModel = (ConfigSettingValueModel) o; - return Objects.equals(this.rolloutRules, configSettingValueModel.rolloutRules) && - Objects.equals(this.rolloutPercentageItems, configSettingValueModel.rolloutPercentageItems) && - Objects.equals(this.value, configSettingValueModel.value) && - Objects.equals(this.setting, configSettingValueModel.setting) && - Objects.equals(this.updatedAt, configSettingValueModel.updatedAt) && - Objects.equals(this.lastUpdaterUserEmail, configSettingValueModel.lastUpdaterUserEmail) && - Objects.equals(this.lastUpdaterUserFullName, configSettingValueModel.lastUpdaterUserFullName) && - Objects.equals(this.integrationLinks, configSettingValueModel.integrationLinks) && - Objects.equals(this.settingTags, configSettingValueModel.settingTags)&& - Objects.equals(this.additionalProperties, configSettingValueModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(rolloutRules, rolloutPercentageItems, value, setting, updatedAt, lastUpdaterUserEmail, lastUpdaterUserFullName, integrationLinks, settingTags, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ConfigSettingValueModel {\n"); - sb.append(" rolloutRules: ").append(toIndentedString(rolloutRules)).append("\n"); - sb.append(" rolloutPercentageItems: ").append(toIndentedString(rolloutPercentageItems)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" setting: ").append(toIndentedString(setting)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" lastUpdaterUserEmail: ").append(toIndentedString(lastUpdaterUserEmail)).append("\n"); - sb.append(" lastUpdaterUserFullName: ").append(toIndentedString(lastUpdaterUserFullName)).append("\n"); - sb.append(" integrationLinks: ").append(toIndentedString(integrationLinks)).append("\n"); - sb.append(" settingTags: ").append(toIndentedString(settingTags)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("rolloutRules"); - openapiFields.add("rolloutPercentageItems"); - openapiFields.add("value"); - openapiFields.add("setting"); - openapiFields.add("updatedAt"); - openapiFields.add("lastUpdaterUserEmail"); - openapiFields.add("lastUpdaterUserFullName"); - openapiFields.add("integrationLinks"); - openapiFields.add("settingTags"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ConfigSettingValueModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ConfigSettingValueModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ConfigSettingValueModel is not found in the empty JSON string", ConfigSettingValueModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("rolloutRules") != null && !jsonObj.get("rolloutRules").isJsonNull()) { - JsonArray jsonArrayrolloutRules = jsonObj.getAsJsonArray("rolloutRules"); - if (jsonArrayrolloutRules != null) { - // ensure the json data is an array - if (!jsonObj.get("rolloutRules").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `rolloutRules` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutRules").toString())); - } - - // validate the optional field `rolloutRules` (array) - for (int i = 0; i < jsonArrayrolloutRules.size(); i++) { - RolloutRuleModel.validateJsonElement(jsonArrayrolloutRules.get(i)); - }; - } - } - if (jsonObj.get("rolloutPercentageItems") != null && !jsonObj.get("rolloutPercentageItems").isJsonNull()) { - JsonArray jsonArrayrolloutPercentageItems = jsonObj.getAsJsonArray("rolloutPercentageItems"); - if (jsonArrayrolloutPercentageItems != null) { - // ensure the json data is an array - if (!jsonObj.get("rolloutPercentageItems").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `rolloutPercentageItems` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutPercentageItems").toString())); - } - - // validate the optional field `rolloutPercentageItems` (array) - for (int i = 0; i < jsonArrayrolloutPercentageItems.size(); i++) { - RolloutPercentageItemModel.validateJsonElement(jsonArrayrolloutPercentageItems.get(i)); - }; - } - } - // validate the optional field `setting` - if (jsonObj.get("setting") != null && !jsonObj.get("setting").isJsonNull()) { - SettingDataModel.validateJsonElement(jsonObj.get("setting")); - } - if ((jsonObj.get("lastUpdaterUserEmail") != null && !jsonObj.get("lastUpdaterUserEmail").isJsonNull()) && !jsonObj.get("lastUpdaterUserEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterUserEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterUserEmail").toString())); - } - if ((jsonObj.get("lastUpdaterUserFullName") != null && !jsonObj.get("lastUpdaterUserFullName").isJsonNull()) && !jsonObj.get("lastUpdaterUserFullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterUserFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterUserFullName").toString())); - } - if (jsonObj.get("integrationLinks") != null && !jsonObj.get("integrationLinks").isJsonNull()) { - JsonArray jsonArrayintegrationLinks = jsonObj.getAsJsonArray("integrationLinks"); - if (jsonArrayintegrationLinks != null) { - // ensure the json data is an array - if (!jsonObj.get("integrationLinks").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `integrationLinks` to be an array in the JSON string but got `%s`", jsonObj.get("integrationLinks").toString())); - } - - // validate the optional field `integrationLinks` (array) - for (int i = 0; i < jsonArrayintegrationLinks.size(); i++) { - IntegrationLinkModel.validateJsonElement(jsonArrayintegrationLinks.get(i)); - }; - } - } - if (jsonObj.get("settingTags") != null && !jsonObj.get("settingTags").isJsonNull()) { - JsonArray jsonArraysettingTags = jsonObj.getAsJsonArray("settingTags"); - if (jsonArraysettingTags != null) { - // ensure the json data is an array - if (!jsonObj.get("settingTags").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `settingTags` to be an array in the JSON string but got `%s`", jsonObj.get("settingTags").toString())); - } - - // validate the optional field `settingTags` (array) - for (int i = 0; i < jsonArraysettingTags.size(); i++) { - SettingTagModel.validateJsonElement(jsonArraysettingTags.get(i)); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ConfigSettingValueModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ConfigSettingValueModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ConfigSettingValueModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ConfigSettingValueModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public ConfigSettingValueModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ConfigSettingValueModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ConfigSettingValueModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of ConfigSettingValueModel - * @throws IOException if the JSON string is invalid with respect to ConfigSettingValueModel - */ - public static ConfigSettingValueModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ConfigSettingValueModel.class); - } - - /** - * Convert an instance of ConfigSettingValueModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingValuesModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingValuesModel.java deleted file mode 100644 index 62bee71..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingValuesModel.java +++ /dev/null @@ -1,440 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.ConfigModel; -import com.configcat.publicapi.java.client.model.ConfigSettingValueModel; -import com.configcat.publicapi.java.client.model.EnvironmentModel; -import com.configcat.publicapi.java.client.model.FeatureFlagLimitations; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * ConfigSettingValuesModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class ConfigSettingValuesModel { - public static final String SERIALIZED_NAME_CONFIG = "config"; - @SerializedName(SERIALIZED_NAME_CONFIG) - private ConfigModel config; - - public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT) - private EnvironmentModel environment; - - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public static final String SERIALIZED_NAME_SETTING_VALUES = "settingValues"; - @SerializedName(SERIALIZED_NAME_SETTING_VALUES) - private List settingValues; - - public static final String SERIALIZED_NAME_FEATURE_FLAG_LIMITATIONS = "featureFlagLimitations"; - @SerializedName(SERIALIZED_NAME_FEATURE_FLAG_LIMITATIONS) - private FeatureFlagLimitations featureFlagLimitations; - - public ConfigSettingValuesModel() { - } - - public ConfigSettingValuesModel config(ConfigModel config) { - this.config = config; - return this; - } - - /** - * Get config - * @return config - */ - @javax.annotation.Nullable - public ConfigModel getConfig() { - return config; - } - - public void setConfig(ConfigModel config) { - this.config = config; - } - - - public ConfigSettingValuesModel environment(EnvironmentModel environment) { - this.environment = environment; - return this; - } - - /** - * Get environment - * @return environment - */ - @javax.annotation.Nullable - public EnvironmentModel getEnvironment() { - return environment; - } - - public void setEnvironment(EnvironmentModel environment) { - this.environment = environment; - } - - - public ConfigSettingValuesModel readOnly(Boolean readOnly) { - this.readOnly = readOnly; - return this; - } - - /** - * Get readOnly - * @return readOnly - */ - @javax.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - - public ConfigSettingValuesModel settingValues(List settingValues) { - this.settingValues = settingValues; - return this; - } - - public ConfigSettingValuesModel addSettingValuesItem(ConfigSettingValueModel settingValuesItem) { - if (this.settingValues == null) { - this.settingValues = new ArrayList<>(); - } - this.settingValues.add(settingValuesItem); - return this; - } - - /** - * Get settingValues - * @return settingValues - */ - @javax.annotation.Nullable - public List getSettingValues() { - return settingValues; - } - - public void setSettingValues(List settingValues) { - this.settingValues = settingValues; - } - - - public ConfigSettingValuesModel featureFlagLimitations(FeatureFlagLimitations featureFlagLimitations) { - this.featureFlagLimitations = featureFlagLimitations; - return this; - } - - /** - * Get featureFlagLimitations - * @return featureFlagLimitations - */ - @javax.annotation.Nullable - public FeatureFlagLimitations getFeatureFlagLimitations() { - return featureFlagLimitations; - } - - public void setFeatureFlagLimitations(FeatureFlagLimitations featureFlagLimitations) { - this.featureFlagLimitations = featureFlagLimitations; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the ConfigSettingValuesModel instance itself - */ - public ConfigSettingValuesModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ConfigSettingValuesModel configSettingValuesModel = (ConfigSettingValuesModel) o; - return Objects.equals(this.config, configSettingValuesModel.config) && - Objects.equals(this.environment, configSettingValuesModel.environment) && - Objects.equals(this.readOnly, configSettingValuesModel.readOnly) && - Objects.equals(this.settingValues, configSettingValuesModel.settingValues) && - Objects.equals(this.featureFlagLimitations, configSettingValuesModel.featureFlagLimitations)&& - Objects.equals(this.additionalProperties, configSettingValuesModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(config, environment, readOnly, settingValues, featureFlagLimitations, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ConfigSettingValuesModel {\n"); - sb.append(" config: ").append(toIndentedString(config)).append("\n"); - sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); - sb.append(" settingValues: ").append(toIndentedString(settingValues)).append("\n"); - sb.append(" featureFlagLimitations: ").append(toIndentedString(featureFlagLimitations)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("config"); - openapiFields.add("environment"); - openapiFields.add("readOnly"); - openapiFields.add("settingValues"); - openapiFields.add("featureFlagLimitations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ConfigSettingValuesModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ConfigSettingValuesModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ConfigSettingValuesModel is not found in the empty JSON string", ConfigSettingValuesModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `config` - if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { - ConfigModel.validateJsonElement(jsonObj.get("config")); - } - // validate the optional field `environment` - if (jsonObj.get("environment") != null && !jsonObj.get("environment").isJsonNull()) { - EnvironmentModel.validateJsonElement(jsonObj.get("environment")); - } - if (jsonObj.get("settingValues") != null && !jsonObj.get("settingValues").isJsonNull()) { - JsonArray jsonArraysettingValues = jsonObj.getAsJsonArray("settingValues"); - if (jsonArraysettingValues != null) { - // ensure the json data is an array - if (!jsonObj.get("settingValues").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `settingValues` to be an array in the JSON string but got `%s`", jsonObj.get("settingValues").toString())); - } - - // validate the optional field `settingValues` (array) - for (int i = 0; i < jsonArraysettingValues.size(); i++) { - ConfigSettingValueModel.validateJsonElement(jsonArraysettingValues.get(i)); - }; - } - } - // validate the optional field `featureFlagLimitations` - if (jsonObj.get("featureFlagLimitations") != null && !jsonObj.get("featureFlagLimitations").isJsonNull()) { - FeatureFlagLimitations.validateJsonElement(jsonObj.get("featureFlagLimitations")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ConfigSettingValuesModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ConfigSettingValuesModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ConfigSettingValuesModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ConfigSettingValuesModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public ConfigSettingValuesModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ConfigSettingValuesModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ConfigSettingValuesModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of ConfigSettingValuesModel - * @throws IOException if the JSON string is invalid with respect to ConfigSettingValuesModel - */ - public static ConfigSettingValuesModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ConfigSettingValuesModel.class); - } - - /** - * Convert an instance of ConfigSettingValuesModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ConnectRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/ConnectRequest.java deleted file mode 100644 index cfc9b53..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/ConnectRequest.java +++ /dev/null @@ -1,325 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * ConnectRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class ConnectRequest { - public static final String SERIALIZED_NAME_CLIENT_KEY = "clientKey"; - @SerializedName(SERIALIZED_NAME_CLIENT_KEY) - private String clientKey; - - public static final String SERIALIZED_NAME_JIRA_JWT_TOKEN = "jiraJwtToken"; - @SerializedName(SERIALIZED_NAME_JIRA_JWT_TOKEN) - private String jiraJwtToken; - - public ConnectRequest() { - } - - public ConnectRequest clientKey(String clientKey) { - this.clientKey = clientKey; - return this; - } - - /** - * Get clientKey - * @return clientKey - */ - @javax.annotation.Nonnull - public String getClientKey() { - return clientKey; - } - - public void setClientKey(String clientKey) { - this.clientKey = clientKey; - } - - - public ConnectRequest jiraJwtToken(String jiraJwtToken) { - this.jiraJwtToken = jiraJwtToken; - return this; - } - - /** - * Get jiraJwtToken - * @return jiraJwtToken - */ - @javax.annotation.Nonnull - public String getJiraJwtToken() { - return jiraJwtToken; - } - - public void setJiraJwtToken(String jiraJwtToken) { - this.jiraJwtToken = jiraJwtToken; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the ConnectRequest instance itself - */ - public ConnectRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ConnectRequest connectRequest = (ConnectRequest) o; - return Objects.equals(this.clientKey, connectRequest.clientKey) && - Objects.equals(this.jiraJwtToken, connectRequest.jiraJwtToken)&& - Objects.equals(this.additionalProperties, connectRequest.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(clientKey, jiraJwtToken, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ConnectRequest {\n"); - sb.append(" clientKey: ").append(toIndentedString(clientKey)).append("\n"); - sb.append(" jiraJwtToken: ").append(toIndentedString(jiraJwtToken)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("clientKey"); - openapiFields.add("jiraJwtToken"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("clientKey"); - openapiRequiredFields.add("jiraJwtToken"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ConnectRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ConnectRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectRequest is not found in the empty JSON string", ConnectRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ConnectRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("clientKey").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `clientKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientKey").toString())); - } - if (!jsonObj.get("jiraJwtToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `jiraJwtToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jiraJwtToken").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ConnectRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ConnectRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ConnectRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ConnectRequest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public ConnectRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ConnectRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ConnectRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of ConnectRequest - * @throws IOException if the JSON string is invalid with respect to ConnectRequest - */ - public static ConnectRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ConnectRequest.class); - } - - /** - * Convert an instance of ConnectRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/CreateConfigRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/CreateConfigRequest.java deleted file mode 100644 index 33ca65c..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/CreateConfigRequest.java +++ /dev/null @@ -1,393 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.EvaluationVersion; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * CreateConfigRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class CreateConfigRequest { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_ORDER = "order"; - @SerializedName(SERIALIZED_NAME_ORDER) - private Integer order; - - public static final String SERIALIZED_NAME_EVALUATION_VERSION = "evaluationVersion"; - @SerializedName(SERIALIZED_NAME_EVALUATION_VERSION) - private EvaluationVersion evaluationVersion; - - public CreateConfigRequest() { - } - - public CreateConfigRequest name(String name) { - this.name = name; - return this; - } - - /** - * The name of the Config. - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public CreateConfigRequest description(String description) { - this.description = description; - return this; - } - - /** - * The description of the Config. - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - - public CreateConfigRequest order(Integer order) { - this.order = order; - return this; - } - - /** - * The order of the Config represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. - * @return order - */ - @javax.annotation.Nullable - public Integer getOrder() { - return order; - } - - public void setOrder(Integer order) { - this.order = order; - } - - - public CreateConfigRequest evaluationVersion(EvaluationVersion evaluationVersion) { - this.evaluationVersion = evaluationVersion; - return this; - } - - /** - * Get evaluationVersion - * @return evaluationVersion - */ - @javax.annotation.Nullable - public EvaluationVersion getEvaluationVersion() { - return evaluationVersion; - } - - public void setEvaluationVersion(EvaluationVersion evaluationVersion) { - this.evaluationVersion = evaluationVersion; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the CreateConfigRequest instance itself - */ - public CreateConfigRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateConfigRequest createConfigRequest = (CreateConfigRequest) o; - return Objects.equals(this.name, createConfigRequest.name) && - Objects.equals(this.description, createConfigRequest.description) && - Objects.equals(this.order, createConfigRequest.order) && - Objects.equals(this.evaluationVersion, createConfigRequest.evaluationVersion)&& - Objects.equals(this.additionalProperties, createConfigRequest.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(name, description, order, evaluationVersion, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateConfigRequest {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append(" evaluationVersion: ").append(toIndentedString(evaluationVersion)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("order"); - openapiFields.add("evaluationVersion"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateConfigRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateConfigRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateConfigRequest is not found in the empty JSON string", CreateConfigRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateConfigRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - // validate the optional field `evaluationVersion` - if (jsonObj.get("evaluationVersion") != null && !jsonObj.get("evaluationVersion").isJsonNull()) { - EvaluationVersion.validateJsonElement(jsonObj.get("evaluationVersion")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateConfigRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateConfigRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateConfigRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateConfigRequest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public CreateConfigRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CreateConfigRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CreateConfigRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateConfigRequest - * @throws IOException if the JSON string is invalid with respect to CreateConfigRequest - */ - public static CreateConfigRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateConfigRequest.class); - } - - /** - * Convert an instance of CreateConfigRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/CreateEnvironmentModel.java b/src/main/java/com/configcat/publicapi/java/client/model/CreateEnvironmentModel.java deleted file mode 100644 index f2732bf..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/CreateEnvironmentModel.java +++ /dev/null @@ -1,391 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * CreateEnvironmentModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class CreateEnvironmentModel { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_COLOR = "color"; - @SerializedName(SERIALIZED_NAME_COLOR) - private String color; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_ORDER = "order"; - @SerializedName(SERIALIZED_NAME_ORDER) - private Integer order; - - public CreateEnvironmentModel() { - } - - public CreateEnvironmentModel name(String name) { - this.name = name; - return this; - } - - /** - * The name of the Environment. - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public CreateEnvironmentModel color(String color) { - this.color = color; - return this; - } - - /** - * The color of the Environment. RGB or HTML color codes are allowed. - * @return color - */ - @javax.annotation.Nullable - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - - public CreateEnvironmentModel description(String description) { - this.description = description; - return this; - } - - /** - * The description of the Environment. - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - - public CreateEnvironmentModel order(Integer order) { - this.order = order; - return this; - } - - /** - * The order of the Environment represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. - * @return order - */ - @javax.annotation.Nullable - public Integer getOrder() { - return order; - } - - public void setOrder(Integer order) { - this.order = order; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the CreateEnvironmentModel instance itself - */ - public CreateEnvironmentModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateEnvironmentModel createEnvironmentModel = (CreateEnvironmentModel) o; - return Objects.equals(this.name, createEnvironmentModel.name) && - Objects.equals(this.color, createEnvironmentModel.color) && - Objects.equals(this.description, createEnvironmentModel.description) && - Objects.equals(this.order, createEnvironmentModel.order)&& - Objects.equals(this.additionalProperties, createEnvironmentModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(name, color, description, order, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateEnvironmentModel {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("color"); - openapiFields.add("description"); - openapiFields.add("order"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateEnvironmentModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateEnvironmentModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateEnvironmentModel is not found in the empty JSON string", CreateEnvironmentModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateEnvironmentModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("color") != null && !jsonObj.get("color").isJsonNull()) && !jsonObj.get("color").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateEnvironmentModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateEnvironmentModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateEnvironmentModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateEnvironmentModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public CreateEnvironmentModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CreateEnvironmentModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CreateEnvironmentModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateEnvironmentModel - * @throws IOException if the JSON string is invalid with respect to CreateEnvironmentModel - */ - public static CreateEnvironmentModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateEnvironmentModel.class); - } - - /** - * Convert an instance of CreateEnvironmentModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/CreateIntegrationModel.java b/src/main/java/com/configcat/publicapi/java/client/model/CreateIntegrationModel.java deleted file mode 100644 index 450a90e..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/CreateIntegrationModel.java +++ /dev/null @@ -1,447 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.IntegrationType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * CreateIntegrationModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class CreateIntegrationModel { - public static final String SERIALIZED_NAME_INTEGRATION_TYPE = "integrationType"; - @SerializedName(SERIALIZED_NAME_INTEGRATION_TYPE) - private IntegrationType integrationType; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_PARAMETERS = "parameters"; - @SerializedName(SERIALIZED_NAME_PARAMETERS) - private Map parameters = new HashMap<>(); - - public static final String SERIALIZED_NAME_ENVIRONMENT_IDS = "environmentIds"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT_IDS) - private List environmentIds = new ArrayList<>(); - - public static final String SERIALIZED_NAME_CONFIG_IDS = "configIds"; - @SerializedName(SERIALIZED_NAME_CONFIG_IDS) - private List configIds = new ArrayList<>(); - - public CreateIntegrationModel() { - } - - public CreateIntegrationModel integrationType(IntegrationType integrationType) { - this.integrationType = integrationType; - return this; - } - - /** - * Get integrationType - * @return integrationType - */ - @javax.annotation.Nonnull - public IntegrationType getIntegrationType() { - return integrationType; - } - - public void setIntegrationType(IntegrationType integrationType) { - this.integrationType = integrationType; - } - - - public CreateIntegrationModel name(String name) { - this.name = name; - return this; - } - - /** - * Name of the Integration. - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public CreateIntegrationModel parameters(Map parameters) { - this.parameters = parameters; - return this; - } - - public CreateIntegrationModel putParametersItem(String key, String parametersItem) { - if (this.parameters == null) { - this.parameters = new HashMap<>(); - } - this.parameters.put(key, parametersItem); - return this; - } - - /** - * Parameters of the Integration. - * @return parameters - */ - @javax.annotation.Nonnull - public Map getParameters() { - return parameters; - } - - public void setParameters(Map parameters) { - this.parameters = parameters; - } - - - public CreateIntegrationModel environmentIds(List environmentIds) { - this.environmentIds = environmentIds; - return this; - } - - public CreateIntegrationModel addEnvironmentIdsItem(UUID environmentIdsItem) { - if (this.environmentIds == null) { - this.environmentIds = new ArrayList<>(); - } - this.environmentIds.add(environmentIdsItem); - return this; - } - - /** - * List of Environment IDs that are connected with this Integration. If the list is empty, all of the Environments are connected. - * @return environmentIds - */ - @javax.annotation.Nonnull - public List getEnvironmentIds() { - return environmentIds; - } - - public void setEnvironmentIds(List environmentIds) { - this.environmentIds = environmentIds; - } - - - public CreateIntegrationModel configIds(List configIds) { - this.configIds = configIds; - return this; - } - - public CreateIntegrationModel addConfigIdsItem(UUID configIdsItem) { - if (this.configIds == null) { - this.configIds = new ArrayList<>(); - } - this.configIds.add(configIdsItem); - return this; - } - - /** - * List of Config IDs that are connected with this Integration. If the list is empty, all of the Configs are connected. - * @return configIds - */ - @javax.annotation.Nonnull - public List getConfigIds() { - return configIds; - } - - public void setConfigIds(List configIds) { - this.configIds = configIds; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the CreateIntegrationModel instance itself - */ - public CreateIntegrationModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateIntegrationModel createIntegrationModel = (CreateIntegrationModel) o; - return Objects.equals(this.integrationType, createIntegrationModel.integrationType) && - Objects.equals(this.name, createIntegrationModel.name) && - Objects.equals(this.parameters, createIntegrationModel.parameters) && - Objects.equals(this.environmentIds, createIntegrationModel.environmentIds) && - Objects.equals(this.configIds, createIntegrationModel.configIds)&& - Objects.equals(this.additionalProperties, createIntegrationModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(integrationType, name, parameters, environmentIds, configIds, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateIntegrationModel {\n"); - sb.append(" integrationType: ").append(toIndentedString(integrationType)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); - sb.append(" environmentIds: ").append(toIndentedString(environmentIds)).append("\n"); - sb.append(" configIds: ").append(toIndentedString(configIds)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("integrationType"); - openapiFields.add("name"); - openapiFields.add("parameters"); - openapiFields.add("environmentIds"); - openapiFields.add("configIds"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("integrationType"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("parameters"); - openapiRequiredFields.add("environmentIds"); - openapiRequiredFields.add("configIds"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateIntegrationModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateIntegrationModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateIntegrationModel is not found in the empty JSON string", CreateIntegrationModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateIntegrationModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `integrationType` - IntegrationType.validateJsonElement(jsonObj.get("integrationType")); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - // ensure the required json array is present - if (jsonObj.get("environmentIds") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("environmentIds").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `environmentIds` to be an array in the JSON string but got `%s`", jsonObj.get("environmentIds").toString())); - } - // ensure the required json array is present - if (jsonObj.get("configIds") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("configIds").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `configIds` to be an array in the JSON string but got `%s`", jsonObj.get("configIds").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateIntegrationModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateIntegrationModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateIntegrationModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateIntegrationModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public CreateIntegrationModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CreateIntegrationModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CreateIntegrationModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateIntegrationModel - * @throws IOException if the JSON string is invalid with respect to CreateIntegrationModel - */ - public static CreateIntegrationModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateIntegrationModel.class); - } - - /** - * Convert an instance of CreateIntegrationModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/CreateOrUpdateEnvironmentAccessModel.java b/src/main/java/com/configcat/publicapi/java/client/model/CreateOrUpdateEnvironmentAccessModel.java deleted file mode 100644 index 0a274ad..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/CreateOrUpdateEnvironmentAccessModel.java +++ /dev/null @@ -1,319 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.EnvironmentAccessType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.UUID; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * CreateOrUpdateEnvironmentAccessModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class CreateOrUpdateEnvironmentAccessModel { - public static final String SERIALIZED_NAME_ENVIRONMENT_ID = "environmentId"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) - private UUID environmentId; - - public static final String SERIALIZED_NAME_ENVIRONMENT_ACCESS_TYPE = "environmentAccessType"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ACCESS_TYPE) - private EnvironmentAccessType environmentAccessType; - - public CreateOrUpdateEnvironmentAccessModel() { - } - - public CreateOrUpdateEnvironmentAccessModel environmentId(UUID environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Identifier of the Environment. - * @return environmentId - */ - @javax.annotation.Nullable - public UUID getEnvironmentId() { - return environmentId; - } - - public void setEnvironmentId(UUID environmentId) { - this.environmentId = environmentId; - } - - - public CreateOrUpdateEnvironmentAccessModel environmentAccessType(EnvironmentAccessType environmentAccessType) { - this.environmentAccessType = environmentAccessType; - return this; - } - - /** - * Get environmentAccessType - * @return environmentAccessType - */ - @javax.annotation.Nullable - public EnvironmentAccessType getEnvironmentAccessType() { - return environmentAccessType; - } - - public void setEnvironmentAccessType(EnvironmentAccessType environmentAccessType) { - this.environmentAccessType = environmentAccessType; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the CreateOrUpdateEnvironmentAccessModel instance itself - */ - public CreateOrUpdateEnvironmentAccessModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateOrUpdateEnvironmentAccessModel createOrUpdateEnvironmentAccessModel = (CreateOrUpdateEnvironmentAccessModel) o; - return Objects.equals(this.environmentId, createOrUpdateEnvironmentAccessModel.environmentId) && - Objects.equals(this.environmentAccessType, createOrUpdateEnvironmentAccessModel.environmentAccessType)&& - Objects.equals(this.additionalProperties, createOrUpdateEnvironmentAccessModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(environmentId, environmentAccessType, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateOrUpdateEnvironmentAccessModel {\n"); - sb.append(" environmentId: ").append(toIndentedString(environmentId)).append("\n"); - sb.append(" environmentAccessType: ").append(toIndentedString(environmentAccessType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("environmentId"); - openapiFields.add("environmentAccessType"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateOrUpdateEnvironmentAccessModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateOrUpdateEnvironmentAccessModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateOrUpdateEnvironmentAccessModel is not found in the empty JSON string", CreateOrUpdateEnvironmentAccessModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("environmentId") != null && !jsonObj.get("environmentId").isJsonNull()) && !jsonObj.get("environmentId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `environmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentId").toString())); - } - // validate the optional field `environmentAccessType` - if (jsonObj.get("environmentAccessType") != null && !jsonObj.get("environmentAccessType").isJsonNull()) { - EnvironmentAccessType.validateJsonElement(jsonObj.get("environmentAccessType")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateOrUpdateEnvironmentAccessModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateOrUpdateEnvironmentAccessModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateOrUpdateEnvironmentAccessModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateOrUpdateEnvironmentAccessModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public CreateOrUpdateEnvironmentAccessModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CreateOrUpdateEnvironmentAccessModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CreateOrUpdateEnvironmentAccessModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateOrUpdateEnvironmentAccessModel - * @throws IOException if the JSON string is invalid with respect to CreateOrUpdateEnvironmentAccessModel - */ - public static CreateOrUpdateEnvironmentAccessModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateOrUpdateEnvironmentAccessModel.class); - } - - /** - * Convert an instance of CreateOrUpdateEnvironmentAccessModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/CreatePermissionGroupRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/CreatePermissionGroupRequest.java deleted file mode 100644 index 3a66263..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/CreatePermissionGroupRequest.java +++ /dev/null @@ -1,966 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.AccessType; -import com.configcat.publicapi.java.client.model.CreateOrUpdateEnvironmentAccessModel; -import com.configcat.publicapi.java.client.model.EnvironmentAccessType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * CreatePermissionGroupRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class CreatePermissionGroupRequest { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_CAN_MANAGE_MEMBERS = "canManageMembers"; - @SerializedName(SERIALIZED_NAME_CAN_MANAGE_MEMBERS) - private Boolean canManageMembers; - - public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_CONFIG = "canCreateOrUpdateConfig"; - @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_CONFIG) - private Boolean canCreateOrUpdateConfig; - - public static final String SERIALIZED_NAME_CAN_DELETE_CONFIG = "canDeleteConfig"; - @SerializedName(SERIALIZED_NAME_CAN_DELETE_CONFIG) - private Boolean canDeleteConfig; - - public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_ENVIRONMENT = "canCreateOrUpdateEnvironment"; - @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_ENVIRONMENT) - private Boolean canCreateOrUpdateEnvironment; - - public static final String SERIALIZED_NAME_CAN_DELETE_ENVIRONMENT = "canDeleteEnvironment"; - @SerializedName(SERIALIZED_NAME_CAN_DELETE_ENVIRONMENT) - private Boolean canDeleteEnvironment; - - public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SETTING = "canCreateOrUpdateSetting"; - @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SETTING) - private Boolean canCreateOrUpdateSetting; - - public static final String SERIALIZED_NAME_CAN_TAG_SETTING = "canTagSetting"; - @SerializedName(SERIALIZED_NAME_CAN_TAG_SETTING) - private Boolean canTagSetting; - - public static final String SERIALIZED_NAME_CAN_DELETE_SETTING = "canDeleteSetting"; - @SerializedName(SERIALIZED_NAME_CAN_DELETE_SETTING) - private Boolean canDeleteSetting; - - public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_TAG = "canCreateOrUpdateTag"; - @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_TAG) - private Boolean canCreateOrUpdateTag; - - public static final String SERIALIZED_NAME_CAN_DELETE_TAG = "canDeleteTag"; - @SerializedName(SERIALIZED_NAME_CAN_DELETE_TAG) - private Boolean canDeleteTag; - - public static final String SERIALIZED_NAME_CAN_MANAGE_WEBHOOK = "canManageWebhook"; - @SerializedName(SERIALIZED_NAME_CAN_MANAGE_WEBHOOK) - private Boolean canManageWebhook; - - public static final String SERIALIZED_NAME_CAN_USE_EXPORT_IMPORT = "canUseExportImport"; - @SerializedName(SERIALIZED_NAME_CAN_USE_EXPORT_IMPORT) - private Boolean canUseExportImport; - - public static final String SERIALIZED_NAME_CAN_MANAGE_PRODUCT_PREFERENCES = "canManageProductPreferences"; - @SerializedName(SERIALIZED_NAME_CAN_MANAGE_PRODUCT_PREFERENCES) - private Boolean canManageProductPreferences; - - public static final String SERIALIZED_NAME_CAN_MANAGE_INTEGRATIONS = "canManageIntegrations"; - @SerializedName(SERIALIZED_NAME_CAN_MANAGE_INTEGRATIONS) - private Boolean canManageIntegrations; - - public static final String SERIALIZED_NAME_CAN_VIEW_SDK_KEY = "canViewSdkKey"; - @SerializedName(SERIALIZED_NAME_CAN_VIEW_SDK_KEY) - private Boolean canViewSdkKey; - - public static final String SERIALIZED_NAME_CAN_ROTATE_SDK_KEY = "canRotateSdkKey"; - @SerializedName(SERIALIZED_NAME_CAN_ROTATE_SDK_KEY) - private Boolean canRotateSdkKey; - - public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SEGMENTS = "canCreateOrUpdateSegments"; - @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SEGMENTS) - private Boolean canCreateOrUpdateSegments; - - public static final String SERIALIZED_NAME_CAN_DELETE_SEGMENTS = "canDeleteSegments"; - @SerializedName(SERIALIZED_NAME_CAN_DELETE_SEGMENTS) - private Boolean canDeleteSegments; - - public static final String SERIALIZED_NAME_CAN_VIEW_PRODUCT_AUDIT_LOG = "canViewProductAuditLog"; - @SerializedName(SERIALIZED_NAME_CAN_VIEW_PRODUCT_AUDIT_LOG) - private Boolean canViewProductAuditLog; - - public static final String SERIALIZED_NAME_CAN_VIEW_PRODUCT_STATISTICS = "canViewProductStatistics"; - @SerializedName(SERIALIZED_NAME_CAN_VIEW_PRODUCT_STATISTICS) - private Boolean canViewProductStatistics; - - public static final String SERIALIZED_NAME_ACCESS_TYPE = "accessType"; - @SerializedName(SERIALIZED_NAME_ACCESS_TYPE) - private AccessType accessType; - - public static final String SERIALIZED_NAME_NEW_ENVIRONMENT_ACCESS_TYPE = "newEnvironmentAccessType"; - @SerializedName(SERIALIZED_NAME_NEW_ENVIRONMENT_ACCESS_TYPE) - private EnvironmentAccessType newEnvironmentAccessType; - - public static final String SERIALIZED_NAME_ENVIRONMENT_ACCESSES = "environmentAccesses"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ACCESSES) - private List environmentAccesses; - - public static final String SERIALIZED_NAME_CAN_DISABLE2_F_A = "canDisable2FA"; - @SerializedName(SERIALIZED_NAME_CAN_DISABLE2_F_A) - private Boolean canDisable2FA; - - public CreatePermissionGroupRequest() { - } - - public CreatePermissionGroupRequest name(String name) { - this.name = name; - return this; - } - - /** - * Name of the Permission Group. - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public CreatePermissionGroupRequest canManageMembers(Boolean canManageMembers) { - this.canManageMembers = canManageMembers; - return this; - } - - /** - * Group members can manage team members. - * @return canManageMembers - */ - @javax.annotation.Nullable - public Boolean getCanManageMembers() { - return canManageMembers; - } - - public void setCanManageMembers(Boolean canManageMembers) { - this.canManageMembers = canManageMembers; - } - - - public CreatePermissionGroupRequest canCreateOrUpdateConfig(Boolean canCreateOrUpdateConfig) { - this.canCreateOrUpdateConfig = canCreateOrUpdateConfig; - return this; - } - - /** - * Group members can create/update Configs. - * @return canCreateOrUpdateConfig - */ - @javax.annotation.Nullable - public Boolean getCanCreateOrUpdateConfig() { - return canCreateOrUpdateConfig; - } - - public void setCanCreateOrUpdateConfig(Boolean canCreateOrUpdateConfig) { - this.canCreateOrUpdateConfig = canCreateOrUpdateConfig; - } - - - public CreatePermissionGroupRequest canDeleteConfig(Boolean canDeleteConfig) { - this.canDeleteConfig = canDeleteConfig; - return this; - } - - /** - * Group members can delete Configs. - * @return canDeleteConfig - */ - @javax.annotation.Nullable - public Boolean getCanDeleteConfig() { - return canDeleteConfig; - } - - public void setCanDeleteConfig(Boolean canDeleteConfig) { - this.canDeleteConfig = canDeleteConfig; - } - - - public CreatePermissionGroupRequest canCreateOrUpdateEnvironment(Boolean canCreateOrUpdateEnvironment) { - this.canCreateOrUpdateEnvironment = canCreateOrUpdateEnvironment; - return this; - } - - /** - * Group members can create/update Environments. - * @return canCreateOrUpdateEnvironment - */ - @javax.annotation.Nullable - public Boolean getCanCreateOrUpdateEnvironment() { - return canCreateOrUpdateEnvironment; - } - - public void setCanCreateOrUpdateEnvironment(Boolean canCreateOrUpdateEnvironment) { - this.canCreateOrUpdateEnvironment = canCreateOrUpdateEnvironment; - } - - - public CreatePermissionGroupRequest canDeleteEnvironment(Boolean canDeleteEnvironment) { - this.canDeleteEnvironment = canDeleteEnvironment; - return this; - } - - /** - * Group members can delete Environments. - * @return canDeleteEnvironment - */ - @javax.annotation.Nullable - public Boolean getCanDeleteEnvironment() { - return canDeleteEnvironment; - } - - public void setCanDeleteEnvironment(Boolean canDeleteEnvironment) { - this.canDeleteEnvironment = canDeleteEnvironment; - } - - - public CreatePermissionGroupRequest canCreateOrUpdateSetting(Boolean canCreateOrUpdateSetting) { - this.canCreateOrUpdateSetting = canCreateOrUpdateSetting; - return this; - } - - /** - * Group members can create/update Feature Flags and Settings. - * @return canCreateOrUpdateSetting - */ - @javax.annotation.Nullable - public Boolean getCanCreateOrUpdateSetting() { - return canCreateOrUpdateSetting; - } - - public void setCanCreateOrUpdateSetting(Boolean canCreateOrUpdateSetting) { - this.canCreateOrUpdateSetting = canCreateOrUpdateSetting; - } - - - public CreatePermissionGroupRequest canTagSetting(Boolean canTagSetting) { - this.canTagSetting = canTagSetting; - return this; - } - - /** - * Group members can attach/detach Tags to Feature Flags and Settings. - * @return canTagSetting - */ - @javax.annotation.Nullable - public Boolean getCanTagSetting() { - return canTagSetting; - } - - public void setCanTagSetting(Boolean canTagSetting) { - this.canTagSetting = canTagSetting; - } - - - public CreatePermissionGroupRequest canDeleteSetting(Boolean canDeleteSetting) { - this.canDeleteSetting = canDeleteSetting; - return this; - } - - /** - * Group members can delete Feature Flags and Settings. - * @return canDeleteSetting - */ - @javax.annotation.Nullable - public Boolean getCanDeleteSetting() { - return canDeleteSetting; - } - - public void setCanDeleteSetting(Boolean canDeleteSetting) { - this.canDeleteSetting = canDeleteSetting; - } - - - public CreatePermissionGroupRequest canCreateOrUpdateTag(Boolean canCreateOrUpdateTag) { - this.canCreateOrUpdateTag = canCreateOrUpdateTag; - return this; - } - - /** - * Group members can create/update Tags. - * @return canCreateOrUpdateTag - */ - @javax.annotation.Nullable - public Boolean getCanCreateOrUpdateTag() { - return canCreateOrUpdateTag; - } - - public void setCanCreateOrUpdateTag(Boolean canCreateOrUpdateTag) { - this.canCreateOrUpdateTag = canCreateOrUpdateTag; - } - - - public CreatePermissionGroupRequest canDeleteTag(Boolean canDeleteTag) { - this.canDeleteTag = canDeleteTag; - return this; - } - - /** - * Group members can delete Tags. - * @return canDeleteTag - */ - @javax.annotation.Nullable - public Boolean getCanDeleteTag() { - return canDeleteTag; - } - - public void setCanDeleteTag(Boolean canDeleteTag) { - this.canDeleteTag = canDeleteTag; - } - - - public CreatePermissionGroupRequest canManageWebhook(Boolean canManageWebhook) { - this.canManageWebhook = canManageWebhook; - return this; - } - - /** - * Group members can create/update/delete Webhooks. - * @return canManageWebhook - */ - @javax.annotation.Nullable - public Boolean getCanManageWebhook() { - return canManageWebhook; - } - - public void setCanManageWebhook(Boolean canManageWebhook) { - this.canManageWebhook = canManageWebhook; - } - - - public CreatePermissionGroupRequest canUseExportImport(Boolean canUseExportImport) { - this.canUseExportImport = canUseExportImport; - return this; - } - - /** - * Group members can use the export/import feature. - * @return canUseExportImport - */ - @javax.annotation.Nullable - public Boolean getCanUseExportImport() { - return canUseExportImport; - } - - public void setCanUseExportImport(Boolean canUseExportImport) { - this.canUseExportImport = canUseExportImport; - } - - - public CreatePermissionGroupRequest canManageProductPreferences(Boolean canManageProductPreferences) { - this.canManageProductPreferences = canManageProductPreferences; - return this; - } - - /** - * Group members can update Product preferences. - * @return canManageProductPreferences - */ - @javax.annotation.Nullable - public Boolean getCanManageProductPreferences() { - return canManageProductPreferences; - } - - public void setCanManageProductPreferences(Boolean canManageProductPreferences) { - this.canManageProductPreferences = canManageProductPreferences; - } - - - public CreatePermissionGroupRequest canManageIntegrations(Boolean canManageIntegrations) { - this.canManageIntegrations = canManageIntegrations; - return this; - } - - /** - * Group members can add and configure integrations. - * @return canManageIntegrations - */ - @javax.annotation.Nullable - public Boolean getCanManageIntegrations() { - return canManageIntegrations; - } - - public void setCanManageIntegrations(Boolean canManageIntegrations) { - this.canManageIntegrations = canManageIntegrations; - } - - - public CreatePermissionGroupRequest canViewSdkKey(Boolean canViewSdkKey) { - this.canViewSdkKey = canViewSdkKey; - return this; - } - - /** - * Group members has access to SDK keys. - * @return canViewSdkKey - */ - @javax.annotation.Nullable - public Boolean getCanViewSdkKey() { - return canViewSdkKey; - } - - public void setCanViewSdkKey(Boolean canViewSdkKey) { - this.canViewSdkKey = canViewSdkKey; - } - - - public CreatePermissionGroupRequest canRotateSdkKey(Boolean canRotateSdkKey) { - this.canRotateSdkKey = canRotateSdkKey; - return this; - } - - /** - * Group members can rotate SDK keys. - * @return canRotateSdkKey - */ - @javax.annotation.Nullable - public Boolean getCanRotateSdkKey() { - return canRotateSdkKey; - } - - public void setCanRotateSdkKey(Boolean canRotateSdkKey) { - this.canRotateSdkKey = canRotateSdkKey; - } - - - public CreatePermissionGroupRequest canCreateOrUpdateSegments(Boolean canCreateOrUpdateSegments) { - this.canCreateOrUpdateSegments = canCreateOrUpdateSegments; - return this; - } - - /** - * Group members can create/update Segments. - * @return canCreateOrUpdateSegments - */ - @javax.annotation.Nullable - public Boolean getCanCreateOrUpdateSegments() { - return canCreateOrUpdateSegments; - } - - public void setCanCreateOrUpdateSegments(Boolean canCreateOrUpdateSegments) { - this.canCreateOrUpdateSegments = canCreateOrUpdateSegments; - } - - - public CreatePermissionGroupRequest canDeleteSegments(Boolean canDeleteSegments) { - this.canDeleteSegments = canDeleteSegments; - return this; - } - - /** - * Group members can delete Segments. - * @return canDeleteSegments - */ - @javax.annotation.Nullable - public Boolean getCanDeleteSegments() { - return canDeleteSegments; - } - - public void setCanDeleteSegments(Boolean canDeleteSegments) { - this.canDeleteSegments = canDeleteSegments; - } - - - public CreatePermissionGroupRequest canViewProductAuditLog(Boolean canViewProductAuditLog) { - this.canViewProductAuditLog = canViewProductAuditLog; - return this; - } - - /** - * Group members has access to audit logs. - * @return canViewProductAuditLog - */ - @javax.annotation.Nullable - public Boolean getCanViewProductAuditLog() { - return canViewProductAuditLog; - } - - public void setCanViewProductAuditLog(Boolean canViewProductAuditLog) { - this.canViewProductAuditLog = canViewProductAuditLog; - } - - - public CreatePermissionGroupRequest canViewProductStatistics(Boolean canViewProductStatistics) { - this.canViewProductStatistics = canViewProductStatistics; - return this; - } - - /** - * Group members has access to product statistics. - * @return canViewProductStatistics - */ - @javax.annotation.Nullable - public Boolean getCanViewProductStatistics() { - return canViewProductStatistics; - } - - public void setCanViewProductStatistics(Boolean canViewProductStatistics) { - this.canViewProductStatistics = canViewProductStatistics; - } - - - public CreatePermissionGroupRequest accessType(AccessType accessType) { - this.accessType = accessType; - return this; - } - - /** - * Get accessType - * @return accessType - */ - @javax.annotation.Nullable - public AccessType getAccessType() { - return accessType; - } - - public void setAccessType(AccessType accessType) { - this.accessType = accessType; - } - - - public CreatePermissionGroupRequest newEnvironmentAccessType(EnvironmentAccessType newEnvironmentAccessType) { - this.newEnvironmentAccessType = newEnvironmentAccessType; - return this; - } - - /** - * Get newEnvironmentAccessType - * @return newEnvironmentAccessType - */ - @javax.annotation.Nullable - public EnvironmentAccessType getNewEnvironmentAccessType() { - return newEnvironmentAccessType; - } - - public void setNewEnvironmentAccessType(EnvironmentAccessType newEnvironmentAccessType) { - this.newEnvironmentAccessType = newEnvironmentAccessType; - } - - - public CreatePermissionGroupRequest environmentAccesses(List environmentAccesses) { - this.environmentAccesses = environmentAccesses; - return this; - } - - public CreatePermissionGroupRequest addEnvironmentAccessesItem(CreateOrUpdateEnvironmentAccessModel environmentAccessesItem) { - if (this.environmentAccesses == null) { - this.environmentAccesses = new ArrayList<>(); - } - this.environmentAccesses.add(environmentAccessesItem); - return this; - } - - /** - * List of environment specific permissions. - * @return environmentAccesses - */ - @javax.annotation.Nullable - public List getEnvironmentAccesses() { - return environmentAccesses; - } - - public void setEnvironmentAccesses(List environmentAccesses) { - this.environmentAccesses = environmentAccesses; - } - - - public CreatePermissionGroupRequest canDisable2FA(Boolean canDisable2FA) { - this.canDisable2FA = canDisable2FA; - return this; - } - - /** - * Group members can disable two-factor authentication for other members. - * @return canDisable2FA - */ - @javax.annotation.Nullable - public Boolean getCanDisable2FA() { - return canDisable2FA; - } - - public void setCanDisable2FA(Boolean canDisable2FA) { - this.canDisable2FA = canDisable2FA; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the CreatePermissionGroupRequest instance itself - */ - public CreatePermissionGroupRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreatePermissionGroupRequest createPermissionGroupRequest = (CreatePermissionGroupRequest) o; - return Objects.equals(this.name, createPermissionGroupRequest.name) && - Objects.equals(this.canManageMembers, createPermissionGroupRequest.canManageMembers) && - Objects.equals(this.canCreateOrUpdateConfig, createPermissionGroupRequest.canCreateOrUpdateConfig) && - Objects.equals(this.canDeleteConfig, createPermissionGroupRequest.canDeleteConfig) && - Objects.equals(this.canCreateOrUpdateEnvironment, createPermissionGroupRequest.canCreateOrUpdateEnvironment) && - Objects.equals(this.canDeleteEnvironment, createPermissionGroupRequest.canDeleteEnvironment) && - Objects.equals(this.canCreateOrUpdateSetting, createPermissionGroupRequest.canCreateOrUpdateSetting) && - Objects.equals(this.canTagSetting, createPermissionGroupRequest.canTagSetting) && - Objects.equals(this.canDeleteSetting, createPermissionGroupRequest.canDeleteSetting) && - Objects.equals(this.canCreateOrUpdateTag, createPermissionGroupRequest.canCreateOrUpdateTag) && - Objects.equals(this.canDeleteTag, createPermissionGroupRequest.canDeleteTag) && - Objects.equals(this.canManageWebhook, createPermissionGroupRequest.canManageWebhook) && - Objects.equals(this.canUseExportImport, createPermissionGroupRequest.canUseExportImport) && - Objects.equals(this.canManageProductPreferences, createPermissionGroupRequest.canManageProductPreferences) && - Objects.equals(this.canManageIntegrations, createPermissionGroupRequest.canManageIntegrations) && - Objects.equals(this.canViewSdkKey, createPermissionGroupRequest.canViewSdkKey) && - Objects.equals(this.canRotateSdkKey, createPermissionGroupRequest.canRotateSdkKey) && - Objects.equals(this.canCreateOrUpdateSegments, createPermissionGroupRequest.canCreateOrUpdateSegments) && - Objects.equals(this.canDeleteSegments, createPermissionGroupRequest.canDeleteSegments) && - Objects.equals(this.canViewProductAuditLog, createPermissionGroupRequest.canViewProductAuditLog) && - Objects.equals(this.canViewProductStatistics, createPermissionGroupRequest.canViewProductStatistics) && - Objects.equals(this.accessType, createPermissionGroupRequest.accessType) && - Objects.equals(this.newEnvironmentAccessType, createPermissionGroupRequest.newEnvironmentAccessType) && - Objects.equals(this.environmentAccesses, createPermissionGroupRequest.environmentAccesses) && - Objects.equals(this.canDisable2FA, createPermissionGroupRequest.canDisable2FA)&& - Objects.equals(this.additionalProperties, createPermissionGroupRequest.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(name, canManageMembers, canCreateOrUpdateConfig, canDeleteConfig, canCreateOrUpdateEnvironment, canDeleteEnvironment, canCreateOrUpdateSetting, canTagSetting, canDeleteSetting, canCreateOrUpdateTag, canDeleteTag, canManageWebhook, canUseExportImport, canManageProductPreferences, canManageIntegrations, canViewSdkKey, canRotateSdkKey, canCreateOrUpdateSegments, canDeleteSegments, canViewProductAuditLog, canViewProductStatistics, accessType, newEnvironmentAccessType, environmentAccesses, canDisable2FA, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreatePermissionGroupRequest {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" canManageMembers: ").append(toIndentedString(canManageMembers)).append("\n"); - sb.append(" canCreateOrUpdateConfig: ").append(toIndentedString(canCreateOrUpdateConfig)).append("\n"); - sb.append(" canDeleteConfig: ").append(toIndentedString(canDeleteConfig)).append("\n"); - sb.append(" canCreateOrUpdateEnvironment: ").append(toIndentedString(canCreateOrUpdateEnvironment)).append("\n"); - sb.append(" canDeleteEnvironment: ").append(toIndentedString(canDeleteEnvironment)).append("\n"); - sb.append(" canCreateOrUpdateSetting: ").append(toIndentedString(canCreateOrUpdateSetting)).append("\n"); - sb.append(" canTagSetting: ").append(toIndentedString(canTagSetting)).append("\n"); - sb.append(" canDeleteSetting: ").append(toIndentedString(canDeleteSetting)).append("\n"); - sb.append(" canCreateOrUpdateTag: ").append(toIndentedString(canCreateOrUpdateTag)).append("\n"); - sb.append(" canDeleteTag: ").append(toIndentedString(canDeleteTag)).append("\n"); - sb.append(" canManageWebhook: ").append(toIndentedString(canManageWebhook)).append("\n"); - sb.append(" canUseExportImport: ").append(toIndentedString(canUseExportImport)).append("\n"); - sb.append(" canManageProductPreferences: ").append(toIndentedString(canManageProductPreferences)).append("\n"); - sb.append(" canManageIntegrations: ").append(toIndentedString(canManageIntegrations)).append("\n"); - sb.append(" canViewSdkKey: ").append(toIndentedString(canViewSdkKey)).append("\n"); - sb.append(" canRotateSdkKey: ").append(toIndentedString(canRotateSdkKey)).append("\n"); - sb.append(" canCreateOrUpdateSegments: ").append(toIndentedString(canCreateOrUpdateSegments)).append("\n"); - sb.append(" canDeleteSegments: ").append(toIndentedString(canDeleteSegments)).append("\n"); - sb.append(" canViewProductAuditLog: ").append(toIndentedString(canViewProductAuditLog)).append("\n"); - sb.append(" canViewProductStatistics: ").append(toIndentedString(canViewProductStatistics)).append("\n"); - sb.append(" accessType: ").append(toIndentedString(accessType)).append("\n"); - sb.append(" newEnvironmentAccessType: ").append(toIndentedString(newEnvironmentAccessType)).append("\n"); - sb.append(" environmentAccesses: ").append(toIndentedString(environmentAccesses)).append("\n"); - sb.append(" canDisable2FA: ").append(toIndentedString(canDisable2FA)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("canManageMembers"); - openapiFields.add("canCreateOrUpdateConfig"); - openapiFields.add("canDeleteConfig"); - openapiFields.add("canCreateOrUpdateEnvironment"); - openapiFields.add("canDeleteEnvironment"); - openapiFields.add("canCreateOrUpdateSetting"); - openapiFields.add("canTagSetting"); - openapiFields.add("canDeleteSetting"); - openapiFields.add("canCreateOrUpdateTag"); - openapiFields.add("canDeleteTag"); - openapiFields.add("canManageWebhook"); - openapiFields.add("canUseExportImport"); - openapiFields.add("canManageProductPreferences"); - openapiFields.add("canManageIntegrations"); - openapiFields.add("canViewSdkKey"); - openapiFields.add("canRotateSdkKey"); - openapiFields.add("canCreateOrUpdateSegments"); - openapiFields.add("canDeleteSegments"); - openapiFields.add("canViewProductAuditLog"); - openapiFields.add("canViewProductStatistics"); - openapiFields.add("accessType"); - openapiFields.add("newEnvironmentAccessType"); - openapiFields.add("environmentAccesses"); - openapiFields.add("canDisable2FA"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreatePermissionGroupRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreatePermissionGroupRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreatePermissionGroupRequest is not found in the empty JSON string", CreatePermissionGroupRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreatePermissionGroupRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - // validate the optional field `accessType` - if (jsonObj.get("accessType") != null && !jsonObj.get("accessType").isJsonNull()) { - AccessType.validateJsonElement(jsonObj.get("accessType")); - } - // validate the optional field `newEnvironmentAccessType` - if (jsonObj.get("newEnvironmentAccessType") != null && !jsonObj.get("newEnvironmentAccessType").isJsonNull()) { - EnvironmentAccessType.validateJsonElement(jsonObj.get("newEnvironmentAccessType")); - } - if (jsonObj.get("environmentAccesses") != null && !jsonObj.get("environmentAccesses").isJsonNull()) { - JsonArray jsonArrayenvironmentAccesses = jsonObj.getAsJsonArray("environmentAccesses"); - if (jsonArrayenvironmentAccesses != null) { - // ensure the json data is an array - if (!jsonObj.get("environmentAccesses").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `environmentAccesses` to be an array in the JSON string but got `%s`", jsonObj.get("environmentAccesses").toString())); - } - - // validate the optional field `environmentAccesses` (array) - for (int i = 0; i < jsonArrayenvironmentAccesses.size(); i++) { - CreateOrUpdateEnvironmentAccessModel.validateJsonElement(jsonArrayenvironmentAccesses.get(i)); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreatePermissionGroupRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreatePermissionGroupRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreatePermissionGroupRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreatePermissionGroupRequest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public CreatePermissionGroupRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CreatePermissionGroupRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CreatePermissionGroupRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreatePermissionGroupRequest - * @throws IOException if the JSON string is invalid with respect to CreatePermissionGroupRequest - */ - public static CreatePermissionGroupRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreatePermissionGroupRequest.class); - } - - /** - * Convert an instance of CreatePermissionGroupRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/CreateProductRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/CreateProductRequest.java deleted file mode 100644 index a1f899b..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/CreateProductRequest.java +++ /dev/null @@ -1,362 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * CreateProductRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class CreateProductRequest { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_ORDER = "order"; - @SerializedName(SERIALIZED_NAME_ORDER) - private Integer order; - - public CreateProductRequest() { - } - - public CreateProductRequest name(String name) { - this.name = name; - return this; - } - - /** - * The name of the Product. - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public CreateProductRequest description(String description) { - this.description = description; - return this; - } - - /** - * The description of the Product. - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - - public CreateProductRequest order(Integer order) { - this.order = order; - return this; - } - - /** - * The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. - * @return order - */ - @javax.annotation.Nullable - public Integer getOrder() { - return order; - } - - public void setOrder(Integer order) { - this.order = order; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the CreateProductRequest instance itself - */ - public CreateProductRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateProductRequest createProductRequest = (CreateProductRequest) o; - return Objects.equals(this.name, createProductRequest.name) && - Objects.equals(this.description, createProductRequest.description) && - Objects.equals(this.order, createProductRequest.order)&& - Objects.equals(this.additionalProperties, createProductRequest.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(name, description, order, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateProductRequest {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("order"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateProductRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateProductRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateProductRequest is not found in the empty JSON string", CreateProductRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateProductRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateProductRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateProductRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateProductRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateProductRequest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public CreateProductRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CreateProductRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CreateProductRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateProductRequest - * @throws IOException if the JSON string is invalid with respect to CreateProductRequest - */ - public static CreateProductRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateProductRequest.class); - } - - /** - * Convert an instance of CreateProductRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/CreateSegmentModel.java b/src/main/java/com/configcat/publicapi/java/client/model/CreateSegmentModel.java deleted file mode 100644 index 384c2d0..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/CreateSegmentModel.java +++ /dev/null @@ -1,426 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.RolloutRuleComparator; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * CreateSegmentModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class CreateSegmentModel { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_COMPARISON_ATTRIBUTE = "comparisonAttribute"; - @SerializedName(SERIALIZED_NAME_COMPARISON_ATTRIBUTE) - private String comparisonAttribute; - - public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; - @SerializedName(SERIALIZED_NAME_COMPARATOR) - private RolloutRuleComparator comparator; - - public static final String SERIALIZED_NAME_COMPARISON_VALUE = "comparisonValue"; - @SerializedName(SERIALIZED_NAME_COMPARISON_VALUE) - private String comparisonValue; - - public CreateSegmentModel() { - } - - public CreateSegmentModel name(String name) { - this.name = name; - return this; - } - - /** - * Name of the Segment. - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public CreateSegmentModel description(String description) { - this.description = description; - return this; - } - - /** - * Description of the Segment. - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - - public CreateSegmentModel comparisonAttribute(String comparisonAttribute) { - this.comparisonAttribute = comparisonAttribute; - return this; - } - - /** - * The user's attribute the evaluation process must take into account. - * @return comparisonAttribute - */ - @javax.annotation.Nonnull - public String getComparisonAttribute() { - return comparisonAttribute; - } - - public void setComparisonAttribute(String comparisonAttribute) { - this.comparisonAttribute = comparisonAttribute; - } - - - public CreateSegmentModel comparator(RolloutRuleComparator comparator) { - this.comparator = comparator; - return this; - } - - /** - * Get comparator - * @return comparator - */ - @javax.annotation.Nonnull - public RolloutRuleComparator getComparator() { - return comparator; - } - - public void setComparator(RolloutRuleComparator comparator) { - this.comparator = comparator; - } - - - public CreateSegmentModel comparisonValue(String comparisonValue) { - this.comparisonValue = comparisonValue; - return this; - } - - /** - * The value to compare with the given user attribute's value. - * @return comparisonValue - */ - @javax.annotation.Nonnull - public String getComparisonValue() { - return comparisonValue; - } - - public void setComparisonValue(String comparisonValue) { - this.comparisonValue = comparisonValue; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the CreateSegmentModel instance itself - */ - public CreateSegmentModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateSegmentModel createSegmentModel = (CreateSegmentModel) o; - return Objects.equals(this.name, createSegmentModel.name) && - Objects.equals(this.description, createSegmentModel.description) && - Objects.equals(this.comparisonAttribute, createSegmentModel.comparisonAttribute) && - Objects.equals(this.comparator, createSegmentModel.comparator) && - Objects.equals(this.comparisonValue, createSegmentModel.comparisonValue)&& - Objects.equals(this.additionalProperties, createSegmentModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(name, description, comparisonAttribute, comparator, comparisonValue, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateSegmentModel {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" comparisonAttribute: ").append(toIndentedString(comparisonAttribute)).append("\n"); - sb.append(" comparator: ").append(toIndentedString(comparator)).append("\n"); - sb.append(" comparisonValue: ").append(toIndentedString(comparisonValue)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("comparisonAttribute"); - openapiFields.add("comparator"); - openapiFields.add("comparisonValue"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("comparisonAttribute"); - openapiRequiredFields.add("comparator"); - openapiRequiredFields.add("comparisonValue"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateSegmentModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateSegmentModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateSegmentModel is not found in the empty JSON string", CreateSegmentModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateSegmentModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if (!jsonObj.get("comparisonAttribute").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `comparisonAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonAttribute").toString())); - } - // validate the required field `comparator` - RolloutRuleComparator.validateJsonElement(jsonObj.get("comparator")); - if (!jsonObj.get("comparisonValue").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `comparisonValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonValue").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateSegmentModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateSegmentModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateSegmentModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateSegmentModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public CreateSegmentModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CreateSegmentModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CreateSegmentModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateSegmentModel - * @throws IOException if the JSON string is invalid with respect to CreateSegmentModel - */ - public static CreateSegmentModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateSegmentModel.class); - } - - /** - * Convert an instance of CreateSegmentModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/CreateSettingInitialValues.java b/src/main/java/com/configcat/publicapi/java/client/model/CreateSettingInitialValues.java deleted file mode 100644 index cd91990..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/CreateSettingInitialValues.java +++ /dev/null @@ -1,511 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.InitialValue; -import com.configcat.publicapi.java.client.model.SettingType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * CreateSettingInitialValues - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class CreateSettingInitialValues { - public static final String SERIALIZED_NAME_HINT = "hint"; - @SerializedName(SERIALIZED_NAME_HINT) - private String hint; - - public static final String SERIALIZED_NAME_TAGS = "tags"; - @SerializedName(SERIALIZED_NAME_TAGS) - private List tags; - - public static final String SERIALIZED_NAME_ORDER = "order"; - @SerializedName(SERIALIZED_NAME_ORDER) - private Integer order; - - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_SETTING_TYPE = "settingType"; - @SerializedName(SERIALIZED_NAME_SETTING_TYPE) - private SettingType settingType; - - public static final String SERIALIZED_NAME_INITIAL_VALUES = "initialValues"; - @SerializedName(SERIALIZED_NAME_INITIAL_VALUES) - private List initialValues; - - public CreateSettingInitialValues() { - } - - public CreateSettingInitialValues hint(String hint) { - this.hint = hint; - return this; - } - - /** - * A short description for the setting, shown on the Dashboard UI. - * @return hint - */ - @javax.annotation.Nullable - public String getHint() { - return hint; - } - - public void setHint(String hint) { - this.hint = hint; - } - - - public CreateSettingInitialValues tags(List tags) { - this.tags = tags; - return this; - } - - public CreateSettingInitialValues addTagsItem(Long tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * The IDs of the tags which are attached to the setting. - * @return tags - */ - @javax.annotation.Nullable - public List getTags() { - return tags; - } - - public void setTags(List tags) { - this.tags = tags; - } - - - public CreateSettingInitialValues order(Integer order) { - this.order = order; - return this; - } - - /** - * The order of the Setting represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. - * @return order - */ - @javax.annotation.Nullable - public Integer getOrder() { - return order; - } - - public void setOrder(Integer order) { - this.order = order; - } - - - public CreateSettingInitialValues key(String key) { - this.key = key; - return this; - } - - /** - * The key of the Feature Flag or Setting. - * @return key - */ - @javax.annotation.Nonnull - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - - public CreateSettingInitialValues name(String name) { - this.name = name; - return this; - } - - /** - * The name of the Feature Flag or Setting. - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public CreateSettingInitialValues settingType(SettingType settingType) { - this.settingType = settingType; - return this; - } - - /** - * Get settingType - * @return settingType - */ - @javax.annotation.Nonnull - public SettingType getSettingType() { - return settingType; - } - - public void setSettingType(SettingType settingType) { - this.settingType = settingType; - } - - - public CreateSettingInitialValues initialValues(List initialValues) { - this.initialValues = initialValues; - return this; - } - - public CreateSettingInitialValues addInitialValuesItem(InitialValue initialValuesItem) { - if (this.initialValues == null) { - this.initialValues = new ArrayList<>(); - } - this.initialValues.add(initialValuesItem); - return this; - } - - /** - * Optional, initial value of the Feature Flag or Setting in the given Environments. - * @return initialValues - */ - @javax.annotation.Nullable - public List getInitialValues() { - return initialValues; - } - - public void setInitialValues(List initialValues) { - this.initialValues = initialValues; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the CreateSettingInitialValues instance itself - */ - public CreateSettingInitialValues putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateSettingInitialValues createSettingInitialValues = (CreateSettingInitialValues) o; - return Objects.equals(this.hint, createSettingInitialValues.hint) && - Objects.equals(this.tags, createSettingInitialValues.tags) && - Objects.equals(this.order, createSettingInitialValues.order) && - Objects.equals(this.key, createSettingInitialValues.key) && - Objects.equals(this.name, createSettingInitialValues.name) && - Objects.equals(this.settingType, createSettingInitialValues.settingType) && - Objects.equals(this.initialValues, createSettingInitialValues.initialValues)&& - Objects.equals(this.additionalProperties, createSettingInitialValues.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(hint, tags, order, key, name, settingType, initialValues, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateSettingInitialValues {\n"); - sb.append(" hint: ").append(toIndentedString(hint)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" settingType: ").append(toIndentedString(settingType)).append("\n"); - sb.append(" initialValues: ").append(toIndentedString(initialValues)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("hint"); - openapiFields.add("tags"); - openapiFields.add("order"); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("settingType"); - openapiFields.add("initialValues"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("settingType"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateSettingInitialValues - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateSettingInitialValues.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateSettingInitialValues is not found in the empty JSON string", CreateSettingInitialValues.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateSettingInitialValues.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("hint") != null && !jsonObj.get("hint").isJsonNull()) && !jsonObj.get("hint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hint").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull() && !jsonObj.get("tags").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - // validate the required field `settingType` - SettingType.validateJsonElement(jsonObj.get("settingType")); - if (jsonObj.get("initialValues") != null && !jsonObj.get("initialValues").isJsonNull()) { - JsonArray jsonArrayinitialValues = jsonObj.getAsJsonArray("initialValues"); - if (jsonArrayinitialValues != null) { - // ensure the json data is an array - if (!jsonObj.get("initialValues").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `initialValues` to be an array in the JSON string but got `%s`", jsonObj.get("initialValues").toString())); - } - - // validate the optional field `initialValues` (array) - for (int i = 0; i < jsonArrayinitialValues.size(); i++) { - InitialValue.validateJsonElement(jsonArrayinitialValues.get(i)); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateSettingInitialValues.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateSettingInitialValues' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateSettingInitialValues.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateSettingInitialValues value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public CreateSettingInitialValues read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CreateSettingInitialValues instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CreateSettingInitialValues given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateSettingInitialValues - * @throws IOException if the JSON string is invalid with respect to CreateSettingInitialValues - */ - public static CreateSettingInitialValues fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateSettingInitialValues.class); - } - - /** - * Convert an instance of CreateSettingInitialValues to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/CreateTagModel.java b/src/main/java/com/configcat/publicapi/java/client/model/CreateTagModel.java deleted file mode 100644 index e616763..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/CreateTagModel.java +++ /dev/null @@ -1,336 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * CreateTagModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class CreateTagModel { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_COLOR = "color"; - @SerializedName(SERIALIZED_NAME_COLOR) - private String color; - - public CreateTagModel() { - } - - public CreateTagModel name(String name) { - this.name = name; - return this; - } - - /** - * Name of the Tag. - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public CreateTagModel color(String color) { - this.color = color; - return this; - } - - /** - * Color of the Tag. Possible values: `panther`, `whale`, `salmon`, `lizard`, `canary`, `koala`, or any HTML color code. - * @return color - */ - @javax.annotation.Nullable - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the CreateTagModel instance itself - */ - public CreateTagModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateTagModel createTagModel = (CreateTagModel) o; - return Objects.equals(this.name, createTagModel.name) && - Objects.equals(this.color, createTagModel.color)&& - Objects.equals(this.additionalProperties, createTagModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(name, color, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateTagModel {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("color"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateTagModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateTagModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateTagModel is not found in the empty JSON string", CreateTagModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateTagModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("color") != null && !jsonObj.get("color").isJsonNull()) && !jsonObj.get("color").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateTagModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateTagModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateTagModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateTagModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public CreateTagModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CreateTagModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CreateTagModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateTagModel - * @throws IOException if the JSON string is invalid with respect to CreateTagModel - */ - public static CreateTagModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateTagModel.class); - } - - /** - * Convert an instance of CreateTagModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/DeleteIntegrationLinkModel.java b/src/main/java/com/configcat/publicapi/java/client/model/DeleteIntegrationLinkModel.java deleted file mode 100644 index 736503b..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/DeleteIntegrationLinkModel.java +++ /dev/null @@ -1,284 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * DeleteIntegrationLinkModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class DeleteIntegrationLinkModel { - public static final String SERIALIZED_NAME_HAS_REMAINING_INTEGRATION_LINK = "hasRemainingIntegrationLink"; - @SerializedName(SERIALIZED_NAME_HAS_REMAINING_INTEGRATION_LINK) - private Boolean hasRemainingIntegrationLink; - - public DeleteIntegrationLinkModel() { - } - - public DeleteIntegrationLinkModel hasRemainingIntegrationLink(Boolean hasRemainingIntegrationLink) { - this.hasRemainingIntegrationLink = hasRemainingIntegrationLink; - return this; - } - - /** - * Get hasRemainingIntegrationLink - * @return hasRemainingIntegrationLink - */ - @javax.annotation.Nullable - public Boolean getHasRemainingIntegrationLink() { - return hasRemainingIntegrationLink; - } - - public void setHasRemainingIntegrationLink(Boolean hasRemainingIntegrationLink) { - this.hasRemainingIntegrationLink = hasRemainingIntegrationLink; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the DeleteIntegrationLinkModel instance itself - */ - public DeleteIntegrationLinkModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeleteIntegrationLinkModel deleteIntegrationLinkModel = (DeleteIntegrationLinkModel) o; - return Objects.equals(this.hasRemainingIntegrationLink, deleteIntegrationLinkModel.hasRemainingIntegrationLink)&& - Objects.equals(this.additionalProperties, deleteIntegrationLinkModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(hasRemainingIntegrationLink, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteIntegrationLinkModel {\n"); - sb.append(" hasRemainingIntegrationLink: ").append(toIndentedString(hasRemainingIntegrationLink)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("hasRemainingIntegrationLink"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to DeleteIntegrationLinkModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!DeleteIntegrationLinkModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteIntegrationLinkModel is not found in the empty JSON string", DeleteIntegrationLinkModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteIntegrationLinkModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteIntegrationLinkModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteIntegrationLinkModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteIntegrationLinkModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public DeleteIntegrationLinkModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - DeleteIntegrationLinkModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of DeleteIntegrationLinkModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteIntegrationLinkModel - * @throws IOException if the JSON string is invalid with respect to DeleteIntegrationLinkModel - */ - public static DeleteIntegrationLinkModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteIntegrationLinkModel.class); - } - - /** - * Convert an instance of DeleteIntegrationLinkModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/DeleteRepositoryReportsRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/DeleteRepositoryReportsRequest.java deleted file mode 100644 index 88ee18e..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/DeleteRepositoryReportsRequest.java +++ /dev/null @@ -1,393 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * DeleteRepositoryReportsRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class DeleteRepositoryReportsRequest { - public static final String SERIALIZED_NAME_CONFIG_ID = "configId"; - @SerializedName(SERIALIZED_NAME_CONFIG_ID) - private UUID configId; - - public static final String SERIALIZED_NAME_REPOSITORY = "repository"; - @SerializedName(SERIALIZED_NAME_REPOSITORY) - private String repository; - - public static final String SERIALIZED_NAME_BRANCH = "branch"; - @SerializedName(SERIALIZED_NAME_BRANCH) - private String branch; - - public static final String SERIALIZED_NAME_SETTING_ID = "settingId"; - @SerializedName(SERIALIZED_NAME_SETTING_ID) - private Integer settingId; - - public DeleteRepositoryReportsRequest() { - } - - public DeleteRepositoryReportsRequest configId(UUID configId) { - this.configId = configId; - return this; - } - - /** - * The Config's identifier from where the reports should be deleted. - * @return configId - */ - @javax.annotation.Nonnull - public UUID getConfigId() { - return configId; - } - - public void setConfigId(UUID configId) { - this.configId = configId; - } - - - public DeleteRepositoryReportsRequest repository(String repository) { - this.repository = repository; - return this; - } - - /** - * The source control repository which's reports should be deleted. - * @return repository - */ - @javax.annotation.Nonnull - public String getRepository() { - return repository; - } - - public void setRepository(String repository) { - this.repository = repository; - } - - - public DeleteRepositoryReportsRequest branch(String branch) { - this.branch = branch; - return this; - } - - /** - * If it's set, only this branch's reports belonging to the given repository will be deleted. - * @return branch - */ - @javax.annotation.Nullable - public String getBranch() { - return branch; - } - - public void setBranch(String branch) { - this.branch = branch; - } - - - public DeleteRepositoryReportsRequest settingId(Integer settingId) { - this.settingId = settingId; - return this; - } - - /** - * If it's set, only this setting's reports belonging to the given repository will be deleted. - * @return settingId - */ - @javax.annotation.Nullable - public Integer getSettingId() { - return settingId; - } - - public void setSettingId(Integer settingId) { - this.settingId = settingId; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the DeleteRepositoryReportsRequest instance itself - */ - public DeleteRepositoryReportsRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeleteRepositoryReportsRequest deleteRepositoryReportsRequest = (DeleteRepositoryReportsRequest) o; - return Objects.equals(this.configId, deleteRepositoryReportsRequest.configId) && - Objects.equals(this.repository, deleteRepositoryReportsRequest.repository) && - Objects.equals(this.branch, deleteRepositoryReportsRequest.branch) && - Objects.equals(this.settingId, deleteRepositoryReportsRequest.settingId)&& - Objects.equals(this.additionalProperties, deleteRepositoryReportsRequest.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(configId, repository, branch, settingId, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteRepositoryReportsRequest {\n"); - sb.append(" configId: ").append(toIndentedString(configId)).append("\n"); - sb.append(" repository: ").append(toIndentedString(repository)).append("\n"); - sb.append(" branch: ").append(toIndentedString(branch)).append("\n"); - sb.append(" settingId: ").append(toIndentedString(settingId)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("configId"); - openapiFields.add("repository"); - openapiFields.add("branch"); - openapiFields.add("settingId"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("configId"); - openapiRequiredFields.add("repository"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to DeleteRepositoryReportsRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!DeleteRepositoryReportsRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteRepositoryReportsRequest is not found in the empty JSON string", DeleteRepositoryReportsRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DeleteRepositoryReportsRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("configId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `configId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("configId").toString())); - } - if (!jsonObj.get("repository").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `repository` to be a primitive type in the JSON string but got `%s`", jsonObj.get("repository").toString())); - } - if ((jsonObj.get("branch") != null && !jsonObj.get("branch").isJsonNull()) && !jsonObj.get("branch").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `branch` to be a primitive type in the JSON string but got `%s`", jsonObj.get("branch").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteRepositoryReportsRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteRepositoryReportsRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteRepositoryReportsRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteRepositoryReportsRequest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public DeleteRepositoryReportsRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - DeleteRepositoryReportsRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of DeleteRepositoryReportsRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteRepositoryReportsRequest - * @throws IOException if the JSON string is invalid with respect to DeleteRepositoryReportsRequest - */ - public static DeleteRepositoryReportsRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteRepositoryReportsRequest.class); - } - - /** - * Convert an instance of DeleteRepositoryReportsRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessModel.java b/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessModel.java deleted file mode 100644 index d0e4d1f..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessModel.java +++ /dev/null @@ -1,470 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.EnvironmentAccessType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * EnvironmentAccessModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class EnvironmentAccessModel { - public static final String SERIALIZED_NAME_ENVIRONMENT_ID = "environmentId"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) - private UUID environmentId; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_COLOR = "color"; - @SerializedName(SERIALIZED_NAME_COLOR) - private String color; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_ORDER = "order"; - @SerializedName(SERIALIZED_NAME_ORDER) - private Integer order; - - public static final String SERIALIZED_NAME_REASON_REQUIRED = "reasonRequired"; - @SerializedName(SERIALIZED_NAME_REASON_REQUIRED) - private Boolean reasonRequired; - - public static final String SERIALIZED_NAME_ENVIRONMENT_ACCESS_TYPE = "environmentAccessType"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ACCESS_TYPE) - private EnvironmentAccessType environmentAccessType; - - public EnvironmentAccessModel() { - } - - public EnvironmentAccessModel environmentId(UUID environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Identifier of the Environment. - * @return environmentId - */ - @javax.annotation.Nullable - public UUID getEnvironmentId() { - return environmentId; - } - - public void setEnvironmentId(UUID environmentId) { - this.environmentId = environmentId; - } - - - public EnvironmentAccessModel name(String name) { - this.name = name; - return this; - } - - /** - * Name of the Environment. - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public EnvironmentAccessModel color(String color) { - this.color = color; - return this; - } - - /** - * Color of the Environment. - * @return color - */ - @javax.annotation.Nullable - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - - public EnvironmentAccessModel description(String description) { - this.description = description; - return this; - } - - /** - * Description of the Environment. - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - - public EnvironmentAccessModel order(Integer order) { - this.order = order; - return this; - } - - /** - * The order of the Environment represented on the ConfigCat Dashboard. - * @return order - */ - @javax.annotation.Nullable - public Integer getOrder() { - return order; - } - - public void setOrder(Integer order) { - this.order = order; - } - - - public EnvironmentAccessModel reasonRequired(Boolean reasonRequired) { - this.reasonRequired = reasonRequired; - return this; - } - - /** - * Determines whether a mandatory reason must be given every time when the Feature Flags or Settings in the given Environment are saved. - * @return reasonRequired - */ - @javax.annotation.Nullable - public Boolean getReasonRequired() { - return reasonRequired; - } - - public void setReasonRequired(Boolean reasonRequired) { - this.reasonRequired = reasonRequired; - } - - - public EnvironmentAccessModel environmentAccessType(EnvironmentAccessType environmentAccessType) { - this.environmentAccessType = environmentAccessType; - return this; - } - - /** - * Get environmentAccessType - * @return environmentAccessType - */ - @javax.annotation.Nullable - public EnvironmentAccessType getEnvironmentAccessType() { - return environmentAccessType; - } - - public void setEnvironmentAccessType(EnvironmentAccessType environmentAccessType) { - this.environmentAccessType = environmentAccessType; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the EnvironmentAccessModel instance itself - */ - public EnvironmentAccessModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnvironmentAccessModel environmentAccessModel = (EnvironmentAccessModel) o; - return Objects.equals(this.environmentId, environmentAccessModel.environmentId) && - Objects.equals(this.name, environmentAccessModel.name) && - Objects.equals(this.color, environmentAccessModel.color) && - Objects.equals(this.description, environmentAccessModel.description) && - Objects.equals(this.order, environmentAccessModel.order) && - Objects.equals(this.reasonRequired, environmentAccessModel.reasonRequired) && - Objects.equals(this.environmentAccessType, environmentAccessModel.environmentAccessType)&& - Objects.equals(this.additionalProperties, environmentAccessModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(environmentId, name, color, description, order, reasonRequired, environmentAccessType, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnvironmentAccessModel {\n"); - sb.append(" environmentId: ").append(toIndentedString(environmentId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append(" reasonRequired: ").append(toIndentedString(reasonRequired)).append("\n"); - sb.append(" environmentAccessType: ").append(toIndentedString(environmentAccessType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("environmentId"); - openapiFields.add("name"); - openapiFields.add("color"); - openapiFields.add("description"); - openapiFields.add("order"); - openapiFields.add("reasonRequired"); - openapiFields.add("environmentAccessType"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EnvironmentAccessModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EnvironmentAccessModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EnvironmentAccessModel is not found in the empty JSON string", EnvironmentAccessModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("environmentId") != null && !jsonObj.get("environmentId").isJsonNull()) && !jsonObj.get("environmentId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `environmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentId").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("color") != null && !jsonObj.get("color").isJsonNull()) && !jsonObj.get("color").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - // validate the optional field `environmentAccessType` - if (jsonObj.get("environmentAccessType") != null && !jsonObj.get("environmentAccessType").isJsonNull()) { - EnvironmentAccessType.validateJsonElement(jsonObj.get("environmentAccessType")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EnvironmentAccessModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EnvironmentAccessModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EnvironmentAccessModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EnvironmentAccessModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public EnvironmentAccessModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - EnvironmentAccessModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EnvironmentAccessModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of EnvironmentAccessModel - * @throws IOException if the JSON string is invalid with respect to EnvironmentAccessModel - */ - public static EnvironmentAccessModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EnvironmentAccessModel.class); - } - - /** - * Convert an instance of EnvironmentAccessModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessType.java b/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessType.java deleted file mode 100644 index ccd5963..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessType.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Represent the environment specific Feature Management permission. - */ -@JsonAdapter(EnvironmentAccessType.Adapter.class) -public enum EnvironmentAccessType { - - FULL("full"), - - READ_ONLY("readOnly"), - - NONE("none"); - - private String value; - - EnvironmentAccessType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static EnvironmentAccessType fromValue(String value) { - for (EnvironmentAccessType b : EnvironmentAccessType.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final EnvironmentAccessType enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public EnvironmentAccessType read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return EnvironmentAccessType.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - EnvironmentAccessType.fromValue(value); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentModel.java b/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentModel.java deleted file mode 100644 index 99b8d3c..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentModel.java +++ /dev/null @@ -1,470 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.ProductModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * Details of the Environment. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class EnvironmentModel { - public static final String SERIALIZED_NAME_PRODUCT = "product"; - @SerializedName(SERIALIZED_NAME_PRODUCT) - private ProductModel product; - - public static final String SERIALIZED_NAME_ENVIRONMENT_ID = "environmentId"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) - private UUID environmentId; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_COLOR = "color"; - @SerializedName(SERIALIZED_NAME_COLOR) - private String color; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_ORDER = "order"; - @SerializedName(SERIALIZED_NAME_ORDER) - private Integer order; - - public static final String SERIALIZED_NAME_REASON_REQUIRED = "reasonRequired"; - @SerializedName(SERIALIZED_NAME_REASON_REQUIRED) - private Boolean reasonRequired; - - public EnvironmentModel() { - } - - public EnvironmentModel product(ProductModel product) { - this.product = product; - return this; - } - - /** - * Get product - * @return product - */ - @javax.annotation.Nullable - public ProductModel getProduct() { - return product; - } - - public void setProduct(ProductModel product) { - this.product = product; - } - - - public EnvironmentModel environmentId(UUID environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Identifier of the Environment. - * @return environmentId - */ - @javax.annotation.Nullable - public UUID getEnvironmentId() { - return environmentId; - } - - public void setEnvironmentId(UUID environmentId) { - this.environmentId = environmentId; - } - - - public EnvironmentModel name(String name) { - this.name = name; - return this; - } - - /** - * Name of the Environment. - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public EnvironmentModel color(String color) { - this.color = color; - return this; - } - - /** - * The configured color of the Environment. - * @return color - */ - @javax.annotation.Nullable - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - - public EnvironmentModel description(String description) { - this.description = description; - return this; - } - - /** - * Description of the Environment. - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - - public EnvironmentModel order(Integer order) { - this.order = order; - return this; - } - - /** - * The order of the Environment represented on the ConfigCat Dashboard. - * @return order - */ - @javax.annotation.Nullable - public Integer getOrder() { - return order; - } - - public void setOrder(Integer order) { - this.order = order; - } - - - public EnvironmentModel reasonRequired(Boolean reasonRequired) { - this.reasonRequired = reasonRequired; - return this; - } - - /** - * Determines whether a mandatory reason must be given every time when the Feature Flags or Settings in the given Environment are saved. - * @return reasonRequired - */ - @javax.annotation.Nullable - public Boolean getReasonRequired() { - return reasonRequired; - } - - public void setReasonRequired(Boolean reasonRequired) { - this.reasonRequired = reasonRequired; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the EnvironmentModel instance itself - */ - public EnvironmentModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnvironmentModel environmentModel = (EnvironmentModel) o; - return Objects.equals(this.product, environmentModel.product) && - Objects.equals(this.environmentId, environmentModel.environmentId) && - Objects.equals(this.name, environmentModel.name) && - Objects.equals(this.color, environmentModel.color) && - Objects.equals(this.description, environmentModel.description) && - Objects.equals(this.order, environmentModel.order) && - Objects.equals(this.reasonRequired, environmentModel.reasonRequired)&& - Objects.equals(this.additionalProperties, environmentModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(product, environmentId, name, color, description, order, reasonRequired, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnvironmentModel {\n"); - sb.append(" product: ").append(toIndentedString(product)).append("\n"); - sb.append(" environmentId: ").append(toIndentedString(environmentId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append(" reasonRequired: ").append(toIndentedString(reasonRequired)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("product"); - openapiFields.add("environmentId"); - openapiFields.add("name"); - openapiFields.add("color"); - openapiFields.add("description"); - openapiFields.add("order"); - openapiFields.add("reasonRequired"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EnvironmentModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EnvironmentModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EnvironmentModel is not found in the empty JSON string", EnvironmentModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `product` - if (jsonObj.get("product") != null && !jsonObj.get("product").isJsonNull()) { - ProductModel.validateJsonElement(jsonObj.get("product")); - } - if ((jsonObj.get("environmentId") != null && !jsonObj.get("environmentId").isJsonNull()) && !jsonObj.get("environmentId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `environmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentId").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("color") != null && !jsonObj.get("color").isJsonNull()) && !jsonObj.get("color").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EnvironmentModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EnvironmentModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EnvironmentModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EnvironmentModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public EnvironmentModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - EnvironmentModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EnvironmentModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of EnvironmentModel - * @throws IOException if the JSON string is invalid with respect to EnvironmentModel - */ - public static EnvironmentModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EnvironmentModel.class); - } - - /** - * Convert an instance of EnvironmentModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/EvaluationVersion.java b/src/main/java/com/configcat/publicapi/java/client/model/EvaluationVersion.java deleted file mode 100644 index 856d51d..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/EvaluationVersion.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Determines the evaluation version of a Config. Using `v2` enables the new features of Config V2 (https://configcat.com/docs/advanced/config-v2). - */ -@JsonAdapter(EvaluationVersion.Adapter.class) -public enum EvaluationVersion { - - V1("v1"), - - V2("v2"); - - private String value; - - EvaluationVersion(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static EvaluationVersion fromValue(String value) { - for (EvaluationVersion b : EvaluationVersion.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final EvaluationVersion enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public EvaluationVersion read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return EvaluationVersion.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - EvaluationVersion.fromValue(value); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/FeatureFlagLimitations.java b/src/main/java/com/configcat/publicapi/java/client/model/FeatureFlagLimitations.java deleted file mode 100644 index e28ba4f..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/FeatureFlagLimitations.java +++ /dev/null @@ -1,440 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * Subscription limitations regarding Feature flag or Setting values and targeting. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class FeatureFlagLimitations { - public static final String SERIALIZED_NAME_MAX_PERCENTAGE_OPTION_COUNT = "maxPercentageOptionCount"; - @SerializedName(SERIALIZED_NAME_MAX_PERCENTAGE_OPTION_COUNT) - private Integer maxPercentageOptionCount; - - public static final String SERIALIZED_NAME_MAX_TARGETING_RULE_COUNT = "maxTargetingRuleCount"; - @SerializedName(SERIALIZED_NAME_MAX_TARGETING_RULE_COUNT) - private Integer maxTargetingRuleCount; - - public static final String SERIALIZED_NAME_MAX_COMPARISON_VALUE_LENGTH = "maxComparisonValueLength"; - @SerializedName(SERIALIZED_NAME_MAX_COMPARISON_VALUE_LENGTH) - private Integer maxComparisonValueLength; - - public static final String SERIALIZED_NAME_MAX_COMPARISON_VALUE_LIST_LENGTH = "maxComparisonValueListLength"; - @SerializedName(SERIALIZED_NAME_MAX_COMPARISON_VALUE_LIST_LENGTH) - private Integer maxComparisonValueListLength; - - public static final String SERIALIZED_NAME_MAX_COMPARISON_VALUE_LIST_ITEM_LENGTH = "maxComparisonValueListItemLength"; - @SerializedName(SERIALIZED_NAME_MAX_COMPARISON_VALUE_LIST_ITEM_LENGTH) - private Integer maxComparisonValueListItemLength; - - public static final String SERIALIZED_NAME_MAX_STRING_FLAG_VALUE_LENGTH = "maxStringFlagValueLength"; - @SerializedName(SERIALIZED_NAME_MAX_STRING_FLAG_VALUE_LENGTH) - private Integer maxStringFlagValueLength; - - public static final String SERIALIZED_NAME_MAX_CONDITION_PER_TARGETING_RULE_COUNT = "maxConditionPerTargetingRuleCount"; - @SerializedName(SERIALIZED_NAME_MAX_CONDITION_PER_TARGETING_RULE_COUNT) - private Integer maxConditionPerTargetingRuleCount; - - public FeatureFlagLimitations() { - } - - public FeatureFlagLimitations maxPercentageOptionCount(Integer maxPercentageOptionCount) { - this.maxPercentageOptionCount = maxPercentageOptionCount; - return this; - } - - /** - * Maximum number of percentage options a Feature Flag or Setting can have within a targeting rule. - * @return maxPercentageOptionCount - */ - @javax.annotation.Nullable - public Integer getMaxPercentageOptionCount() { - return maxPercentageOptionCount; - } - - public void setMaxPercentageOptionCount(Integer maxPercentageOptionCount) { - this.maxPercentageOptionCount = maxPercentageOptionCount; - } - - - public FeatureFlagLimitations maxTargetingRuleCount(Integer maxTargetingRuleCount) { - this.maxTargetingRuleCount = maxTargetingRuleCount; - return this; - } - - /** - * Maximum number of targeting rules a Feature Flag or Setting can have. - * @return maxTargetingRuleCount - */ - @javax.annotation.Nullable - public Integer getMaxTargetingRuleCount() { - return maxTargetingRuleCount; - } - - public void setMaxTargetingRuleCount(Integer maxTargetingRuleCount) { - this.maxTargetingRuleCount = maxTargetingRuleCount; - } - - - public FeatureFlagLimitations maxComparisonValueLength(Integer maxComparisonValueLength) { - this.maxComparisonValueLength = maxComparisonValueLength; - return this; - } - - /** - * Maximum length of a text comparison value. - * @return maxComparisonValueLength - */ - @javax.annotation.Nullable - public Integer getMaxComparisonValueLength() { - return maxComparisonValueLength; - } - - public void setMaxComparisonValueLength(Integer maxComparisonValueLength) { - this.maxComparisonValueLength = maxComparisonValueLength; - } - - - public FeatureFlagLimitations maxComparisonValueListLength(Integer maxComparisonValueListLength) { - this.maxComparisonValueListLength = maxComparisonValueListLength; - return this; - } - - /** - * Maximum item count of a list comparison value. - * @return maxComparisonValueListLength - */ - @javax.annotation.Nullable - public Integer getMaxComparisonValueListLength() { - return maxComparisonValueListLength; - } - - public void setMaxComparisonValueListLength(Integer maxComparisonValueListLength) { - this.maxComparisonValueListLength = maxComparisonValueListLength; - } - - - public FeatureFlagLimitations maxComparisonValueListItemLength(Integer maxComparisonValueListItemLength) { - this.maxComparisonValueListItemLength = maxComparisonValueListItemLength; - return this; - } - - /** - * Maximum length of a list comparison value's item. - * @return maxComparisonValueListItemLength - */ - @javax.annotation.Nullable - public Integer getMaxComparisonValueListItemLength() { - return maxComparisonValueListItemLength; - } - - public void setMaxComparisonValueListItemLength(Integer maxComparisonValueListItemLength) { - this.maxComparisonValueListItemLength = maxComparisonValueListItemLength; - } - - - public FeatureFlagLimitations maxStringFlagValueLength(Integer maxStringFlagValueLength) { - this.maxStringFlagValueLength = maxStringFlagValueLength; - return this; - } - - /** - * Maximum length of a text Setting's value. - * @return maxStringFlagValueLength - */ - @javax.annotation.Nullable - public Integer getMaxStringFlagValueLength() { - return maxStringFlagValueLength; - } - - public void setMaxStringFlagValueLength(Integer maxStringFlagValueLength) { - this.maxStringFlagValueLength = maxStringFlagValueLength; - } - - - public FeatureFlagLimitations maxConditionPerTargetingRuleCount(Integer maxConditionPerTargetingRuleCount) { - this.maxConditionPerTargetingRuleCount = maxConditionPerTargetingRuleCount; - return this; - } - - /** - * Maximum number of `AND` conditions a Feature Flag or Setting can have within a targeting rule. - * @return maxConditionPerTargetingRuleCount - */ - @javax.annotation.Nullable - public Integer getMaxConditionPerTargetingRuleCount() { - return maxConditionPerTargetingRuleCount; - } - - public void setMaxConditionPerTargetingRuleCount(Integer maxConditionPerTargetingRuleCount) { - this.maxConditionPerTargetingRuleCount = maxConditionPerTargetingRuleCount; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the FeatureFlagLimitations instance itself - */ - public FeatureFlagLimitations putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FeatureFlagLimitations featureFlagLimitations = (FeatureFlagLimitations) o; - return Objects.equals(this.maxPercentageOptionCount, featureFlagLimitations.maxPercentageOptionCount) && - Objects.equals(this.maxTargetingRuleCount, featureFlagLimitations.maxTargetingRuleCount) && - Objects.equals(this.maxComparisonValueLength, featureFlagLimitations.maxComparisonValueLength) && - Objects.equals(this.maxComparisonValueListLength, featureFlagLimitations.maxComparisonValueListLength) && - Objects.equals(this.maxComparisonValueListItemLength, featureFlagLimitations.maxComparisonValueListItemLength) && - Objects.equals(this.maxStringFlagValueLength, featureFlagLimitations.maxStringFlagValueLength) && - Objects.equals(this.maxConditionPerTargetingRuleCount, featureFlagLimitations.maxConditionPerTargetingRuleCount)&& - Objects.equals(this.additionalProperties, featureFlagLimitations.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(maxPercentageOptionCount, maxTargetingRuleCount, maxComparisonValueLength, maxComparisonValueListLength, maxComparisonValueListItemLength, maxStringFlagValueLength, maxConditionPerTargetingRuleCount, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FeatureFlagLimitations {\n"); - sb.append(" maxPercentageOptionCount: ").append(toIndentedString(maxPercentageOptionCount)).append("\n"); - sb.append(" maxTargetingRuleCount: ").append(toIndentedString(maxTargetingRuleCount)).append("\n"); - sb.append(" maxComparisonValueLength: ").append(toIndentedString(maxComparisonValueLength)).append("\n"); - sb.append(" maxComparisonValueListLength: ").append(toIndentedString(maxComparisonValueListLength)).append("\n"); - sb.append(" maxComparisonValueListItemLength: ").append(toIndentedString(maxComparisonValueListItemLength)).append("\n"); - sb.append(" maxStringFlagValueLength: ").append(toIndentedString(maxStringFlagValueLength)).append("\n"); - sb.append(" maxConditionPerTargetingRuleCount: ").append(toIndentedString(maxConditionPerTargetingRuleCount)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("maxPercentageOptionCount"); - openapiFields.add("maxTargetingRuleCount"); - openapiFields.add("maxComparisonValueLength"); - openapiFields.add("maxComparisonValueListLength"); - openapiFields.add("maxComparisonValueListItemLength"); - openapiFields.add("maxStringFlagValueLength"); - openapiFields.add("maxConditionPerTargetingRuleCount"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to FeatureFlagLimitations - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FeatureFlagLimitations.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in FeatureFlagLimitations is not found in the empty JSON string", FeatureFlagLimitations.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FeatureFlagLimitations.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FeatureFlagLimitations' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FeatureFlagLimitations.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FeatureFlagLimitations value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public FeatureFlagLimitations read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FeatureFlagLimitations instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FeatureFlagLimitations given an JSON string - * - * @param jsonString JSON string - * @return An instance of FeatureFlagLimitations - * @throws IOException if the JSON string is invalid with respect to FeatureFlagLimitations - */ - public static FeatureFlagLimitations fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FeatureFlagLimitations.class); - } - - /** - * Convert an instance of FeatureFlagLimitations to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/FlagReference.java b/src/main/java/com/configcat/publicapi/java/client/model/FlagReference.java deleted file mode 100644 index 71c946e..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/FlagReference.java +++ /dev/null @@ -1,340 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.ReferenceLines; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * FlagReference - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class FlagReference { - public static final String SERIALIZED_NAME_SETTING_ID = "settingId"; - @SerializedName(SERIALIZED_NAME_SETTING_ID) - private Integer settingId; - - public static final String SERIALIZED_NAME_REFERENCES = "references"; - @SerializedName(SERIALIZED_NAME_REFERENCES) - private List references = new ArrayList<>(); - - public FlagReference() { - } - - public FlagReference settingId(Integer settingId) { - this.settingId = settingId; - return this; - } - - /** - * The identifier of the Feature Flag or Setting the code reference belongs to. - * @return settingId - */ - @javax.annotation.Nonnull - public Integer getSettingId() { - return settingId; - } - - public void setSettingId(Integer settingId) { - this.settingId = settingId; - } - - - public FlagReference references(List references) { - this.references = references; - return this; - } - - public FlagReference addReferencesItem(ReferenceLines referencesItem) { - if (this.references == null) { - this.references = new ArrayList<>(); - } - this.references.add(referencesItem); - return this; - } - - /** - * The actual references to the given Feature Flag or Setting. - * @return references - */ - @javax.annotation.Nonnull - public List getReferences() { - return references; - } - - public void setReferences(List references) { - this.references = references; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the FlagReference instance itself - */ - public FlagReference putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FlagReference flagReference = (FlagReference) o; - return Objects.equals(this.settingId, flagReference.settingId) && - Objects.equals(this.references, flagReference.references)&& - Objects.equals(this.additionalProperties, flagReference.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(settingId, references, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FlagReference {\n"); - sb.append(" settingId: ").append(toIndentedString(settingId)).append("\n"); - sb.append(" references: ").append(toIndentedString(references)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("settingId"); - openapiFields.add("references"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("settingId"); - openapiRequiredFields.add("references"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to FlagReference - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FlagReference.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in FlagReference is not found in the empty JSON string", FlagReference.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FlagReference.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("references").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `references` to be an array in the JSON string but got `%s`", jsonObj.get("references").toString())); - } - - JsonArray jsonArrayreferences = jsonObj.getAsJsonArray("references"); - // validate the required field `references` (array) - for (int i = 0; i < jsonArrayreferences.size(); i++) { - ReferenceLines.validateJsonElement(jsonArrayreferences.get(i)); - }; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FlagReference.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FlagReference' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FlagReference.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FlagReference value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public FlagReference read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FlagReference instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FlagReference given an JSON string - * - * @param jsonString JSON string - * @return An instance of FlagReference - * @throws IOException if the JSON string is invalid with respect to FlagReference - */ - public static FlagReference fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FlagReference.class); - } - - /** - * Convert an instance of FlagReference to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/InitialValue.java b/src/main/java/com/configcat/publicapi/java/client/model/InitialValue.java deleted file mode 100644 index b11af2a..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/InitialValue.java +++ /dev/null @@ -1,326 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * InitialValue - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class InitialValue { - public static final String SERIALIZED_NAME_ENVIRONMENT_ID = "environmentId"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) - private UUID environmentId; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private Object value = null; - - public InitialValue() { - } - - public InitialValue environmentId(UUID environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * The ID of the Environment where the initial value must be set. - * @return environmentId - */ - @javax.annotation.Nullable - public UUID getEnvironmentId() { - return environmentId; - } - - public void setEnvironmentId(UUID environmentId) { - this.environmentId = environmentId; - } - - - public InitialValue value(Object value) { - this.value = value; - return this; - } - - /** - * The initial value in the given Environment. It must respect the setting type. - * @return value - */ - @javax.annotation.Nullable - public Object getValue() { - return value; - } - - public void setValue(Object value) { - this.value = value; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the InitialValue instance itself - */ - public InitialValue putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - InitialValue initialValue = (InitialValue) o; - return Objects.equals(this.environmentId, initialValue.environmentId) && - Objects.equals(this.value, initialValue.value)&& - Objects.equals(this.additionalProperties, initialValue.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(environmentId, value, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class InitialValue {\n"); - sb.append(" environmentId: ").append(toIndentedString(environmentId)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("environmentId"); - openapiFields.add("value"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to InitialValue - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!InitialValue.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in InitialValue is not found in the empty JSON string", InitialValue.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("environmentId") != null && !jsonObj.get("environmentId").isJsonNull()) && !jsonObj.get("environmentId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `environmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!InitialValue.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'InitialValue' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(InitialValue.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, InitialValue value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public InitialValue read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - InitialValue instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of InitialValue given an JSON string - * - * @param jsonString JSON string - * @return An instance of InitialValue - * @throws IOException if the JSON string is invalid with respect to InitialValue - */ - public static InitialValue fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, InitialValue.class); - } - - /** - * Convert an instance of InitialValue to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetail.java b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetail.java deleted file mode 100644 index 6deca96..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetail.java +++ /dev/null @@ -1,449 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.ConfigModel; -import com.configcat.publicapi.java.client.model.EnvironmentModel; -import com.configcat.publicapi.java.client.model.ProductModel; -import com.configcat.publicapi.java.client.model.SettingDataModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * IntegrationLinkDetail - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class IntegrationLinkDetail { - public static final String SERIALIZED_NAME_PRODUCT = "product"; - @SerializedName(SERIALIZED_NAME_PRODUCT) - private ProductModel product; - - public static final String SERIALIZED_NAME_CONFIG = "config"; - @SerializedName(SERIALIZED_NAME_CONFIG) - private ConfigModel config; - - public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT) - private EnvironmentModel environment; - - public static final String SERIALIZED_NAME_SETTING = "setting"; - @SerializedName(SERIALIZED_NAME_SETTING) - private SettingDataModel setting; - - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private String status; - - public IntegrationLinkDetail() { - } - - public IntegrationLinkDetail product(ProductModel product) { - this.product = product; - return this; - } - - /** - * Get product - * @return product - */ - @javax.annotation.Nullable - public ProductModel getProduct() { - return product; - } - - public void setProduct(ProductModel product) { - this.product = product; - } - - - public IntegrationLinkDetail config(ConfigModel config) { - this.config = config; - return this; - } - - /** - * Get config - * @return config - */ - @javax.annotation.Nullable - public ConfigModel getConfig() { - return config; - } - - public void setConfig(ConfigModel config) { - this.config = config; - } - - - public IntegrationLinkDetail environment(EnvironmentModel environment) { - this.environment = environment; - return this; - } - - /** - * Get environment - * @return environment - */ - @javax.annotation.Nullable - public EnvironmentModel getEnvironment() { - return environment; - } - - public void setEnvironment(EnvironmentModel environment) { - this.environment = environment; - } - - - public IntegrationLinkDetail setting(SettingDataModel setting) { - this.setting = setting; - return this; - } - - /** - * Get setting - * @return setting - */ - @javax.annotation.Nullable - public SettingDataModel getSetting() { - return setting; - } - - public void setSetting(SettingDataModel setting) { - this.setting = setting; - } - - - public IntegrationLinkDetail readOnly(Boolean readOnly) { - this.readOnly = readOnly; - return this; - } - - /** - * Get readOnly - * @return readOnly - */ - @javax.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - - public IntegrationLinkDetail status(String status) { - this.status = status; - return this; - } - - /** - * Get status - * @return status - */ - @javax.annotation.Nullable - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the IntegrationLinkDetail instance itself - */ - public IntegrationLinkDetail putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IntegrationLinkDetail integrationLinkDetail = (IntegrationLinkDetail) o; - return Objects.equals(this.product, integrationLinkDetail.product) && - Objects.equals(this.config, integrationLinkDetail.config) && - Objects.equals(this.environment, integrationLinkDetail.environment) && - Objects.equals(this.setting, integrationLinkDetail.setting) && - Objects.equals(this.readOnly, integrationLinkDetail.readOnly) && - Objects.equals(this.status, integrationLinkDetail.status)&& - Objects.equals(this.additionalProperties, integrationLinkDetail.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(product, config, environment, setting, readOnly, status, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IntegrationLinkDetail {\n"); - sb.append(" product: ").append(toIndentedString(product)).append("\n"); - sb.append(" config: ").append(toIndentedString(config)).append("\n"); - sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); - sb.append(" setting: ").append(toIndentedString(setting)).append("\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("product"); - openapiFields.add("config"); - openapiFields.add("environment"); - openapiFields.add("setting"); - openapiFields.add("readOnly"); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to IntegrationLinkDetail - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!IntegrationLinkDetail.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in IntegrationLinkDetail is not found in the empty JSON string", IntegrationLinkDetail.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `product` - if (jsonObj.get("product") != null && !jsonObj.get("product").isJsonNull()) { - ProductModel.validateJsonElement(jsonObj.get("product")); - } - // validate the optional field `config` - if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { - ConfigModel.validateJsonElement(jsonObj.get("config")); - } - // validate the optional field `environment` - if (jsonObj.get("environment") != null && !jsonObj.get("environment").isJsonNull()) { - EnvironmentModel.validateJsonElement(jsonObj.get("environment")); - } - // validate the optional field `setting` - if (jsonObj.get("setting") != null && !jsonObj.get("setting").isJsonNull()) { - SettingDataModel.validateJsonElement(jsonObj.get("setting")); - } - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IntegrationLinkDetail.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IntegrationLinkDetail' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(IntegrationLinkDetail.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, IntegrationLinkDetail value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public IntegrationLinkDetail read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - IntegrationLinkDetail instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of IntegrationLinkDetail given an JSON string - * - * @param jsonString JSON string - * @return An instance of IntegrationLinkDetail - * @throws IOException if the JSON string is invalid with respect to IntegrationLinkDetail - */ - public static IntegrationLinkDetail fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, IntegrationLinkDetail.class); - } - - /** - * Convert an instance of IntegrationLinkDetail to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetailsModel.java b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetailsModel.java deleted file mode 100644 index 6f5d2fa..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetailsModel.java +++ /dev/null @@ -1,338 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.IntegrationLinkDetail; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * IntegrationLinkDetailsModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class IntegrationLinkDetailsModel { - public static final String SERIALIZED_NAME_DETAILS = "details"; - @SerializedName(SERIALIZED_NAME_DETAILS) - private List details; - - public static final String SERIALIZED_NAME_ALL_INTEGRATION_LINK_COUNT = "allIntegrationLinkCount"; - @SerializedName(SERIALIZED_NAME_ALL_INTEGRATION_LINK_COUNT) - private Integer allIntegrationLinkCount; - - public IntegrationLinkDetailsModel() { - } - - public IntegrationLinkDetailsModel( - List details - ) { - this(); - this.details = details; - } - - /** - * Get details - * @return details - */ - @javax.annotation.Nullable - public List getDetails() { - return details; - } - - - - public IntegrationLinkDetailsModel allIntegrationLinkCount(Integer allIntegrationLinkCount) { - this.allIntegrationLinkCount = allIntegrationLinkCount; - return this; - } - - /** - * Get allIntegrationLinkCount - * @return allIntegrationLinkCount - */ - @javax.annotation.Nullable - public Integer getAllIntegrationLinkCount() { - return allIntegrationLinkCount; - } - - public void setAllIntegrationLinkCount(Integer allIntegrationLinkCount) { - this.allIntegrationLinkCount = allIntegrationLinkCount; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the IntegrationLinkDetailsModel instance itself - */ - public IntegrationLinkDetailsModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IntegrationLinkDetailsModel integrationLinkDetailsModel = (IntegrationLinkDetailsModel) o; - return Objects.equals(this.details, integrationLinkDetailsModel.details) && - Objects.equals(this.allIntegrationLinkCount, integrationLinkDetailsModel.allIntegrationLinkCount)&& - Objects.equals(this.additionalProperties, integrationLinkDetailsModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(details, allIntegrationLinkCount, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IntegrationLinkDetailsModel {\n"); - sb.append(" details: ").append(toIndentedString(details)).append("\n"); - sb.append(" allIntegrationLinkCount: ").append(toIndentedString(allIntegrationLinkCount)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("details"); - openapiFields.add("allIntegrationLinkCount"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to IntegrationLinkDetailsModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!IntegrationLinkDetailsModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in IntegrationLinkDetailsModel is not found in the empty JSON string", IntegrationLinkDetailsModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("details") != null && !jsonObj.get("details").isJsonNull()) { - JsonArray jsonArraydetails = jsonObj.getAsJsonArray("details"); - if (jsonArraydetails != null) { - // ensure the json data is an array - if (!jsonObj.get("details").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `details` to be an array in the JSON string but got `%s`", jsonObj.get("details").toString())); - } - - // validate the optional field `details` (array) - for (int i = 0; i < jsonArraydetails.size(); i++) { - IntegrationLinkDetail.validateJsonElement(jsonArraydetails.get(i)); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IntegrationLinkDetailsModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IntegrationLinkDetailsModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(IntegrationLinkDetailsModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, IntegrationLinkDetailsModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public IntegrationLinkDetailsModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - IntegrationLinkDetailsModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of IntegrationLinkDetailsModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of IntegrationLinkDetailsModel - * @throws IOException if the JSON string is invalid with respect to IntegrationLinkDetailsModel - */ - public static IntegrationLinkDetailsModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, IntegrationLinkDetailsModel.class); - } - - /** - * Convert an instance of IntegrationLinkDetailsModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkModel.java b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkModel.java deleted file mode 100644 index acd8456..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkModel.java +++ /dev/null @@ -1,388 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.IntegrationLinkType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * IntegrationLinkModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class IntegrationLinkModel { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_INTEGRATION_LINK_TYPE = "integrationLinkType"; - @SerializedName(SERIALIZED_NAME_INTEGRATION_LINK_TYPE) - private IntegrationLinkType integrationLinkType; - - public static final String SERIALIZED_NAME_URL = "url"; - @SerializedName(SERIALIZED_NAME_URL) - private String url; - - public IntegrationLinkModel() { - } - - public IntegrationLinkModel key(String key) { - this.key = key; - return this; - } - - /** - * Get key - * @return key - */ - @javax.annotation.Nullable - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - - public IntegrationLinkModel description(String description) { - this.description = description; - return this; - } - - /** - * Get description - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - - public IntegrationLinkModel integrationLinkType(IntegrationLinkType integrationLinkType) { - this.integrationLinkType = integrationLinkType; - return this; - } - - /** - * Get integrationLinkType - * @return integrationLinkType - */ - @javax.annotation.Nullable - public IntegrationLinkType getIntegrationLinkType() { - return integrationLinkType; - } - - public void setIntegrationLinkType(IntegrationLinkType integrationLinkType) { - this.integrationLinkType = integrationLinkType; - } - - - public IntegrationLinkModel url(String url) { - this.url = url; - return this; - } - - /** - * Get url - * @return url - */ - @javax.annotation.Nullable - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the IntegrationLinkModel instance itself - */ - public IntegrationLinkModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IntegrationLinkModel integrationLinkModel = (IntegrationLinkModel) o; - return Objects.equals(this.key, integrationLinkModel.key) && - Objects.equals(this.description, integrationLinkModel.description) && - Objects.equals(this.integrationLinkType, integrationLinkModel.integrationLinkType) && - Objects.equals(this.url, integrationLinkModel.url)&& - Objects.equals(this.additionalProperties, integrationLinkModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(key, description, integrationLinkType, url, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IntegrationLinkModel {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" integrationLinkType: ").append(toIndentedString(integrationLinkType)).append("\n"); - sb.append(" url: ").append(toIndentedString(url)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("description"); - openapiFields.add("integrationLinkType"); - openapiFields.add("url"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to IntegrationLinkModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!IntegrationLinkModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in IntegrationLinkModel is not found in the empty JSON string", IntegrationLinkModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("key") != null && !jsonObj.get("key").isJsonNull()) && !jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - // validate the optional field `integrationLinkType` - if (jsonObj.get("integrationLinkType") != null && !jsonObj.get("integrationLinkType").isJsonNull()) { - IntegrationLinkType.validateJsonElement(jsonObj.get("integrationLinkType")); - } - if ((jsonObj.get("url") != null && !jsonObj.get("url").isJsonNull()) && !jsonObj.get("url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IntegrationLinkModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IntegrationLinkModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(IntegrationLinkModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, IntegrationLinkModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public IntegrationLinkModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - IntegrationLinkModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of IntegrationLinkModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of IntegrationLinkModel - * @throws IOException if the JSON string is invalid with respect to IntegrationLinkModel - */ - public static IntegrationLinkModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, IntegrationLinkModel.class); - } - - /** - * Convert an instance of IntegrationLinkModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkType.java b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkType.java deleted file mode 100644 index e7ab224..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkType.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets IntegrationLinkType - */ -@JsonAdapter(IntegrationLinkType.Adapter.class) -public enum IntegrationLinkType { - - TRELLO("trello"), - - JIRA("jira"), - - MONDAY("monday"); - - private String value; - - IntegrationLinkType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static IntegrationLinkType fromValue(String value) { - for (IntegrationLinkType b : IntegrationLinkType.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final IntegrationLinkType enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public IntegrationLinkType read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return IntegrationLinkType.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - IntegrationLinkType.fromValue(value); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationModel.java b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationModel.java deleted file mode 100644 index 0e6abed..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationModel.java +++ /dev/null @@ -1,505 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.IntegrationType; -import com.configcat.publicapi.java.client.model.ProductModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * Details of the Integration. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class IntegrationModel { - public static final String SERIALIZED_NAME_PRODUCT = "product"; - @SerializedName(SERIALIZED_NAME_PRODUCT) - private ProductModel product; - - public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; - @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) - private UUID integrationId; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_INTEGRATION_TYPE = "integrationType"; - @SerializedName(SERIALIZED_NAME_INTEGRATION_TYPE) - private IntegrationType integrationType; - - public static final String SERIALIZED_NAME_PARAMETERS = "parameters"; - @SerializedName(SERIALIZED_NAME_PARAMETERS) - private Map parameters; - - public static final String SERIALIZED_NAME_ENVIRONMENT_IDS = "environmentIds"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT_IDS) - private List environmentIds; - - public static final String SERIALIZED_NAME_CONFIG_IDS = "configIds"; - @SerializedName(SERIALIZED_NAME_CONFIG_IDS) - private List configIds; - - public IntegrationModel() { - } - - public IntegrationModel product(ProductModel product) { - this.product = product; - return this; - } - - /** - * Get product - * @return product - */ - @javax.annotation.Nullable - public ProductModel getProduct() { - return product; - } - - public void setProduct(ProductModel product) { - this.product = product; - } - - - public IntegrationModel integrationId(UUID integrationId) { - this.integrationId = integrationId; - return this; - } - - /** - * Identifier of the Integration. - * @return integrationId - */ - @javax.annotation.Nullable - public UUID getIntegrationId() { - return integrationId; - } - - public void setIntegrationId(UUID integrationId) { - this.integrationId = integrationId; - } - - - public IntegrationModel name(String name) { - this.name = name; - return this; - } - - /** - * Name of the Integration. - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public IntegrationModel integrationType(IntegrationType integrationType) { - this.integrationType = integrationType; - return this; - } - - /** - * Get integrationType - * @return integrationType - */ - @javax.annotation.Nullable - public IntegrationType getIntegrationType() { - return integrationType; - } - - public void setIntegrationType(IntegrationType integrationType) { - this.integrationType = integrationType; - } - - - public IntegrationModel parameters(Map parameters) { - this.parameters = parameters; - return this; - } - - public IntegrationModel putParametersItem(String key, String parametersItem) { - if (this.parameters == null) { - this.parameters = new HashMap<>(); - } - this.parameters.put(key, parametersItem); - return this; - } - - /** - * Parameters of the Integration. - * @return parameters - */ - @javax.annotation.Nullable - public Map getParameters() { - return parameters; - } - - public void setParameters(Map parameters) { - this.parameters = parameters; - } - - - public IntegrationModel environmentIds(List environmentIds) { - this.environmentIds = environmentIds; - return this; - } - - public IntegrationModel addEnvironmentIdsItem(UUID environmentIdsItem) { - if (this.environmentIds == null) { - this.environmentIds = new ArrayList<>(); - } - this.environmentIds.add(environmentIdsItem); - return this; - } - - /** - * List of Environment IDs that are connected with this Integration. If the list is empty, all of the Environments are connected. - * @return environmentIds - */ - @javax.annotation.Nullable - public List getEnvironmentIds() { - return environmentIds; - } - - public void setEnvironmentIds(List environmentIds) { - this.environmentIds = environmentIds; - } - - - public IntegrationModel configIds(List configIds) { - this.configIds = configIds; - return this; - } - - public IntegrationModel addConfigIdsItem(UUID configIdsItem) { - if (this.configIds == null) { - this.configIds = new ArrayList<>(); - } - this.configIds.add(configIdsItem); - return this; - } - - /** - * List of Config IDs that are connected with this Integration. If the list is empty, all of the Configs are connected. - * @return configIds - */ - @javax.annotation.Nullable - public List getConfigIds() { - return configIds; - } - - public void setConfigIds(List configIds) { - this.configIds = configIds; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the IntegrationModel instance itself - */ - public IntegrationModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IntegrationModel integrationModel = (IntegrationModel) o; - return Objects.equals(this.product, integrationModel.product) && - Objects.equals(this.integrationId, integrationModel.integrationId) && - Objects.equals(this.name, integrationModel.name) && - Objects.equals(this.integrationType, integrationModel.integrationType) && - Objects.equals(this.parameters, integrationModel.parameters) && - Objects.equals(this.environmentIds, integrationModel.environmentIds) && - Objects.equals(this.configIds, integrationModel.configIds)&& - Objects.equals(this.additionalProperties, integrationModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(product, integrationId, name, integrationType, parameters, environmentIds, configIds, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IntegrationModel {\n"); - sb.append(" product: ").append(toIndentedString(product)).append("\n"); - sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" integrationType: ").append(toIndentedString(integrationType)).append("\n"); - sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); - sb.append(" environmentIds: ").append(toIndentedString(environmentIds)).append("\n"); - sb.append(" configIds: ").append(toIndentedString(configIds)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("product"); - openapiFields.add("integrationId"); - openapiFields.add("name"); - openapiFields.add("integrationType"); - openapiFields.add("parameters"); - openapiFields.add("environmentIds"); - openapiFields.add("configIds"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to IntegrationModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!IntegrationModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in IntegrationModel is not found in the empty JSON string", IntegrationModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `product` - if (jsonObj.get("product") != null && !jsonObj.get("product").isJsonNull()) { - ProductModel.validateJsonElement(jsonObj.get("product")); - } - if ((jsonObj.get("integrationId") != null && !jsonObj.get("integrationId").isJsonNull()) && !jsonObj.get("integrationId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `integrationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("integrationId").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - // validate the optional field `integrationType` - if (jsonObj.get("integrationType") != null && !jsonObj.get("integrationType").isJsonNull()) { - IntegrationType.validateJsonElement(jsonObj.get("integrationType")); - } - // ensure the optional json data is an array if present - if (jsonObj.get("environmentIds") != null && !jsonObj.get("environmentIds").isJsonNull() && !jsonObj.get("environmentIds").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `environmentIds` to be an array in the JSON string but got `%s`", jsonObj.get("environmentIds").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("configIds") != null && !jsonObj.get("configIds").isJsonNull() && !jsonObj.get("configIds").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `configIds` to be an array in the JSON string but got `%s`", jsonObj.get("configIds").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IntegrationModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IntegrationModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(IntegrationModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, IntegrationModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public IntegrationModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - IntegrationModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of IntegrationModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of IntegrationModel - * @throws IOException if the JSON string is invalid with respect to IntegrationModel - */ - public static IntegrationModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, IntegrationModel.class); - } - - /** - * Convert an instance of IntegrationModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationType.java b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationType.java deleted file mode 100644 index c4a6e09..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationType.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets IntegrationType - */ -@JsonAdapter(IntegrationType.Adapter.class) -public enum IntegrationType { - - DATA_DOG("dataDog"), - - SLACK("slack"), - - AMPLITUDE("amplitude"), - - MIX_PANEL("mixPanel"), - - SEGMENT("segment"), - - PUB_NUB("pubNub"); - - private String value; - - IntegrationType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static IntegrationType fromValue(String value) { - for (IntegrationType b : IntegrationType.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final IntegrationType enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public IntegrationType read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return IntegrationType.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - IntegrationType.fromValue(value); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationsModel.java b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationsModel.java deleted file mode 100644 index ef1d164..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationsModel.java +++ /dev/null @@ -1,321 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.IntegrationModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * IntegrationsModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class IntegrationsModel { - public static final String SERIALIZED_NAME_INTEGRATIONS = "integrations"; - @SerializedName(SERIALIZED_NAME_INTEGRATIONS) - private List integrations; - - public IntegrationsModel() { - } - - public IntegrationsModel integrations(List integrations) { - this.integrations = integrations; - return this; - } - - public IntegrationsModel addIntegrationsItem(IntegrationModel integrationsItem) { - if (this.integrations == null) { - this.integrations = new ArrayList<>(); - } - this.integrations.add(integrationsItem); - return this; - } - - /** - * The Integrations of the Product. - * @return integrations - */ - @javax.annotation.Nullable - public List getIntegrations() { - return integrations; - } - - public void setIntegrations(List integrations) { - this.integrations = integrations; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the IntegrationsModel instance itself - */ - public IntegrationsModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IntegrationsModel integrationsModel = (IntegrationsModel) o; - return Objects.equals(this.integrations, integrationsModel.integrations)&& - Objects.equals(this.additionalProperties, integrationsModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(integrations, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IntegrationsModel {\n"); - sb.append(" integrations: ").append(toIndentedString(integrations)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("integrations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to IntegrationsModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!IntegrationsModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in IntegrationsModel is not found in the empty JSON string", IntegrationsModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("integrations") != null && !jsonObj.get("integrations").isJsonNull()) { - JsonArray jsonArrayintegrations = jsonObj.getAsJsonArray("integrations"); - if (jsonArrayintegrations != null) { - // ensure the json data is an array - if (!jsonObj.get("integrations").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `integrations` to be an array in the JSON string but got `%s`", jsonObj.get("integrations").toString())); - } - - // validate the optional field `integrations` (array) - for (int i = 0; i < jsonArrayintegrations.size(); i++) { - IntegrationModel.validateJsonElement(jsonArrayintegrations.get(i)); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IntegrationsModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IntegrationsModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(IntegrationsModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, IntegrationsModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public IntegrationsModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - IntegrationsModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of IntegrationsModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of IntegrationsModel - * @throws IOException if the JSON string is invalid with respect to IntegrationsModel - */ - public static IntegrationsModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, IntegrationsModel.class); - } - - /** - * Convert an instance of IntegrationsModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/InvitationModel.java b/src/main/java/com/configcat/publicapi/java/client/model/InvitationModel.java deleted file mode 100644 index 1f30b3d..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/InvitationModel.java +++ /dev/null @@ -1,408 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * InvitationModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class InvitationModel { - public static final String SERIALIZED_NAME_INVITATION_ID = "invitationId"; - @SerializedName(SERIALIZED_NAME_INVITATION_ID) - private UUID invitationId; - - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; - - public static final String SERIALIZED_NAME_PERMISSION_GROUP_ID = "permissionGroupId"; - @SerializedName(SERIALIZED_NAME_PERMISSION_GROUP_ID) - private Long permissionGroupId; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_EXPIRED = "expired"; - @SerializedName(SERIALIZED_NAME_EXPIRED) - private Boolean expired; - - public InvitationModel() { - } - - public InvitationModel invitationId(UUID invitationId) { - this.invitationId = invitationId; - return this; - } - - /** - * The identifier of the Invitation. - * @return invitationId - */ - @javax.annotation.Nullable - public UUID getInvitationId() { - return invitationId; - } - - public void setInvitationId(UUID invitationId) { - this.invitationId = invitationId; - } - - - public InvitationModel email(String email) { - this.email = email; - return this; - } - - /** - * The invited user's email address. - * @return email - */ - @javax.annotation.Nullable - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - - public InvitationModel permissionGroupId(Long permissionGroupId) { - this.permissionGroupId = permissionGroupId; - return this; - } - - /** - * The identifier of the Permission Group the user was invited to. - * @return permissionGroupId - */ - @javax.annotation.Nullable - public Long getPermissionGroupId() { - return permissionGroupId; - } - - public void setPermissionGroupId(Long permissionGroupId) { - this.permissionGroupId = permissionGroupId; - } - - - public InvitationModel createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Creation time of the Invitation. - * @return createdAt - */ - @javax.annotation.Nullable - public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - - public InvitationModel expired(Boolean expired) { - this.expired = expired; - return this; - } - - /** - * Determines whether the Invitation is expired. - * @return expired - */ - @javax.annotation.Nullable - public Boolean getExpired() { - return expired; - } - - public void setExpired(Boolean expired) { - this.expired = expired; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the InvitationModel instance itself - */ - public InvitationModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - InvitationModel invitationModel = (InvitationModel) o; - return Objects.equals(this.invitationId, invitationModel.invitationId) && - Objects.equals(this.email, invitationModel.email) && - Objects.equals(this.permissionGroupId, invitationModel.permissionGroupId) && - Objects.equals(this.createdAt, invitationModel.createdAt) && - Objects.equals(this.expired, invitationModel.expired)&& - Objects.equals(this.additionalProperties, invitationModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(invitationId, email, permissionGroupId, createdAt, expired, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class InvitationModel {\n"); - sb.append(" invitationId: ").append(toIndentedString(invitationId)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" permissionGroupId: ").append(toIndentedString(permissionGroupId)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" expired: ").append(toIndentedString(expired)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("invitationId"); - openapiFields.add("email"); - openapiFields.add("permissionGroupId"); - openapiFields.add("createdAt"); - openapiFields.add("expired"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to InvitationModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!InvitationModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in InvitationModel is not found in the empty JSON string", InvitationModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("invitationId") != null && !jsonObj.get("invitationId").isJsonNull()) && !jsonObj.get("invitationId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `invitationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invitationId").toString())); - } - if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!InvitationModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'InvitationModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(InvitationModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, InvitationModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public InvitationModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - InvitationModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of InvitationModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of InvitationModel - * @throws IOException if the JSON string is invalid with respect to InvitationModel - */ - public static InvitationModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, InvitationModel.class); - } - - /** - * Convert an instance of InvitationModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/InviteMembersRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/InviteMembersRequest.java deleted file mode 100644 index f2529c0..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/InviteMembersRequest.java +++ /dev/null @@ -1,335 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * InviteMembersRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class InviteMembersRequest { - public static final String SERIALIZED_NAME_EMAILS = "emails"; - @SerializedName(SERIALIZED_NAME_EMAILS) - private List emails = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PERMISSION_GROUP_ID = "permissionGroupId"; - @SerializedName(SERIALIZED_NAME_PERMISSION_GROUP_ID) - private Long permissionGroupId; - - public InviteMembersRequest() { - } - - public InviteMembersRequest emails(List emails) { - this.emails = emails; - return this; - } - - public InviteMembersRequest addEmailsItem(String emailsItem) { - if (this.emails == null) { - this.emails = new ArrayList<>(); - } - this.emails.add(emailsItem); - return this; - } - - /** - * List of email addresses to invite. - * @return emails - */ - @javax.annotation.Nonnull - public List getEmails() { - return emails; - } - - public void setEmails(List emails) { - this.emails = emails; - } - - - public InviteMembersRequest permissionGroupId(Long permissionGroupId) { - this.permissionGroupId = permissionGroupId; - return this; - } - - /** - * Identifier of the Permission Group to where the invited users should be added. - * @return permissionGroupId - */ - @javax.annotation.Nonnull - public Long getPermissionGroupId() { - return permissionGroupId; - } - - public void setPermissionGroupId(Long permissionGroupId) { - this.permissionGroupId = permissionGroupId; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the InviteMembersRequest instance itself - */ - public InviteMembersRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - InviteMembersRequest inviteMembersRequest = (InviteMembersRequest) o; - return Objects.equals(this.emails, inviteMembersRequest.emails) && - Objects.equals(this.permissionGroupId, inviteMembersRequest.permissionGroupId)&& - Objects.equals(this.additionalProperties, inviteMembersRequest.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(emails, permissionGroupId, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class InviteMembersRequest {\n"); - sb.append(" emails: ").append(toIndentedString(emails)).append("\n"); - sb.append(" permissionGroupId: ").append(toIndentedString(permissionGroupId)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("emails"); - openapiFields.add("permissionGroupId"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("emails"); - openapiRequiredFields.add("permissionGroupId"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to InviteMembersRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!InviteMembersRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in InviteMembersRequest is not found in the empty JSON string", InviteMembersRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : InviteMembersRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("emails") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("emails").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `emails` to be an array in the JSON string but got `%s`", jsonObj.get("emails").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!InviteMembersRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'InviteMembersRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(InviteMembersRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, InviteMembersRequest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public InviteMembersRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - InviteMembersRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of InviteMembersRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of InviteMembersRequest - * @throws IOException if the JSON string is invalid with respect to InviteMembersRequest - */ - public static InviteMembersRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, InviteMembersRequest.class); - } - - /** - * Convert an instance of InviteMembersRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/JsonPatchOperation.java b/src/main/java/com/configcat/publicapi/java/client/model/JsonPatchOperation.java deleted file mode 100644 index 3b6cbc1..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/JsonPatchOperation.java +++ /dev/null @@ -1,392 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.OperationType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * JsonPatchOperation - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class JsonPatchOperation { - public static final String SERIALIZED_NAME_OP = "op"; - @SerializedName(SERIALIZED_NAME_OP) - private OperationType op; - - public static final String SERIALIZED_NAME_PATH = "path"; - @SerializedName(SERIALIZED_NAME_PATH) - private String path; - - public static final String SERIALIZED_NAME_FROM = "from"; - @SerializedName(SERIALIZED_NAME_FROM) - private String from; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private Object value = null; - - public JsonPatchOperation() { - } - - public JsonPatchOperation op(OperationType op) { - this.op = op; - return this; - } - - /** - * Get op - * @return op - */ - @javax.annotation.Nonnull - public OperationType getOp() { - return op; - } - - public void setOp(OperationType op) { - this.op = op; - } - - - public JsonPatchOperation path(String path) { - this.path = path; - return this; - } - - /** - * The source path. - * @return path - */ - @javax.annotation.Nonnull - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - - public JsonPatchOperation from(String from) { - this.from = from; - return this; - } - - /** - * The target path. - * @return from - */ - @javax.annotation.Nullable - public String getFrom() { - return from; - } - - public void setFrom(String from) { - this.from = from; - } - - - public JsonPatchOperation value(Object value) { - this.value = value; - return this; - } - - /** - * The discrete value. - * @return value - */ - @javax.annotation.Nullable - public Object getValue() { - return value; - } - - public void setValue(Object value) { - this.value = value; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the JsonPatchOperation instance itself - */ - public JsonPatchOperation putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - JsonPatchOperation jsonPatchOperation = (JsonPatchOperation) o; - return Objects.equals(this.op, jsonPatchOperation.op) && - Objects.equals(this.path, jsonPatchOperation.path) && - Objects.equals(this.from, jsonPatchOperation.from) && - Objects.equals(this.value, jsonPatchOperation.value)&& - Objects.equals(this.additionalProperties, jsonPatchOperation.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(op, path, from, value, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class JsonPatchOperation {\n"); - sb.append(" op: ").append(toIndentedString(op)).append("\n"); - sb.append(" path: ").append(toIndentedString(path)).append("\n"); - sb.append(" from: ").append(toIndentedString(from)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("op"); - openapiFields.add("path"); - openapiFields.add("from"); - openapiFields.add("value"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("op"); - openapiRequiredFields.add("path"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to JsonPatchOperation - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!JsonPatchOperation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in JsonPatchOperation is not found in the empty JSON string", JsonPatchOperation.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : JsonPatchOperation.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `op` - OperationType.validateJsonElement(jsonObj.get("op")); - if (!jsonObj.get("path").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); - } - if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) && !jsonObj.get("from").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!JsonPatchOperation.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'JsonPatchOperation' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(JsonPatchOperation.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, JsonPatchOperation value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public JsonPatchOperation read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - JsonPatchOperation instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of JsonPatchOperation given an JSON string - * - * @param jsonString JSON string - * @return An instance of JsonPatchOperation - * @throws IOException if the JSON string is invalid with respect to JsonPatchOperation - */ - public static JsonPatchOperation fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, JsonPatchOperation.class); - } - - /** - * Convert an instance of JsonPatchOperation to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/KeyGenerationMode.java b/src/main/java/com/configcat/publicapi/java/client/model/KeyGenerationMode.java deleted file mode 100644 index bbabc69..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/KeyGenerationMode.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Determines the Feature Flag key generation mode. - */ -@JsonAdapter(KeyGenerationMode.Adapter.class) -public enum KeyGenerationMode { - - CAMEL_CASE("camelCase"), - - LOWER_CASE("lowerCase"), - - UPPER_CASE("upperCase"), - - PASCAL_CASE("pascalCase"), - - KEBAB_CASE("kebabCase"); - - private String value; - - KeyGenerationMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static KeyGenerationMode fromValue(String value) { - for (KeyGenerationMode b : KeyGenerationMode.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final KeyGenerationMode enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public KeyGenerationMode read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return KeyGenerationMode.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - KeyGenerationMode.fromValue(value); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/MeModel.java b/src/main/java/com/configcat/publicapi/java/client/model/MeModel.java deleted file mode 100644 index 644f843..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/MeModel.java +++ /dev/null @@ -1,321 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * MeModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class MeModel { - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; - - public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; - @SerializedName(SERIALIZED_NAME_FULL_NAME) - private String fullName; - - public MeModel() { - } - - public MeModel( - String email, - String fullName - ) { - this(); - this.email = email; - this.fullName = fullName; - } - - /** - * Get email - * @return email - */ - @javax.annotation.Nullable - public String getEmail() { - return email; - } - - - - /** - * Get fullName - * @return fullName - */ - @javax.annotation.Nullable - public String getFullName() { - return fullName; - } - - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the MeModel instance itself - */ - public MeModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MeModel meModel = (MeModel) o; - return Objects.equals(this.email, meModel.email) && - Objects.equals(this.fullName, meModel.fullName)&& - Objects.equals(this.additionalProperties, meModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(email, fullName, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MeModel {\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("email"); - openapiFields.add("fullName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to MeModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!MeModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in MeModel is not found in the empty JSON string", MeModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - if ((jsonObj.get("fullName") != null && !jsonObj.get("fullName").isJsonNull()) && !jsonObj.get("fullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!MeModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'MeModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(MeModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, MeModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public MeModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - MeModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of MeModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of MeModel - * @throws IOException if the JSON string is invalid with respect to MeModel - */ - public static MeModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, MeModel.class); - } - - /** - * Convert an instance of MeModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/MemberModel.java b/src/main/java/com/configcat/publicapi/java/client/model/MemberModel.java deleted file mode 100644 index 5e320e0..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/MemberModel.java +++ /dev/null @@ -1,413 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * MemberModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class MemberModel { - public static final String SERIALIZED_NAME_USER_ID = "userId"; - @SerializedName(SERIALIZED_NAME_USER_ID) - private String userId; - - public static final String SERIALIZED_NAME_PRODUCT_ID = "productId"; - @SerializedName(SERIALIZED_NAME_PRODUCT_ID) - private UUID productId; - - public static final String SERIALIZED_NAME_PERMISSION_GROUP_ID = "permissionGroupId"; - @SerializedName(SERIALIZED_NAME_PERMISSION_GROUP_ID) - private Long permissionGroupId; - - public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; - @SerializedName(SERIALIZED_NAME_FULL_NAME) - private String fullName; - - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; - - public MemberModel() { - } - - public MemberModel userId(String userId) { - this.userId = userId; - return this; - } - - /** - * Identifier of the Member. - * @return userId - */ - @javax.annotation.Nullable - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId; - } - - - public MemberModel productId(UUID productId) { - this.productId = productId; - return this; - } - - /** - * Identifier of the Product where the Member has access. - * @return productId - */ - @javax.annotation.Nullable - public UUID getProductId() { - return productId; - } - - public void setProductId(UUID productId) { - this.productId = productId; - } - - - public MemberModel permissionGroupId(Long permissionGroupId) { - this.permissionGroupId = permissionGroupId; - return this; - } - - /** - * Identifier of the Member's Permission Group. - * @return permissionGroupId - */ - @javax.annotation.Nullable - public Long getPermissionGroupId() { - return permissionGroupId; - } - - public void setPermissionGroupId(Long permissionGroupId) { - this.permissionGroupId = permissionGroupId; - } - - - public MemberModel fullName(String fullName) { - this.fullName = fullName; - return this; - } - - /** - * Name of the Member. - * @return fullName - */ - @javax.annotation.Nullable - public String getFullName() { - return fullName; - } - - public void setFullName(String fullName) { - this.fullName = fullName; - } - - - public MemberModel email(String email) { - this.email = email; - return this; - } - - /** - * Email of the Member. - * @return email - */ - @javax.annotation.Nullable - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the MemberModel instance itself - */ - public MemberModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MemberModel memberModel = (MemberModel) o; - return Objects.equals(this.userId, memberModel.userId) && - Objects.equals(this.productId, memberModel.productId) && - Objects.equals(this.permissionGroupId, memberModel.permissionGroupId) && - Objects.equals(this.fullName, memberModel.fullName) && - Objects.equals(this.email, memberModel.email)&& - Objects.equals(this.additionalProperties, memberModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(userId, productId, permissionGroupId, fullName, email, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MemberModel {\n"); - sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); - sb.append(" productId: ").append(toIndentedString(productId)).append("\n"); - sb.append(" permissionGroupId: ").append(toIndentedString(permissionGroupId)).append("\n"); - sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("userId"); - openapiFields.add("productId"); - openapiFields.add("permissionGroupId"); - openapiFields.add("fullName"); - openapiFields.add("email"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to MemberModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!MemberModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in MemberModel is not found in the empty JSON string", MemberModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("userId") != null && !jsonObj.get("userId").isJsonNull()) && !jsonObj.get("userId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString())); - } - if ((jsonObj.get("productId") != null && !jsonObj.get("productId").isJsonNull()) && !jsonObj.get("productId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `productId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productId").toString())); - } - if ((jsonObj.get("fullName") != null && !jsonObj.get("fullName").isJsonNull()) && !jsonObj.get("fullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); - } - if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!MemberModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'MemberModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(MemberModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, MemberModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public MemberModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - MemberModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of MemberModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of MemberModel - * @throws IOException if the JSON string is invalid with respect to MemberModel - */ - public static MemberModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, MemberModel.class); - } - - /** - * Convert an instance of MemberModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ModifyIntegrationRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/ModifyIntegrationRequest.java deleted file mode 100644 index 69ef07d..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/ModifyIntegrationRequest.java +++ /dev/null @@ -1,417 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * ModifyIntegrationRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class ModifyIntegrationRequest { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_PARAMETERS = "parameters"; - @SerializedName(SERIALIZED_NAME_PARAMETERS) - private Map parameters = new HashMap<>(); - - public static final String SERIALIZED_NAME_ENVIRONMENT_IDS = "environmentIds"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT_IDS) - private List environmentIds = new ArrayList<>(); - - public static final String SERIALIZED_NAME_CONFIG_IDS = "configIds"; - @SerializedName(SERIALIZED_NAME_CONFIG_IDS) - private List configIds = new ArrayList<>(); - - public ModifyIntegrationRequest() { - } - - public ModifyIntegrationRequest name(String name) { - this.name = name; - return this; - } - - /** - * Name of the Integration. - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public ModifyIntegrationRequest parameters(Map parameters) { - this.parameters = parameters; - return this; - } - - public ModifyIntegrationRequest putParametersItem(String key, String parametersItem) { - if (this.parameters == null) { - this.parameters = new HashMap<>(); - } - this.parameters.put(key, parametersItem); - return this; - } - - /** - * Parameters of the Integration. - * @return parameters - */ - @javax.annotation.Nonnull - public Map getParameters() { - return parameters; - } - - public void setParameters(Map parameters) { - this.parameters = parameters; - } - - - public ModifyIntegrationRequest environmentIds(List environmentIds) { - this.environmentIds = environmentIds; - return this; - } - - public ModifyIntegrationRequest addEnvironmentIdsItem(UUID environmentIdsItem) { - if (this.environmentIds == null) { - this.environmentIds = new ArrayList<>(); - } - this.environmentIds.add(environmentIdsItem); - return this; - } - - /** - * List of Environment IDs that are connected with this Integration. If the list is empty, all of the Environments are connected. - * @return environmentIds - */ - @javax.annotation.Nonnull - public List getEnvironmentIds() { - return environmentIds; - } - - public void setEnvironmentIds(List environmentIds) { - this.environmentIds = environmentIds; - } - - - public ModifyIntegrationRequest configIds(List configIds) { - this.configIds = configIds; - return this; - } - - public ModifyIntegrationRequest addConfigIdsItem(UUID configIdsItem) { - if (this.configIds == null) { - this.configIds = new ArrayList<>(); - } - this.configIds.add(configIdsItem); - return this; - } - - /** - * List of Config IDs that are connected with this Integration. If the list is empty, all of the Configs are connected. - * @return configIds - */ - @javax.annotation.Nonnull - public List getConfigIds() { - return configIds; - } - - public void setConfigIds(List configIds) { - this.configIds = configIds; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the ModifyIntegrationRequest instance itself - */ - public ModifyIntegrationRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModifyIntegrationRequest modifyIntegrationRequest = (ModifyIntegrationRequest) o; - return Objects.equals(this.name, modifyIntegrationRequest.name) && - Objects.equals(this.parameters, modifyIntegrationRequest.parameters) && - Objects.equals(this.environmentIds, modifyIntegrationRequest.environmentIds) && - Objects.equals(this.configIds, modifyIntegrationRequest.configIds)&& - Objects.equals(this.additionalProperties, modifyIntegrationRequest.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(name, parameters, environmentIds, configIds, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModifyIntegrationRequest {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); - sb.append(" environmentIds: ").append(toIndentedString(environmentIds)).append("\n"); - sb.append(" configIds: ").append(toIndentedString(configIds)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("parameters"); - openapiFields.add("environmentIds"); - openapiFields.add("configIds"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("parameters"); - openapiRequiredFields.add("environmentIds"); - openapiRequiredFields.add("configIds"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ModifyIntegrationRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ModifyIntegrationRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ModifyIntegrationRequest is not found in the empty JSON string", ModifyIntegrationRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ModifyIntegrationRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - // ensure the required json array is present - if (jsonObj.get("environmentIds") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("environmentIds").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `environmentIds` to be an array in the JSON string but got `%s`", jsonObj.get("environmentIds").toString())); - } - // ensure the required json array is present - if (jsonObj.get("configIds") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("configIds").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `configIds` to be an array in the JSON string but got `%s`", jsonObj.get("configIds").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ModifyIntegrationRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ModifyIntegrationRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ModifyIntegrationRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ModifyIntegrationRequest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public ModifyIntegrationRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ModifyIntegrationRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ModifyIntegrationRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of ModifyIntegrationRequest - * @throws IOException if the JSON string is invalid with respect to ModifyIntegrationRequest - */ - public static ModifyIntegrationRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ModifyIntegrationRequest.class); - } - - /** - * Convert an instance of ModifyIntegrationRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/OperationType.java b/src/main/java/com/configcat/publicapi/java/client/model/OperationType.java deleted file mode 100644 index 863d827..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/OperationType.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets OperationType - */ -@JsonAdapter(OperationType.Adapter.class) -public enum OperationType { - - UNKNOWN("unknown"), - - ADD("add"), - - REMOVE("remove"), - - REPLACE("replace"), - - MOVE("move"), - - COPY("copy"), - - TEST("test"); - - private String value; - - OperationType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static OperationType fromValue(String value) { - for (OperationType b : OperationType.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final OperationType enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public OperationType read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return OperationType.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - OperationType.fromValue(value); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationAdminModel.java b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationAdminModel.java deleted file mode 100644 index 96954d7..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationAdminModel.java +++ /dev/null @@ -1,383 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * Describes an Organization Admin. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class OrganizationAdminModel { - public static final String SERIALIZED_NAME_USER_ID = "userId"; - @SerializedName(SERIALIZED_NAME_USER_ID) - private String userId; - - public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; - @SerializedName(SERIALIZED_NAME_FULL_NAME) - private String fullName; - - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; - - public static final String SERIALIZED_NAME_TWO_FACTOR_ENABLED = "twoFactorEnabled"; - @SerializedName(SERIALIZED_NAME_TWO_FACTOR_ENABLED) - private Boolean twoFactorEnabled; - - public OrganizationAdminModel() { - } - - public OrganizationAdminModel userId(String userId) { - this.userId = userId; - return this; - } - - /** - * Identifier of the Organization Admin. - * @return userId - */ - @javax.annotation.Nullable - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId; - } - - - public OrganizationAdminModel fullName(String fullName) { - this.fullName = fullName; - return this; - } - - /** - * Name of the Organization Admin. - * @return fullName - */ - @javax.annotation.Nullable - public String getFullName() { - return fullName; - } - - public void setFullName(String fullName) { - this.fullName = fullName; - } - - - public OrganizationAdminModel email(String email) { - this.email = email; - return this; - } - - /** - * Email of the OrganizationAdmin. - * @return email - */ - @javax.annotation.Nullable - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - - public OrganizationAdminModel twoFactorEnabled(Boolean twoFactorEnabled) { - this.twoFactorEnabled = twoFactorEnabled; - return this; - } - - /** - * Determines whether 2FA is enabled for the Organization Admin. - * @return twoFactorEnabled - */ - @javax.annotation.Nullable - public Boolean getTwoFactorEnabled() { - return twoFactorEnabled; - } - - public void setTwoFactorEnabled(Boolean twoFactorEnabled) { - this.twoFactorEnabled = twoFactorEnabled; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the OrganizationAdminModel instance itself - */ - public OrganizationAdminModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OrganizationAdminModel organizationAdminModel = (OrganizationAdminModel) o; - return Objects.equals(this.userId, organizationAdminModel.userId) && - Objects.equals(this.fullName, organizationAdminModel.fullName) && - Objects.equals(this.email, organizationAdminModel.email) && - Objects.equals(this.twoFactorEnabled, organizationAdminModel.twoFactorEnabled)&& - Objects.equals(this.additionalProperties, organizationAdminModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(userId, fullName, email, twoFactorEnabled, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OrganizationAdminModel {\n"); - sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); - sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" twoFactorEnabled: ").append(toIndentedString(twoFactorEnabled)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("userId"); - openapiFields.add("fullName"); - openapiFields.add("email"); - openapiFields.add("twoFactorEnabled"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to OrganizationAdminModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!OrganizationAdminModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationAdminModel is not found in the empty JSON string", OrganizationAdminModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("userId") != null && !jsonObj.get("userId").isJsonNull()) && !jsonObj.get("userId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString())); - } - if ((jsonObj.get("fullName") != null && !jsonObj.get("fullName").isJsonNull()) && !jsonObj.get("fullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); - } - if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OrganizationAdminModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OrganizationAdminModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(OrganizationAdminModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, OrganizationAdminModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public OrganizationAdminModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - OrganizationAdminModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of OrganizationAdminModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of OrganizationAdminModel - * @throws IOException if the JSON string is invalid with respect to OrganizationAdminModel - */ - public static OrganizationAdminModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, OrganizationAdminModel.class); - } - - /** - * Convert an instance of OrganizationAdminModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationInvitationModel.java b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationInvitationModel.java deleted file mode 100644 index 81065c9..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationInvitationModel.java +++ /dev/null @@ -1,492 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * OrganizationInvitationModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class OrganizationInvitationModel { - public static final String SERIALIZED_NAME_INVITATION_ID = "invitationId"; - @SerializedName(SERIALIZED_NAME_INVITATION_ID) - private UUID invitationId; - - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; - - public static final String SERIALIZED_NAME_PRODUCT_ID = "productId"; - @SerializedName(SERIALIZED_NAME_PRODUCT_ID) - private UUID productId; - - public static final String SERIALIZED_NAME_PRODUCT_NAME = "productName"; - @SerializedName(SERIALIZED_NAME_PRODUCT_NAME) - private String productName; - - public static final String SERIALIZED_NAME_PERMISSION_GROUP_ID = "permissionGroupId"; - @SerializedName(SERIALIZED_NAME_PERMISSION_GROUP_ID) - private Long permissionGroupId; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_EXPIRED = "expired"; - @SerializedName(SERIALIZED_NAME_EXPIRED) - private Boolean expired; - - public static final String SERIALIZED_NAME_EXPIRES = "expires"; - @SerializedName(SERIALIZED_NAME_EXPIRES) - private OffsetDateTime expires; - - public OrganizationInvitationModel() { - } - - public OrganizationInvitationModel invitationId(UUID invitationId) { - this.invitationId = invitationId; - return this; - } - - /** - * The identifier of the Invitation. - * @return invitationId - */ - @javax.annotation.Nullable - public UUID getInvitationId() { - return invitationId; - } - - public void setInvitationId(UUID invitationId) { - this.invitationId = invitationId; - } - - - public OrganizationInvitationModel email(String email) { - this.email = email; - return this; - } - - /** - * The invited user's email address. - * @return email - */ - @javax.annotation.Nullable - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - - public OrganizationInvitationModel productId(UUID productId) { - this.productId = productId; - return this; - } - - /** - * The identifier of the Product the user was invited to. - * @return productId - */ - @javax.annotation.Nullable - public UUID getProductId() { - return productId; - } - - public void setProductId(UUID productId) { - this.productId = productId; - } - - - public OrganizationInvitationModel productName(String productName) { - this.productName = productName; - return this; - } - - /** - * The name of the Product the user was invited to. - * @return productName - */ - @javax.annotation.Nullable - public String getProductName() { - return productName; - } - - public void setProductName(String productName) { - this.productName = productName; - } - - - public OrganizationInvitationModel permissionGroupId(Long permissionGroupId) { - this.permissionGroupId = permissionGroupId; - return this; - } - - /** - * The identifier of the Permission Group the user was invited to. - * @return permissionGroupId - */ - @javax.annotation.Nullable - public Long getPermissionGroupId() { - return permissionGroupId; - } - - public void setPermissionGroupId(Long permissionGroupId) { - this.permissionGroupId = permissionGroupId; - } - - - public OrganizationInvitationModel createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Creation time of the Invitation. - * @return createdAt - */ - @javax.annotation.Nullable - public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - - public OrganizationInvitationModel expired(Boolean expired) { - this.expired = expired; - return this; - } - - /** - * Determines whether the Invitation is expired. - * @return expired - */ - @javax.annotation.Nullable - public Boolean getExpired() { - return expired; - } - - public void setExpired(Boolean expired) { - this.expired = expired; - } - - - public OrganizationInvitationModel expires(OffsetDateTime expires) { - this.expires = expires; - return this; - } - - /** - * Expiration time of the Invitation. - * @return expires - */ - @javax.annotation.Nullable - public OffsetDateTime getExpires() { - return expires; - } - - public void setExpires(OffsetDateTime expires) { - this.expires = expires; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the OrganizationInvitationModel instance itself - */ - public OrganizationInvitationModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OrganizationInvitationModel organizationInvitationModel = (OrganizationInvitationModel) o; - return Objects.equals(this.invitationId, organizationInvitationModel.invitationId) && - Objects.equals(this.email, organizationInvitationModel.email) && - Objects.equals(this.productId, organizationInvitationModel.productId) && - Objects.equals(this.productName, organizationInvitationModel.productName) && - Objects.equals(this.permissionGroupId, organizationInvitationModel.permissionGroupId) && - Objects.equals(this.createdAt, organizationInvitationModel.createdAt) && - Objects.equals(this.expired, organizationInvitationModel.expired) && - Objects.equals(this.expires, organizationInvitationModel.expires)&& - Objects.equals(this.additionalProperties, organizationInvitationModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(invitationId, email, productId, productName, permissionGroupId, createdAt, expired, expires, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OrganizationInvitationModel {\n"); - sb.append(" invitationId: ").append(toIndentedString(invitationId)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" productId: ").append(toIndentedString(productId)).append("\n"); - sb.append(" productName: ").append(toIndentedString(productName)).append("\n"); - sb.append(" permissionGroupId: ").append(toIndentedString(permissionGroupId)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" expired: ").append(toIndentedString(expired)).append("\n"); - sb.append(" expires: ").append(toIndentedString(expires)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("invitationId"); - openapiFields.add("email"); - openapiFields.add("productId"); - openapiFields.add("productName"); - openapiFields.add("permissionGroupId"); - openapiFields.add("createdAt"); - openapiFields.add("expired"); - openapiFields.add("expires"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to OrganizationInvitationModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!OrganizationInvitationModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationInvitationModel is not found in the empty JSON string", OrganizationInvitationModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("invitationId") != null && !jsonObj.get("invitationId").isJsonNull()) && !jsonObj.get("invitationId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `invitationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invitationId").toString())); - } - if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - if ((jsonObj.get("productId") != null && !jsonObj.get("productId").isJsonNull()) && !jsonObj.get("productId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `productId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productId").toString())); - } - if ((jsonObj.get("productName") != null && !jsonObj.get("productName").isJsonNull()) && !jsonObj.get("productName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `productName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OrganizationInvitationModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OrganizationInvitationModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(OrganizationInvitationModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, OrganizationInvitationModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public OrganizationInvitationModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - OrganizationInvitationModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of OrganizationInvitationModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of OrganizationInvitationModel - * @throws IOException if the JSON string is invalid with respect to OrganizationInvitationModel - */ - public static OrganizationInvitationModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, OrganizationInvitationModel.class); - } - - /** - * Convert an instance of OrganizationInvitationModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationMemberModel.java b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationMemberModel.java deleted file mode 100644 index 1ba9ba6..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationMemberModel.java +++ /dev/null @@ -1,434 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.OrganizationPermissionModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * Describes an Organization Member. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class OrganizationMemberModel { - public static final String SERIALIZED_NAME_USER_ID = "userId"; - @SerializedName(SERIALIZED_NAME_USER_ID) - private String userId; - - public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; - @SerializedName(SERIALIZED_NAME_FULL_NAME) - private String fullName; - - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; - - public static final String SERIALIZED_NAME_TWO_FACTOR_ENABLED = "twoFactorEnabled"; - @SerializedName(SERIALIZED_NAME_TWO_FACTOR_ENABLED) - private Boolean twoFactorEnabled; - - public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; - @SerializedName(SERIALIZED_NAME_PERMISSIONS) - private List permissions; - - public OrganizationMemberModel() { - } - - public OrganizationMemberModel userId(String userId) { - this.userId = userId; - return this; - } - - /** - * Identifier of the Organization Admin. - * @return userId - */ - @javax.annotation.Nullable - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId; - } - - - public OrganizationMemberModel fullName(String fullName) { - this.fullName = fullName; - return this; - } - - /** - * Name of the Organization Admin. - * @return fullName - */ - @javax.annotation.Nullable - public String getFullName() { - return fullName; - } - - public void setFullName(String fullName) { - this.fullName = fullName; - } - - - public OrganizationMemberModel email(String email) { - this.email = email; - return this; - } - - /** - * Email of the OrganizationAdmin. - * @return email - */ - @javax.annotation.Nullable - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - - public OrganizationMemberModel twoFactorEnabled(Boolean twoFactorEnabled) { - this.twoFactorEnabled = twoFactorEnabled; - return this; - } - - /** - * Determines whether 2FA is enabled for the Organization Admin. - * @return twoFactorEnabled - */ - @javax.annotation.Nullable - public Boolean getTwoFactorEnabled() { - return twoFactorEnabled; - } - - public void setTwoFactorEnabled(Boolean twoFactorEnabled) { - this.twoFactorEnabled = twoFactorEnabled; - } - - - public OrganizationMemberModel permissions(List permissions) { - this.permissions = permissions; - return this; - } - - public OrganizationMemberModel addPermissionsItem(OrganizationPermissionModel permissionsItem) { - if (this.permissions == null) { - this.permissions = new ArrayList<>(); - } - this.permissions.add(permissionsItem); - return this; - } - - /** - * The permissions of the Member. - * @return permissions - */ - @javax.annotation.Nullable - public List getPermissions() { - return permissions; - } - - public void setPermissions(List permissions) { - this.permissions = permissions; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the OrganizationMemberModel instance itself - */ - public OrganizationMemberModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OrganizationMemberModel organizationMemberModel = (OrganizationMemberModel) o; - return Objects.equals(this.userId, organizationMemberModel.userId) && - Objects.equals(this.fullName, organizationMemberModel.fullName) && - Objects.equals(this.email, organizationMemberModel.email) && - Objects.equals(this.twoFactorEnabled, organizationMemberModel.twoFactorEnabled) && - Objects.equals(this.permissions, organizationMemberModel.permissions)&& - Objects.equals(this.additionalProperties, organizationMemberModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(userId, fullName, email, twoFactorEnabled, permissions, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OrganizationMemberModel {\n"); - sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); - sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" twoFactorEnabled: ").append(toIndentedString(twoFactorEnabled)).append("\n"); - sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("userId"); - openapiFields.add("fullName"); - openapiFields.add("email"); - openapiFields.add("twoFactorEnabled"); - openapiFields.add("permissions"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to OrganizationMemberModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!OrganizationMemberModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationMemberModel is not found in the empty JSON string", OrganizationMemberModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("userId") != null && !jsonObj.get("userId").isJsonNull()) && !jsonObj.get("userId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString())); - } - if ((jsonObj.get("fullName") != null && !jsonObj.get("fullName").isJsonNull()) && !jsonObj.get("fullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); - } - if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - if (jsonObj.get("permissions") != null && !jsonObj.get("permissions").isJsonNull()) { - JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); - if (jsonArraypermissions != null) { - // ensure the json data is an array - if (!jsonObj.get("permissions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `permissions` to be an array in the JSON string but got `%s`", jsonObj.get("permissions").toString())); - } - - // validate the optional field `permissions` (array) - for (int i = 0; i < jsonArraypermissions.size(); i++) { - OrganizationPermissionModel.validateJsonElement(jsonArraypermissions.get(i)); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OrganizationMemberModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OrganizationMemberModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(OrganizationMemberModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, OrganizationMemberModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public OrganizationMemberModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - OrganizationMemberModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of OrganizationMemberModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of OrganizationMemberModel - * @throws IOException if the JSON string is invalid with respect to OrganizationMemberModel - */ - public static OrganizationMemberModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, OrganizationMemberModel.class); - } - - /** - * Convert an instance of OrganizationMemberModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationMembersModel.java b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationMembersModel.java deleted file mode 100644 index c24fa22..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationMembersModel.java +++ /dev/null @@ -1,418 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.OrganizationAdminModel; -import com.configcat.publicapi.java.client.model.OrganizationMemberModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * OrganizationMembersModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class OrganizationMembersModel { - public static final String SERIALIZED_NAME_ADMINS = "admins"; - @SerializedName(SERIALIZED_NAME_ADMINS) - private List admins; - - public static final String SERIALIZED_NAME_BILLING_MANAGERS = "billingManagers"; - @SerializedName(SERIALIZED_NAME_BILLING_MANAGERS) - private List billingManagers; - - public static final String SERIALIZED_NAME_MEMBERS = "members"; - @SerializedName(SERIALIZED_NAME_MEMBERS) - private List members; - - public OrganizationMembersModel() { - } - - public OrganizationMembersModel admins(List admins) { - this.admins = admins; - return this; - } - - public OrganizationMembersModel addAdminsItem(OrganizationAdminModel adminsItem) { - if (this.admins == null) { - this.admins = new ArrayList<>(); - } - this.admins.add(adminsItem); - return this; - } - - /** - * List of Organization Admins. - * @return admins - */ - @javax.annotation.Nullable - public List getAdmins() { - return admins; - } - - public void setAdmins(List admins) { - this.admins = admins; - } - - - public OrganizationMembersModel billingManagers(List billingManagers) { - this.billingManagers = billingManagers; - return this; - } - - public OrganizationMembersModel addBillingManagersItem(OrganizationAdminModel billingManagersItem) { - if (this.billingManagers == null) { - this.billingManagers = new ArrayList<>(); - } - this.billingManagers.add(billingManagersItem); - return this; - } - - /** - * List of Billing Managers. - * @return billingManagers - */ - @javax.annotation.Nullable - public List getBillingManagers() { - return billingManagers; - } - - public void setBillingManagers(List billingManagers) { - this.billingManagers = billingManagers; - } - - - public OrganizationMembersModel members(List members) { - this.members = members; - return this; - } - - public OrganizationMembersModel addMembersItem(OrganizationMemberModel membersItem) { - if (this.members == null) { - this.members = new ArrayList<>(); - } - this.members.add(membersItem); - return this; - } - - /** - * List of Organization Members. - * @return members - */ - @javax.annotation.Nullable - public List getMembers() { - return members; - } - - public void setMembers(List members) { - this.members = members; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the OrganizationMembersModel instance itself - */ - public OrganizationMembersModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OrganizationMembersModel organizationMembersModel = (OrganizationMembersModel) o; - return Objects.equals(this.admins, organizationMembersModel.admins) && - Objects.equals(this.billingManagers, organizationMembersModel.billingManagers) && - Objects.equals(this.members, organizationMembersModel.members)&& - Objects.equals(this.additionalProperties, organizationMembersModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(admins, billingManagers, members, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OrganizationMembersModel {\n"); - sb.append(" admins: ").append(toIndentedString(admins)).append("\n"); - sb.append(" billingManagers: ").append(toIndentedString(billingManagers)).append("\n"); - sb.append(" members: ").append(toIndentedString(members)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("admins"); - openapiFields.add("billingManagers"); - openapiFields.add("members"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to OrganizationMembersModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!OrganizationMembersModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationMembersModel is not found in the empty JSON string", OrganizationMembersModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("admins") != null && !jsonObj.get("admins").isJsonNull()) { - JsonArray jsonArrayadmins = jsonObj.getAsJsonArray("admins"); - if (jsonArrayadmins != null) { - // ensure the json data is an array - if (!jsonObj.get("admins").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `admins` to be an array in the JSON string but got `%s`", jsonObj.get("admins").toString())); - } - - // validate the optional field `admins` (array) - for (int i = 0; i < jsonArrayadmins.size(); i++) { - OrganizationAdminModel.validateJsonElement(jsonArrayadmins.get(i)); - }; - } - } - if (jsonObj.get("billingManagers") != null && !jsonObj.get("billingManagers").isJsonNull()) { - JsonArray jsonArraybillingManagers = jsonObj.getAsJsonArray("billingManagers"); - if (jsonArraybillingManagers != null) { - // ensure the json data is an array - if (!jsonObj.get("billingManagers").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `billingManagers` to be an array in the JSON string but got `%s`", jsonObj.get("billingManagers").toString())); - } - - // validate the optional field `billingManagers` (array) - for (int i = 0; i < jsonArraybillingManagers.size(); i++) { - OrganizationAdminModel.validateJsonElement(jsonArraybillingManagers.get(i)); - }; - } - } - if (jsonObj.get("members") != null && !jsonObj.get("members").isJsonNull()) { - JsonArray jsonArraymembers = jsonObj.getAsJsonArray("members"); - if (jsonArraymembers != null) { - // ensure the json data is an array - if (!jsonObj.get("members").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `members` to be an array in the JSON string but got `%s`", jsonObj.get("members").toString())); - } - - // validate the optional field `members` (array) - for (int i = 0; i < jsonArraymembers.size(); i++) { - OrganizationMemberModel.validateJsonElement(jsonArraymembers.get(i)); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OrganizationMembersModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OrganizationMembersModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(OrganizationMembersModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, OrganizationMembersModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public OrganizationMembersModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - OrganizationMembersModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of OrganizationMembersModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of OrganizationMembersModel - * @throws IOException if the JSON string is invalid with respect to OrganizationMembersModel - */ - public static OrganizationMembersModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, OrganizationMembersModel.class); - } - - /** - * Convert an instance of OrganizationMembersModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationModel.java b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationModel.java deleted file mode 100644 index fd7f38a..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationModel.java +++ /dev/null @@ -1,329 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * Details of the Organization. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class OrganizationModel { - public static final String SERIALIZED_NAME_ORGANIZATION_ID = "organizationId"; - @SerializedName(SERIALIZED_NAME_ORGANIZATION_ID) - private UUID organizationId; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public OrganizationModel() { - } - - public OrganizationModel organizationId(UUID organizationId) { - this.organizationId = organizationId; - return this; - } - - /** - * Identifier of the Organization. - * @return organizationId - */ - @javax.annotation.Nullable - public UUID getOrganizationId() { - return organizationId; - } - - public void setOrganizationId(UUID organizationId) { - this.organizationId = organizationId; - } - - - public OrganizationModel name(String name) { - this.name = name; - return this; - } - - /** - * Name of the Organization. - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the OrganizationModel instance itself - */ - public OrganizationModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OrganizationModel organizationModel = (OrganizationModel) o; - return Objects.equals(this.organizationId, organizationModel.organizationId) && - Objects.equals(this.name, organizationModel.name)&& - Objects.equals(this.additionalProperties, organizationModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(organizationId, name, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OrganizationModel {\n"); - sb.append(" organizationId: ").append(toIndentedString(organizationId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("organizationId"); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to OrganizationModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!OrganizationModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationModel is not found in the empty JSON string", OrganizationModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("organizationId") != null && !jsonObj.get("organizationId").isJsonNull()) && !jsonObj.get("organizationId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `organizationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("organizationId").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OrganizationModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OrganizationModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(OrganizationModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, OrganizationModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public OrganizationModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - OrganizationModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of OrganizationModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of OrganizationModel - * @throws IOException if the JSON string is invalid with respect to OrganizationModel - */ - public static OrganizationModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, OrganizationModel.class); - } - - /** - * Convert an instance of OrganizationModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationPermissionGroupModel.java b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationPermissionGroupModel.java deleted file mode 100644 index 08e98db..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationPermissionGroupModel.java +++ /dev/null @@ -1,325 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * Describes the Member's Permission Group within a Product. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class OrganizationPermissionGroupModel { - public static final String SERIALIZED_NAME_PERMISSION_GROUP_ID = "permissionGroupId"; - @SerializedName(SERIALIZED_NAME_PERMISSION_GROUP_ID) - private Long permissionGroupId; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public OrganizationPermissionGroupModel() { - } - - public OrganizationPermissionGroupModel permissionGroupId(Long permissionGroupId) { - this.permissionGroupId = permissionGroupId; - return this; - } - - /** - * Identifier of the Member's Permission Group. - * @return permissionGroupId - */ - @javax.annotation.Nullable - public Long getPermissionGroupId() { - return permissionGroupId; - } - - public void setPermissionGroupId(Long permissionGroupId) { - this.permissionGroupId = permissionGroupId; - } - - - public OrganizationPermissionGroupModel name(String name) { - this.name = name; - return this; - } - - /** - * Name of the Member's Permission Group. - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the OrganizationPermissionGroupModel instance itself - */ - public OrganizationPermissionGroupModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OrganizationPermissionGroupModel organizationPermissionGroupModel = (OrganizationPermissionGroupModel) o; - return Objects.equals(this.permissionGroupId, organizationPermissionGroupModel.permissionGroupId) && - Objects.equals(this.name, organizationPermissionGroupModel.name)&& - Objects.equals(this.additionalProperties, organizationPermissionGroupModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(permissionGroupId, name, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OrganizationPermissionGroupModel {\n"); - sb.append(" permissionGroupId: ").append(toIndentedString(permissionGroupId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("permissionGroupId"); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to OrganizationPermissionGroupModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!OrganizationPermissionGroupModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationPermissionGroupModel is not found in the empty JSON string", OrganizationPermissionGroupModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OrganizationPermissionGroupModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OrganizationPermissionGroupModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(OrganizationPermissionGroupModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, OrganizationPermissionGroupModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public OrganizationPermissionGroupModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - OrganizationPermissionGroupModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of OrganizationPermissionGroupModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of OrganizationPermissionGroupModel - * @throws IOException if the JSON string is invalid with respect to OrganizationPermissionGroupModel - */ - public static OrganizationPermissionGroupModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, OrganizationPermissionGroupModel.class); - } - - /** - * Convert an instance of OrganizationPermissionGroupModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationPermissionModel.java b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationPermissionModel.java deleted file mode 100644 index f5134bd..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationPermissionModel.java +++ /dev/null @@ -1,320 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.OrganizationPermissionGroupModel; -import com.configcat.publicapi.java.client.model.OrganizationProductModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * Describes the Member's permission. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class OrganizationPermissionModel { - public static final String SERIALIZED_NAME_PRODUCT = "product"; - @SerializedName(SERIALIZED_NAME_PRODUCT) - private OrganizationProductModel product; - - public static final String SERIALIZED_NAME_PERMISSION_GROUP = "permissionGroup"; - @SerializedName(SERIALIZED_NAME_PERMISSION_GROUP) - private OrganizationPermissionGroupModel permissionGroup; - - public OrganizationPermissionModel() { - } - - public OrganizationPermissionModel product(OrganizationProductModel product) { - this.product = product; - return this; - } - - /** - * Get product - * @return product - */ - @javax.annotation.Nullable - public OrganizationProductModel getProduct() { - return product; - } - - public void setProduct(OrganizationProductModel product) { - this.product = product; - } - - - public OrganizationPermissionModel permissionGroup(OrganizationPermissionGroupModel permissionGroup) { - this.permissionGroup = permissionGroup; - return this; - } - - /** - * Get permissionGroup - * @return permissionGroup - */ - @javax.annotation.Nullable - public OrganizationPermissionGroupModel getPermissionGroup() { - return permissionGroup; - } - - public void setPermissionGroup(OrganizationPermissionGroupModel permissionGroup) { - this.permissionGroup = permissionGroup; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the OrganizationPermissionModel instance itself - */ - public OrganizationPermissionModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OrganizationPermissionModel organizationPermissionModel = (OrganizationPermissionModel) o; - return Objects.equals(this.product, organizationPermissionModel.product) && - Objects.equals(this.permissionGroup, organizationPermissionModel.permissionGroup)&& - Objects.equals(this.additionalProperties, organizationPermissionModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(product, permissionGroup, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OrganizationPermissionModel {\n"); - sb.append(" product: ").append(toIndentedString(product)).append("\n"); - sb.append(" permissionGroup: ").append(toIndentedString(permissionGroup)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("product"); - openapiFields.add("permissionGroup"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to OrganizationPermissionModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!OrganizationPermissionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationPermissionModel is not found in the empty JSON string", OrganizationPermissionModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `product` - if (jsonObj.get("product") != null && !jsonObj.get("product").isJsonNull()) { - OrganizationProductModel.validateJsonElement(jsonObj.get("product")); - } - // validate the optional field `permissionGroup` - if (jsonObj.get("permissionGroup") != null && !jsonObj.get("permissionGroup").isJsonNull()) { - OrganizationPermissionGroupModel.validateJsonElement(jsonObj.get("permissionGroup")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OrganizationPermissionModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OrganizationPermissionModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(OrganizationPermissionModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, OrganizationPermissionModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public OrganizationPermissionModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - OrganizationPermissionModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of OrganizationPermissionModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of OrganizationPermissionModel - * @throws IOException if the JSON string is invalid with respect to OrganizationPermissionModel - */ - public static OrganizationPermissionModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, OrganizationPermissionModel.class); - } - - /** - * Convert an instance of OrganizationPermissionModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationProductModel.java b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationProductModel.java deleted file mode 100644 index 71655d1..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationProductModel.java +++ /dev/null @@ -1,329 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * Describes the Member's Product. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class OrganizationProductModel { - public static final String SERIALIZED_NAME_PRODUCT_ID = "productId"; - @SerializedName(SERIALIZED_NAME_PRODUCT_ID) - private UUID productId; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public OrganizationProductModel() { - } - - public OrganizationProductModel productId(UUID productId) { - this.productId = productId; - return this; - } - - /** - * Identifier of the Member's Product. - * @return productId - */ - @javax.annotation.Nullable - public UUID getProductId() { - return productId; - } - - public void setProductId(UUID productId) { - this.productId = productId; - } - - - public OrganizationProductModel name(String name) { - this.name = name; - return this; - } - - /** - * Name of the Member's Product. - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the OrganizationProductModel instance itself - */ - public OrganizationProductModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OrganizationProductModel organizationProductModel = (OrganizationProductModel) o; - return Objects.equals(this.productId, organizationProductModel.productId) && - Objects.equals(this.name, organizationProductModel.name)&& - Objects.equals(this.additionalProperties, organizationProductModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(productId, name, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OrganizationProductModel {\n"); - sb.append(" productId: ").append(toIndentedString(productId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("productId"); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to OrganizationProductModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!OrganizationProductModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationProductModel is not found in the empty JSON string", OrganizationProductModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("productId") != null && !jsonObj.get("productId").isJsonNull()) && !jsonObj.get("productId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `productId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productId").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OrganizationProductModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OrganizationProductModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(OrganizationProductModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, OrganizationProductModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public OrganizationProductModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - OrganizationProductModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of OrganizationProductModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of OrganizationProductModel - * @throws IOException if the JSON string is invalid with respect to OrganizationProductModel - */ - public static OrganizationProductModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, OrganizationProductModel.class); - } - - /** - * Convert an instance of OrganizationProductModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/PercentageOptionModel.java b/src/main/java/com/configcat/publicapi/java/client/model/PercentageOptionModel.java deleted file mode 100644 index ac8af98..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/PercentageOptionModel.java +++ /dev/null @@ -1,322 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.ValueModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * PercentageOptionModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class PercentageOptionModel { - public static final String SERIALIZED_NAME_PERCENTAGE = "percentage"; - @SerializedName(SERIALIZED_NAME_PERCENTAGE) - private Integer percentage; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private ValueModel value; - - public PercentageOptionModel() { - } - - public PercentageOptionModel percentage(Integer percentage) { - this.percentage = percentage; - return this; - } - - /** - * A number between 0 and 100 that represents a randomly allocated fraction of the users. - * @return percentage - */ - @javax.annotation.Nonnull - public Integer getPercentage() { - return percentage; - } - - public void setPercentage(Integer percentage) { - this.percentage = percentage; - } - - - public PercentageOptionModel value(ValueModel value) { - this.value = value; - return this; - } - - /** - * Get value - * @return value - */ - @javax.annotation.Nonnull - public ValueModel getValue() { - return value; - } - - public void setValue(ValueModel value) { - this.value = value; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the PercentageOptionModel instance itself - */ - public PercentageOptionModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PercentageOptionModel percentageOptionModel = (PercentageOptionModel) o; - return Objects.equals(this.percentage, percentageOptionModel.percentage) && - Objects.equals(this.value, percentageOptionModel.value)&& - Objects.equals(this.additionalProperties, percentageOptionModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(percentage, value, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PercentageOptionModel {\n"); - sb.append(" percentage: ").append(toIndentedString(percentage)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("percentage"); - openapiFields.add("value"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("percentage"); - openapiRequiredFields.add("value"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PercentageOptionModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!PercentageOptionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in PercentageOptionModel is not found in the empty JSON string", PercentageOptionModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PercentageOptionModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `value` - ValueModel.validateJsonElement(jsonObj.get("value")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!PercentageOptionModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PercentageOptionModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(PercentageOptionModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, PercentageOptionModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public PercentageOptionModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - PercentageOptionModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of PercentageOptionModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of PercentageOptionModel - * @throws IOException if the JSON string is invalid with respect to PercentageOptionModel - */ - public static PercentageOptionModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PercentageOptionModel.class); - } - - /** - * Convert an instance of PercentageOptionModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/PermissionGroupModel.java b/src/main/java/com/configcat/publicapi/java/client/model/PermissionGroupModel.java deleted file mode 100644 index 12b5589..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/PermissionGroupModel.java +++ /dev/null @@ -1,1015 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.AccessType; -import com.configcat.publicapi.java.client.model.EnvironmentAccessModel; -import com.configcat.publicapi.java.client.model.EnvironmentAccessType; -import com.configcat.publicapi.java.client.model.ProductModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * PermissionGroupModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class PermissionGroupModel { - public static final String SERIALIZED_NAME_PERMISSION_GROUP_ID = "permissionGroupId"; - @SerializedName(SERIALIZED_NAME_PERMISSION_GROUP_ID) - private Long permissionGroupId; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_CAN_MANAGE_MEMBERS = "canManageMembers"; - @SerializedName(SERIALIZED_NAME_CAN_MANAGE_MEMBERS) - private Boolean canManageMembers; - - public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_CONFIG = "canCreateOrUpdateConfig"; - @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_CONFIG) - private Boolean canCreateOrUpdateConfig; - - public static final String SERIALIZED_NAME_CAN_DELETE_CONFIG = "canDeleteConfig"; - @SerializedName(SERIALIZED_NAME_CAN_DELETE_CONFIG) - private Boolean canDeleteConfig; - - public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_ENVIRONMENT = "canCreateOrUpdateEnvironment"; - @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_ENVIRONMENT) - private Boolean canCreateOrUpdateEnvironment; - - public static final String SERIALIZED_NAME_CAN_DELETE_ENVIRONMENT = "canDeleteEnvironment"; - @SerializedName(SERIALIZED_NAME_CAN_DELETE_ENVIRONMENT) - private Boolean canDeleteEnvironment; - - public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SETTING = "canCreateOrUpdateSetting"; - @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SETTING) - private Boolean canCreateOrUpdateSetting; - - public static final String SERIALIZED_NAME_CAN_TAG_SETTING = "canTagSetting"; - @SerializedName(SERIALIZED_NAME_CAN_TAG_SETTING) - private Boolean canTagSetting; - - public static final String SERIALIZED_NAME_CAN_DELETE_SETTING = "canDeleteSetting"; - @SerializedName(SERIALIZED_NAME_CAN_DELETE_SETTING) - private Boolean canDeleteSetting; - - public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_TAG = "canCreateOrUpdateTag"; - @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_TAG) - private Boolean canCreateOrUpdateTag; - - public static final String SERIALIZED_NAME_CAN_DELETE_TAG = "canDeleteTag"; - @SerializedName(SERIALIZED_NAME_CAN_DELETE_TAG) - private Boolean canDeleteTag; - - public static final String SERIALIZED_NAME_CAN_MANAGE_WEBHOOK = "canManageWebhook"; - @SerializedName(SERIALIZED_NAME_CAN_MANAGE_WEBHOOK) - private Boolean canManageWebhook; - - public static final String SERIALIZED_NAME_CAN_USE_EXPORT_IMPORT = "canUseExportImport"; - @SerializedName(SERIALIZED_NAME_CAN_USE_EXPORT_IMPORT) - private Boolean canUseExportImport; - - public static final String SERIALIZED_NAME_CAN_MANAGE_PRODUCT_PREFERENCES = "canManageProductPreferences"; - @SerializedName(SERIALIZED_NAME_CAN_MANAGE_PRODUCT_PREFERENCES) - private Boolean canManageProductPreferences; - - public static final String SERIALIZED_NAME_CAN_MANAGE_INTEGRATIONS = "canManageIntegrations"; - @SerializedName(SERIALIZED_NAME_CAN_MANAGE_INTEGRATIONS) - private Boolean canManageIntegrations; - - public static final String SERIALIZED_NAME_CAN_VIEW_SDK_KEY = "canViewSdkKey"; - @SerializedName(SERIALIZED_NAME_CAN_VIEW_SDK_KEY) - private Boolean canViewSdkKey; - - public static final String SERIALIZED_NAME_CAN_ROTATE_SDK_KEY = "canRotateSdkKey"; - @SerializedName(SERIALIZED_NAME_CAN_ROTATE_SDK_KEY) - private Boolean canRotateSdkKey; - - public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SEGMENTS = "canCreateOrUpdateSegments"; - @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SEGMENTS) - private Boolean canCreateOrUpdateSegments; - - public static final String SERIALIZED_NAME_CAN_DELETE_SEGMENTS = "canDeleteSegments"; - @SerializedName(SERIALIZED_NAME_CAN_DELETE_SEGMENTS) - private Boolean canDeleteSegments; - - public static final String SERIALIZED_NAME_CAN_VIEW_PRODUCT_AUDIT_LOG = "canViewProductAuditLog"; - @SerializedName(SERIALIZED_NAME_CAN_VIEW_PRODUCT_AUDIT_LOG) - private Boolean canViewProductAuditLog; - - public static final String SERIALIZED_NAME_CAN_VIEW_PRODUCT_STATISTICS = "canViewProductStatistics"; - @SerializedName(SERIALIZED_NAME_CAN_VIEW_PRODUCT_STATISTICS) - private Boolean canViewProductStatistics; - - public static final String SERIALIZED_NAME_CAN_DISABLE2_F_A = "canDisable2FA"; - @SerializedName(SERIALIZED_NAME_CAN_DISABLE2_F_A) - private Boolean canDisable2FA; - - public static final String SERIALIZED_NAME_ACCESS_TYPE = "accessType"; - @SerializedName(SERIALIZED_NAME_ACCESS_TYPE) - private AccessType accessType; - - public static final String SERIALIZED_NAME_NEW_ENVIRONMENT_ACCESS_TYPE = "newEnvironmentAccessType"; - @SerializedName(SERIALIZED_NAME_NEW_ENVIRONMENT_ACCESS_TYPE) - private EnvironmentAccessType newEnvironmentAccessType; - - public static final String SERIALIZED_NAME_ENVIRONMENT_ACCESSES = "environmentAccesses"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ACCESSES) - private List environmentAccesses; - - public static final String SERIALIZED_NAME_PRODUCT = "product"; - @SerializedName(SERIALIZED_NAME_PRODUCT) - private ProductModel product; - - public PermissionGroupModel() { - } - - public PermissionGroupModel permissionGroupId(Long permissionGroupId) { - this.permissionGroupId = permissionGroupId; - return this; - } - - /** - * Identifier of the Permission Group. - * @return permissionGroupId - */ - @javax.annotation.Nullable - public Long getPermissionGroupId() { - return permissionGroupId; - } - - public void setPermissionGroupId(Long permissionGroupId) { - this.permissionGroupId = permissionGroupId; - } - - - public PermissionGroupModel name(String name) { - this.name = name; - return this; - } - - /** - * Name of the Permission Group. - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public PermissionGroupModel canManageMembers(Boolean canManageMembers) { - this.canManageMembers = canManageMembers; - return this; - } - - /** - * Group members can manage team members. - * @return canManageMembers - */ - @javax.annotation.Nullable - public Boolean getCanManageMembers() { - return canManageMembers; - } - - public void setCanManageMembers(Boolean canManageMembers) { - this.canManageMembers = canManageMembers; - } - - - public PermissionGroupModel canCreateOrUpdateConfig(Boolean canCreateOrUpdateConfig) { - this.canCreateOrUpdateConfig = canCreateOrUpdateConfig; - return this; - } - - /** - * Group members can create/update Configs. - * @return canCreateOrUpdateConfig - */ - @javax.annotation.Nullable - public Boolean getCanCreateOrUpdateConfig() { - return canCreateOrUpdateConfig; - } - - public void setCanCreateOrUpdateConfig(Boolean canCreateOrUpdateConfig) { - this.canCreateOrUpdateConfig = canCreateOrUpdateConfig; - } - - - public PermissionGroupModel canDeleteConfig(Boolean canDeleteConfig) { - this.canDeleteConfig = canDeleteConfig; - return this; - } - - /** - * Group members can delete Configs. - * @return canDeleteConfig - */ - @javax.annotation.Nullable - public Boolean getCanDeleteConfig() { - return canDeleteConfig; - } - - public void setCanDeleteConfig(Boolean canDeleteConfig) { - this.canDeleteConfig = canDeleteConfig; - } - - - public PermissionGroupModel canCreateOrUpdateEnvironment(Boolean canCreateOrUpdateEnvironment) { - this.canCreateOrUpdateEnvironment = canCreateOrUpdateEnvironment; - return this; - } - - /** - * Group members can create/update Environments. - * @return canCreateOrUpdateEnvironment - */ - @javax.annotation.Nullable - public Boolean getCanCreateOrUpdateEnvironment() { - return canCreateOrUpdateEnvironment; - } - - public void setCanCreateOrUpdateEnvironment(Boolean canCreateOrUpdateEnvironment) { - this.canCreateOrUpdateEnvironment = canCreateOrUpdateEnvironment; - } - - - public PermissionGroupModel canDeleteEnvironment(Boolean canDeleteEnvironment) { - this.canDeleteEnvironment = canDeleteEnvironment; - return this; - } - - /** - * Group members can delete Environments. - * @return canDeleteEnvironment - */ - @javax.annotation.Nullable - public Boolean getCanDeleteEnvironment() { - return canDeleteEnvironment; - } - - public void setCanDeleteEnvironment(Boolean canDeleteEnvironment) { - this.canDeleteEnvironment = canDeleteEnvironment; - } - - - public PermissionGroupModel canCreateOrUpdateSetting(Boolean canCreateOrUpdateSetting) { - this.canCreateOrUpdateSetting = canCreateOrUpdateSetting; - return this; - } - - /** - * Group members can create/update Feature Flags and Settings. - * @return canCreateOrUpdateSetting - */ - @javax.annotation.Nullable - public Boolean getCanCreateOrUpdateSetting() { - return canCreateOrUpdateSetting; - } - - public void setCanCreateOrUpdateSetting(Boolean canCreateOrUpdateSetting) { - this.canCreateOrUpdateSetting = canCreateOrUpdateSetting; - } - - - public PermissionGroupModel canTagSetting(Boolean canTagSetting) { - this.canTagSetting = canTagSetting; - return this; - } - - /** - * Group members can attach/detach Tags to Feature Flags and Settings. - * @return canTagSetting - */ - @javax.annotation.Nullable - public Boolean getCanTagSetting() { - return canTagSetting; - } - - public void setCanTagSetting(Boolean canTagSetting) { - this.canTagSetting = canTagSetting; - } - - - public PermissionGroupModel canDeleteSetting(Boolean canDeleteSetting) { - this.canDeleteSetting = canDeleteSetting; - return this; - } - - /** - * Group members can delete Feature Flags and Settings. - * @return canDeleteSetting - */ - @javax.annotation.Nullable - public Boolean getCanDeleteSetting() { - return canDeleteSetting; - } - - public void setCanDeleteSetting(Boolean canDeleteSetting) { - this.canDeleteSetting = canDeleteSetting; - } - - - public PermissionGroupModel canCreateOrUpdateTag(Boolean canCreateOrUpdateTag) { - this.canCreateOrUpdateTag = canCreateOrUpdateTag; - return this; - } - - /** - * Group members can create/update Tags. - * @return canCreateOrUpdateTag - */ - @javax.annotation.Nullable - public Boolean getCanCreateOrUpdateTag() { - return canCreateOrUpdateTag; - } - - public void setCanCreateOrUpdateTag(Boolean canCreateOrUpdateTag) { - this.canCreateOrUpdateTag = canCreateOrUpdateTag; - } - - - public PermissionGroupModel canDeleteTag(Boolean canDeleteTag) { - this.canDeleteTag = canDeleteTag; - return this; - } - - /** - * Group members can delete Tags. - * @return canDeleteTag - */ - @javax.annotation.Nullable - public Boolean getCanDeleteTag() { - return canDeleteTag; - } - - public void setCanDeleteTag(Boolean canDeleteTag) { - this.canDeleteTag = canDeleteTag; - } - - - public PermissionGroupModel canManageWebhook(Boolean canManageWebhook) { - this.canManageWebhook = canManageWebhook; - return this; - } - - /** - * Group members can create/update/delete Webhooks. - * @return canManageWebhook - */ - @javax.annotation.Nullable - public Boolean getCanManageWebhook() { - return canManageWebhook; - } - - public void setCanManageWebhook(Boolean canManageWebhook) { - this.canManageWebhook = canManageWebhook; - } - - - public PermissionGroupModel canUseExportImport(Boolean canUseExportImport) { - this.canUseExportImport = canUseExportImport; - return this; - } - - /** - * Group members can use the export/import feature. - * @return canUseExportImport - */ - @javax.annotation.Nullable - public Boolean getCanUseExportImport() { - return canUseExportImport; - } - - public void setCanUseExportImport(Boolean canUseExportImport) { - this.canUseExportImport = canUseExportImport; - } - - - public PermissionGroupModel canManageProductPreferences(Boolean canManageProductPreferences) { - this.canManageProductPreferences = canManageProductPreferences; - return this; - } - - /** - * Group members can update Product preferences. - * @return canManageProductPreferences - */ - @javax.annotation.Nullable - public Boolean getCanManageProductPreferences() { - return canManageProductPreferences; - } - - public void setCanManageProductPreferences(Boolean canManageProductPreferences) { - this.canManageProductPreferences = canManageProductPreferences; - } - - - public PermissionGroupModel canManageIntegrations(Boolean canManageIntegrations) { - this.canManageIntegrations = canManageIntegrations; - return this; - } - - /** - * Group members can add and configure integrations. - * @return canManageIntegrations - */ - @javax.annotation.Nullable - public Boolean getCanManageIntegrations() { - return canManageIntegrations; - } - - public void setCanManageIntegrations(Boolean canManageIntegrations) { - this.canManageIntegrations = canManageIntegrations; - } - - - public PermissionGroupModel canViewSdkKey(Boolean canViewSdkKey) { - this.canViewSdkKey = canViewSdkKey; - return this; - } - - /** - * Group members has access to SDK keys. - * @return canViewSdkKey - */ - @javax.annotation.Nullable - public Boolean getCanViewSdkKey() { - return canViewSdkKey; - } - - public void setCanViewSdkKey(Boolean canViewSdkKey) { - this.canViewSdkKey = canViewSdkKey; - } - - - public PermissionGroupModel canRotateSdkKey(Boolean canRotateSdkKey) { - this.canRotateSdkKey = canRotateSdkKey; - return this; - } - - /** - * Group members can rotate SDK keys. - * @return canRotateSdkKey - */ - @javax.annotation.Nullable - public Boolean getCanRotateSdkKey() { - return canRotateSdkKey; - } - - public void setCanRotateSdkKey(Boolean canRotateSdkKey) { - this.canRotateSdkKey = canRotateSdkKey; - } - - - public PermissionGroupModel canCreateOrUpdateSegments(Boolean canCreateOrUpdateSegments) { - this.canCreateOrUpdateSegments = canCreateOrUpdateSegments; - return this; - } - - /** - * Group members can create/update Segments. - * @return canCreateOrUpdateSegments - */ - @javax.annotation.Nullable - public Boolean getCanCreateOrUpdateSegments() { - return canCreateOrUpdateSegments; - } - - public void setCanCreateOrUpdateSegments(Boolean canCreateOrUpdateSegments) { - this.canCreateOrUpdateSegments = canCreateOrUpdateSegments; - } - - - public PermissionGroupModel canDeleteSegments(Boolean canDeleteSegments) { - this.canDeleteSegments = canDeleteSegments; - return this; - } - - /** - * Group members can delete Segments. - * @return canDeleteSegments - */ - @javax.annotation.Nullable - public Boolean getCanDeleteSegments() { - return canDeleteSegments; - } - - public void setCanDeleteSegments(Boolean canDeleteSegments) { - this.canDeleteSegments = canDeleteSegments; - } - - - public PermissionGroupModel canViewProductAuditLog(Boolean canViewProductAuditLog) { - this.canViewProductAuditLog = canViewProductAuditLog; - return this; - } - - /** - * Group members has access to audit logs. - * @return canViewProductAuditLog - */ - @javax.annotation.Nullable - public Boolean getCanViewProductAuditLog() { - return canViewProductAuditLog; - } - - public void setCanViewProductAuditLog(Boolean canViewProductAuditLog) { - this.canViewProductAuditLog = canViewProductAuditLog; - } - - - public PermissionGroupModel canViewProductStatistics(Boolean canViewProductStatistics) { - this.canViewProductStatistics = canViewProductStatistics; - return this; - } - - /** - * Group members has access to product statistics. - * @return canViewProductStatistics - */ - @javax.annotation.Nullable - public Boolean getCanViewProductStatistics() { - return canViewProductStatistics; - } - - public void setCanViewProductStatistics(Boolean canViewProductStatistics) { - this.canViewProductStatistics = canViewProductStatistics; - } - - - public PermissionGroupModel canDisable2FA(Boolean canDisable2FA) { - this.canDisable2FA = canDisable2FA; - return this; - } - - /** - * Group members can disable two-factor authentication for other members. - * @return canDisable2FA - */ - @javax.annotation.Nullable - public Boolean getCanDisable2FA() { - return canDisable2FA; - } - - public void setCanDisable2FA(Boolean canDisable2FA) { - this.canDisable2FA = canDisable2FA; - } - - - public PermissionGroupModel accessType(AccessType accessType) { - this.accessType = accessType; - return this; - } - - /** - * Get accessType - * @return accessType - */ - @javax.annotation.Nullable - public AccessType getAccessType() { - return accessType; - } - - public void setAccessType(AccessType accessType) { - this.accessType = accessType; - } - - - public PermissionGroupModel newEnvironmentAccessType(EnvironmentAccessType newEnvironmentAccessType) { - this.newEnvironmentAccessType = newEnvironmentAccessType; - return this; - } - - /** - * Get newEnvironmentAccessType - * @return newEnvironmentAccessType - */ - @javax.annotation.Nullable - public EnvironmentAccessType getNewEnvironmentAccessType() { - return newEnvironmentAccessType; - } - - public void setNewEnvironmentAccessType(EnvironmentAccessType newEnvironmentAccessType) { - this.newEnvironmentAccessType = newEnvironmentAccessType; - } - - - public PermissionGroupModel environmentAccesses(List environmentAccesses) { - this.environmentAccesses = environmentAccesses; - return this; - } - - public PermissionGroupModel addEnvironmentAccessesItem(EnvironmentAccessModel environmentAccessesItem) { - if (this.environmentAccesses == null) { - this.environmentAccesses = new ArrayList<>(); - } - this.environmentAccesses.add(environmentAccessesItem); - return this; - } - - /** - * List of environment specific permissions. - * @return environmentAccesses - */ - @javax.annotation.Nullable - public List getEnvironmentAccesses() { - return environmentAccesses; - } - - public void setEnvironmentAccesses(List environmentAccesses) { - this.environmentAccesses = environmentAccesses; - } - - - public PermissionGroupModel product(ProductModel product) { - this.product = product; - return this; - } - - /** - * Get product - * @return product - */ - @javax.annotation.Nullable - public ProductModel getProduct() { - return product; - } - - public void setProduct(ProductModel product) { - this.product = product; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the PermissionGroupModel instance itself - */ - public PermissionGroupModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PermissionGroupModel permissionGroupModel = (PermissionGroupModel) o; - return Objects.equals(this.permissionGroupId, permissionGroupModel.permissionGroupId) && - Objects.equals(this.name, permissionGroupModel.name) && - Objects.equals(this.canManageMembers, permissionGroupModel.canManageMembers) && - Objects.equals(this.canCreateOrUpdateConfig, permissionGroupModel.canCreateOrUpdateConfig) && - Objects.equals(this.canDeleteConfig, permissionGroupModel.canDeleteConfig) && - Objects.equals(this.canCreateOrUpdateEnvironment, permissionGroupModel.canCreateOrUpdateEnvironment) && - Objects.equals(this.canDeleteEnvironment, permissionGroupModel.canDeleteEnvironment) && - Objects.equals(this.canCreateOrUpdateSetting, permissionGroupModel.canCreateOrUpdateSetting) && - Objects.equals(this.canTagSetting, permissionGroupModel.canTagSetting) && - Objects.equals(this.canDeleteSetting, permissionGroupModel.canDeleteSetting) && - Objects.equals(this.canCreateOrUpdateTag, permissionGroupModel.canCreateOrUpdateTag) && - Objects.equals(this.canDeleteTag, permissionGroupModel.canDeleteTag) && - Objects.equals(this.canManageWebhook, permissionGroupModel.canManageWebhook) && - Objects.equals(this.canUseExportImport, permissionGroupModel.canUseExportImport) && - Objects.equals(this.canManageProductPreferences, permissionGroupModel.canManageProductPreferences) && - Objects.equals(this.canManageIntegrations, permissionGroupModel.canManageIntegrations) && - Objects.equals(this.canViewSdkKey, permissionGroupModel.canViewSdkKey) && - Objects.equals(this.canRotateSdkKey, permissionGroupModel.canRotateSdkKey) && - Objects.equals(this.canCreateOrUpdateSegments, permissionGroupModel.canCreateOrUpdateSegments) && - Objects.equals(this.canDeleteSegments, permissionGroupModel.canDeleteSegments) && - Objects.equals(this.canViewProductAuditLog, permissionGroupModel.canViewProductAuditLog) && - Objects.equals(this.canViewProductStatistics, permissionGroupModel.canViewProductStatistics) && - Objects.equals(this.canDisable2FA, permissionGroupModel.canDisable2FA) && - Objects.equals(this.accessType, permissionGroupModel.accessType) && - Objects.equals(this.newEnvironmentAccessType, permissionGroupModel.newEnvironmentAccessType) && - Objects.equals(this.environmentAccesses, permissionGroupModel.environmentAccesses) && - Objects.equals(this.product, permissionGroupModel.product)&& - Objects.equals(this.additionalProperties, permissionGroupModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(permissionGroupId, name, canManageMembers, canCreateOrUpdateConfig, canDeleteConfig, canCreateOrUpdateEnvironment, canDeleteEnvironment, canCreateOrUpdateSetting, canTagSetting, canDeleteSetting, canCreateOrUpdateTag, canDeleteTag, canManageWebhook, canUseExportImport, canManageProductPreferences, canManageIntegrations, canViewSdkKey, canRotateSdkKey, canCreateOrUpdateSegments, canDeleteSegments, canViewProductAuditLog, canViewProductStatistics, canDisable2FA, accessType, newEnvironmentAccessType, environmentAccesses, product, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PermissionGroupModel {\n"); - sb.append(" permissionGroupId: ").append(toIndentedString(permissionGroupId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" canManageMembers: ").append(toIndentedString(canManageMembers)).append("\n"); - sb.append(" canCreateOrUpdateConfig: ").append(toIndentedString(canCreateOrUpdateConfig)).append("\n"); - sb.append(" canDeleteConfig: ").append(toIndentedString(canDeleteConfig)).append("\n"); - sb.append(" canCreateOrUpdateEnvironment: ").append(toIndentedString(canCreateOrUpdateEnvironment)).append("\n"); - sb.append(" canDeleteEnvironment: ").append(toIndentedString(canDeleteEnvironment)).append("\n"); - sb.append(" canCreateOrUpdateSetting: ").append(toIndentedString(canCreateOrUpdateSetting)).append("\n"); - sb.append(" canTagSetting: ").append(toIndentedString(canTagSetting)).append("\n"); - sb.append(" canDeleteSetting: ").append(toIndentedString(canDeleteSetting)).append("\n"); - sb.append(" canCreateOrUpdateTag: ").append(toIndentedString(canCreateOrUpdateTag)).append("\n"); - sb.append(" canDeleteTag: ").append(toIndentedString(canDeleteTag)).append("\n"); - sb.append(" canManageWebhook: ").append(toIndentedString(canManageWebhook)).append("\n"); - sb.append(" canUseExportImport: ").append(toIndentedString(canUseExportImport)).append("\n"); - sb.append(" canManageProductPreferences: ").append(toIndentedString(canManageProductPreferences)).append("\n"); - sb.append(" canManageIntegrations: ").append(toIndentedString(canManageIntegrations)).append("\n"); - sb.append(" canViewSdkKey: ").append(toIndentedString(canViewSdkKey)).append("\n"); - sb.append(" canRotateSdkKey: ").append(toIndentedString(canRotateSdkKey)).append("\n"); - sb.append(" canCreateOrUpdateSegments: ").append(toIndentedString(canCreateOrUpdateSegments)).append("\n"); - sb.append(" canDeleteSegments: ").append(toIndentedString(canDeleteSegments)).append("\n"); - sb.append(" canViewProductAuditLog: ").append(toIndentedString(canViewProductAuditLog)).append("\n"); - sb.append(" canViewProductStatistics: ").append(toIndentedString(canViewProductStatistics)).append("\n"); - sb.append(" canDisable2FA: ").append(toIndentedString(canDisable2FA)).append("\n"); - sb.append(" accessType: ").append(toIndentedString(accessType)).append("\n"); - sb.append(" newEnvironmentAccessType: ").append(toIndentedString(newEnvironmentAccessType)).append("\n"); - sb.append(" environmentAccesses: ").append(toIndentedString(environmentAccesses)).append("\n"); - sb.append(" product: ").append(toIndentedString(product)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("permissionGroupId"); - openapiFields.add("name"); - openapiFields.add("canManageMembers"); - openapiFields.add("canCreateOrUpdateConfig"); - openapiFields.add("canDeleteConfig"); - openapiFields.add("canCreateOrUpdateEnvironment"); - openapiFields.add("canDeleteEnvironment"); - openapiFields.add("canCreateOrUpdateSetting"); - openapiFields.add("canTagSetting"); - openapiFields.add("canDeleteSetting"); - openapiFields.add("canCreateOrUpdateTag"); - openapiFields.add("canDeleteTag"); - openapiFields.add("canManageWebhook"); - openapiFields.add("canUseExportImport"); - openapiFields.add("canManageProductPreferences"); - openapiFields.add("canManageIntegrations"); - openapiFields.add("canViewSdkKey"); - openapiFields.add("canRotateSdkKey"); - openapiFields.add("canCreateOrUpdateSegments"); - openapiFields.add("canDeleteSegments"); - openapiFields.add("canViewProductAuditLog"); - openapiFields.add("canViewProductStatistics"); - openapiFields.add("canDisable2FA"); - openapiFields.add("accessType"); - openapiFields.add("newEnvironmentAccessType"); - openapiFields.add("environmentAccesses"); - openapiFields.add("product"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PermissionGroupModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!PermissionGroupModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in PermissionGroupModel is not found in the empty JSON string", PermissionGroupModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - // validate the optional field `accessType` - if (jsonObj.get("accessType") != null && !jsonObj.get("accessType").isJsonNull()) { - AccessType.validateJsonElement(jsonObj.get("accessType")); - } - // validate the optional field `newEnvironmentAccessType` - if (jsonObj.get("newEnvironmentAccessType") != null && !jsonObj.get("newEnvironmentAccessType").isJsonNull()) { - EnvironmentAccessType.validateJsonElement(jsonObj.get("newEnvironmentAccessType")); - } - if (jsonObj.get("environmentAccesses") != null && !jsonObj.get("environmentAccesses").isJsonNull()) { - JsonArray jsonArrayenvironmentAccesses = jsonObj.getAsJsonArray("environmentAccesses"); - if (jsonArrayenvironmentAccesses != null) { - // ensure the json data is an array - if (!jsonObj.get("environmentAccesses").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `environmentAccesses` to be an array in the JSON string but got `%s`", jsonObj.get("environmentAccesses").toString())); - } - - // validate the optional field `environmentAccesses` (array) - for (int i = 0; i < jsonArrayenvironmentAccesses.size(); i++) { - EnvironmentAccessModel.validateJsonElement(jsonArrayenvironmentAccesses.get(i)); - }; - } - } - // validate the optional field `product` - if (jsonObj.get("product") != null && !jsonObj.get("product").isJsonNull()) { - ProductModel.validateJsonElement(jsonObj.get("product")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!PermissionGroupModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PermissionGroupModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(PermissionGroupModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, PermissionGroupModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public PermissionGroupModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - PermissionGroupModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of PermissionGroupModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of PermissionGroupModel - * @throws IOException if the JSON string is invalid with respect to PermissionGroupModel - */ - public static PermissionGroupModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PermissionGroupModel.class); - } - - /** - * Convert an instance of PermissionGroupModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/PreferencesModel.java b/src/main/java/com/configcat/publicapi/java/client/model/PreferencesModel.java deleted file mode 100644 index b56ab8f..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/PreferencesModel.java +++ /dev/null @@ -1,430 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.KeyGenerationMode; -import com.configcat.publicapi.java.client.model.ReasonRequiredEnvironmentModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * PreferencesModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class PreferencesModel { - public static final String SERIALIZED_NAME_REASON_REQUIRED = "reasonRequired"; - @SerializedName(SERIALIZED_NAME_REASON_REQUIRED) - private Boolean reasonRequired; - - public static final String SERIALIZED_NAME_KEY_GENERATION_MODE = "keyGenerationMode"; - @SerializedName(SERIALIZED_NAME_KEY_GENERATION_MODE) - private KeyGenerationMode keyGenerationMode; - - public static final String SERIALIZED_NAME_SHOW_VARIATION_ID = "showVariationId"; - @SerializedName(SERIALIZED_NAME_SHOW_VARIATION_ID) - private Boolean showVariationId; - - public static final String SERIALIZED_NAME_REASON_REQUIRED_ENVIRONMENTS = "reasonRequiredEnvironments"; - @SerializedName(SERIALIZED_NAME_REASON_REQUIRED_ENVIRONMENTS) - private List reasonRequiredEnvironments; - - public static final String SERIALIZED_NAME_MANDATORY_SETTING_HINT = "mandatorySettingHint"; - @SerializedName(SERIALIZED_NAME_MANDATORY_SETTING_HINT) - private Boolean mandatorySettingHint; - - public PreferencesModel() { - } - - public PreferencesModel reasonRequired(Boolean reasonRequired) { - this.reasonRequired = reasonRequired; - return this; - } - - /** - * Indicates that a mandatory note required for saving and publishing. - * @return reasonRequired - */ - @javax.annotation.Nullable - public Boolean getReasonRequired() { - return reasonRequired; - } - - public void setReasonRequired(Boolean reasonRequired) { - this.reasonRequired = reasonRequired; - } - - - public PreferencesModel keyGenerationMode(KeyGenerationMode keyGenerationMode) { - this.keyGenerationMode = keyGenerationMode; - return this; - } - - /** - * Get keyGenerationMode - * @return keyGenerationMode - */ - @javax.annotation.Nullable - public KeyGenerationMode getKeyGenerationMode() { - return keyGenerationMode; - } - - public void setKeyGenerationMode(KeyGenerationMode keyGenerationMode) { - this.keyGenerationMode = keyGenerationMode; - } - - - public PreferencesModel showVariationId(Boolean showVariationId) { - this.showVariationId = showVariationId; - return this; - } - - /** - * Indicates whether a variation ID's must be shown on the ConfigCat Dashboard. - * @return showVariationId - */ - @javax.annotation.Nullable - public Boolean getShowVariationId() { - return showVariationId; - } - - public void setShowVariationId(Boolean showVariationId) { - this.showVariationId = showVariationId; - } - - - public PreferencesModel reasonRequiredEnvironments(List reasonRequiredEnvironments) { - this.reasonRequiredEnvironments = reasonRequiredEnvironments; - return this; - } - - public PreferencesModel addReasonRequiredEnvironmentsItem(ReasonRequiredEnvironmentModel reasonRequiredEnvironmentsItem) { - if (this.reasonRequiredEnvironments == null) { - this.reasonRequiredEnvironments = new ArrayList<>(); - } - this.reasonRequiredEnvironments.add(reasonRequiredEnvironmentsItem); - return this; - } - - /** - * List of Environments where mandatory note must be set before saving and publishing. - * @return reasonRequiredEnvironments - */ - @javax.annotation.Nullable - public List getReasonRequiredEnvironments() { - return reasonRequiredEnvironments; - } - - public void setReasonRequiredEnvironments(List reasonRequiredEnvironments) { - this.reasonRequiredEnvironments = reasonRequiredEnvironments; - } - - - public PreferencesModel mandatorySettingHint(Boolean mandatorySettingHint) { - this.mandatorySettingHint = mandatorySettingHint; - return this; - } - - /** - * Indicates whether Feature flags and Settings must have a hint. - * @return mandatorySettingHint - */ - @javax.annotation.Nullable - public Boolean getMandatorySettingHint() { - return mandatorySettingHint; - } - - public void setMandatorySettingHint(Boolean mandatorySettingHint) { - this.mandatorySettingHint = mandatorySettingHint; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the PreferencesModel instance itself - */ - public PreferencesModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PreferencesModel preferencesModel = (PreferencesModel) o; - return Objects.equals(this.reasonRequired, preferencesModel.reasonRequired) && - Objects.equals(this.keyGenerationMode, preferencesModel.keyGenerationMode) && - Objects.equals(this.showVariationId, preferencesModel.showVariationId) && - Objects.equals(this.reasonRequiredEnvironments, preferencesModel.reasonRequiredEnvironments) && - Objects.equals(this.mandatorySettingHint, preferencesModel.mandatorySettingHint)&& - Objects.equals(this.additionalProperties, preferencesModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(reasonRequired, keyGenerationMode, showVariationId, reasonRequiredEnvironments, mandatorySettingHint, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PreferencesModel {\n"); - sb.append(" reasonRequired: ").append(toIndentedString(reasonRequired)).append("\n"); - sb.append(" keyGenerationMode: ").append(toIndentedString(keyGenerationMode)).append("\n"); - sb.append(" showVariationId: ").append(toIndentedString(showVariationId)).append("\n"); - sb.append(" reasonRequiredEnvironments: ").append(toIndentedString(reasonRequiredEnvironments)).append("\n"); - sb.append(" mandatorySettingHint: ").append(toIndentedString(mandatorySettingHint)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("reasonRequired"); - openapiFields.add("keyGenerationMode"); - openapiFields.add("showVariationId"); - openapiFields.add("reasonRequiredEnvironments"); - openapiFields.add("mandatorySettingHint"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PreferencesModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!PreferencesModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in PreferencesModel is not found in the empty JSON string", PreferencesModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `keyGenerationMode` - if (jsonObj.get("keyGenerationMode") != null && !jsonObj.get("keyGenerationMode").isJsonNull()) { - KeyGenerationMode.validateJsonElement(jsonObj.get("keyGenerationMode")); - } - if (jsonObj.get("reasonRequiredEnvironments") != null && !jsonObj.get("reasonRequiredEnvironments").isJsonNull()) { - JsonArray jsonArrayreasonRequiredEnvironments = jsonObj.getAsJsonArray("reasonRequiredEnvironments"); - if (jsonArrayreasonRequiredEnvironments != null) { - // ensure the json data is an array - if (!jsonObj.get("reasonRequiredEnvironments").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `reasonRequiredEnvironments` to be an array in the JSON string but got `%s`", jsonObj.get("reasonRequiredEnvironments").toString())); - } - - // validate the optional field `reasonRequiredEnvironments` (array) - for (int i = 0; i < jsonArrayreasonRequiredEnvironments.size(); i++) { - ReasonRequiredEnvironmentModel.validateJsonElement(jsonArrayreasonRequiredEnvironments.get(i)); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!PreferencesModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PreferencesModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(PreferencesModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, PreferencesModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public PreferencesModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - PreferencesModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of PreferencesModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of PreferencesModel - * @throws IOException if the JSON string is invalid with respect to PreferencesModel - */ - public static PreferencesModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PreferencesModel.class); - } - - /** - * Convert an instance of PreferencesModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteComparator.java b/src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteComparator.java deleted file mode 100644 index 9c7eaac..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteComparator.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Prerequisite flag comparison operator used during the evaluation process. - */ -@JsonAdapter(PrerequisiteComparator.Adapter.class) -public enum PrerequisiteComparator { - - EQUALS("equals"), - - DOES_NOT_EQUAL("doesNotEqual"); - - private String value; - - PrerequisiteComparator(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static PrerequisiteComparator fromValue(String value) { - for (PrerequisiteComparator b : PrerequisiteComparator.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final PrerequisiteComparator enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public PrerequisiteComparator read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return PrerequisiteComparator.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - PrerequisiteComparator.fromValue(value); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteFlagConditionModel.java b/src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteFlagConditionModel.java deleted file mode 100644 index f134e04..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteFlagConditionModel.java +++ /dev/null @@ -1,352 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.PrerequisiteComparator; -import com.configcat.publicapi.java.client.model.ValueModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * Describes a condition that is based on a prerequisite flag. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class PrerequisiteFlagConditionModel { - public static final String SERIALIZED_NAME_PREREQUISITE_SETTING_ID = "prerequisiteSettingId"; - @SerializedName(SERIALIZED_NAME_PREREQUISITE_SETTING_ID) - private Integer prerequisiteSettingId; - - public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; - @SerializedName(SERIALIZED_NAME_COMPARATOR) - private PrerequisiteComparator comparator; - - public static final String SERIALIZED_NAME_PREREQUISITE_COMPARISON_VALUE = "prerequisiteComparisonValue"; - @SerializedName(SERIALIZED_NAME_PREREQUISITE_COMPARISON_VALUE) - private ValueModel prerequisiteComparisonValue; - - public PrerequisiteFlagConditionModel() { - } - - public PrerequisiteFlagConditionModel prerequisiteSettingId(Integer prerequisiteSettingId) { - this.prerequisiteSettingId = prerequisiteSettingId; - return this; - } - - /** - * The prerequisite flag's identifier. - * @return prerequisiteSettingId - */ - @javax.annotation.Nonnull - public Integer getPrerequisiteSettingId() { - return prerequisiteSettingId; - } - - public void setPrerequisiteSettingId(Integer prerequisiteSettingId) { - this.prerequisiteSettingId = prerequisiteSettingId; - } - - - public PrerequisiteFlagConditionModel comparator(PrerequisiteComparator comparator) { - this.comparator = comparator; - return this; - } - - /** - * Get comparator - * @return comparator - */ - @javax.annotation.Nonnull - public PrerequisiteComparator getComparator() { - return comparator; - } - - public void setComparator(PrerequisiteComparator comparator) { - this.comparator = comparator; - } - - - public PrerequisiteFlagConditionModel prerequisiteComparisonValue(ValueModel prerequisiteComparisonValue) { - this.prerequisiteComparisonValue = prerequisiteComparisonValue; - return this; - } - - /** - * Get prerequisiteComparisonValue - * @return prerequisiteComparisonValue - */ - @javax.annotation.Nonnull - public ValueModel getPrerequisiteComparisonValue() { - return prerequisiteComparisonValue; - } - - public void setPrerequisiteComparisonValue(ValueModel prerequisiteComparisonValue) { - this.prerequisiteComparisonValue = prerequisiteComparisonValue; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the PrerequisiteFlagConditionModel instance itself - */ - public PrerequisiteFlagConditionModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PrerequisiteFlagConditionModel prerequisiteFlagConditionModel = (PrerequisiteFlagConditionModel) o; - return Objects.equals(this.prerequisiteSettingId, prerequisiteFlagConditionModel.prerequisiteSettingId) && - Objects.equals(this.comparator, prerequisiteFlagConditionModel.comparator) && - Objects.equals(this.prerequisiteComparisonValue, prerequisiteFlagConditionModel.prerequisiteComparisonValue)&& - Objects.equals(this.additionalProperties, prerequisiteFlagConditionModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(prerequisiteSettingId, comparator, prerequisiteComparisonValue, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PrerequisiteFlagConditionModel {\n"); - sb.append(" prerequisiteSettingId: ").append(toIndentedString(prerequisiteSettingId)).append("\n"); - sb.append(" comparator: ").append(toIndentedString(comparator)).append("\n"); - sb.append(" prerequisiteComparisonValue: ").append(toIndentedString(prerequisiteComparisonValue)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("prerequisiteSettingId"); - openapiFields.add("comparator"); - openapiFields.add("prerequisiteComparisonValue"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("prerequisiteSettingId"); - openapiRequiredFields.add("comparator"); - openapiRequiredFields.add("prerequisiteComparisonValue"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PrerequisiteFlagConditionModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!PrerequisiteFlagConditionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in PrerequisiteFlagConditionModel is not found in the empty JSON string", PrerequisiteFlagConditionModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PrerequisiteFlagConditionModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `comparator` - PrerequisiteComparator.validateJsonElement(jsonObj.get("comparator")); - // validate the required field `prerequisiteComparisonValue` - ValueModel.validateJsonElement(jsonObj.get("prerequisiteComparisonValue")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!PrerequisiteFlagConditionModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PrerequisiteFlagConditionModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(PrerequisiteFlagConditionModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, PrerequisiteFlagConditionModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public PrerequisiteFlagConditionModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - PrerequisiteFlagConditionModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of PrerequisiteFlagConditionModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of PrerequisiteFlagConditionModel - * @throws IOException if the JSON string is invalid with respect to PrerequisiteFlagConditionModel - */ - public static PrerequisiteFlagConditionModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PrerequisiteFlagConditionModel.class); - } - - /** - * Convert an instance of PrerequisiteFlagConditionModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ProductModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ProductModel.java deleted file mode 100644 index 2d69f93..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/ProductModel.java +++ /dev/null @@ -1,441 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.OrganizationModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * Details of the Product. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class ProductModel { - public static final String SERIALIZED_NAME_ORGANIZATION = "organization"; - @SerializedName(SERIALIZED_NAME_ORGANIZATION) - private OrganizationModel organization; - - public static final String SERIALIZED_NAME_PRODUCT_ID = "productId"; - @SerializedName(SERIALIZED_NAME_PRODUCT_ID) - private UUID productId; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_ORDER = "order"; - @SerializedName(SERIALIZED_NAME_ORDER) - private Integer order; - - public static final String SERIALIZED_NAME_REASON_REQUIRED = "reasonRequired"; - @SerializedName(SERIALIZED_NAME_REASON_REQUIRED) - private Boolean reasonRequired; - - public ProductModel() { - } - - public ProductModel organization(OrganizationModel organization) { - this.organization = organization; - return this; - } - - /** - * Get organization - * @return organization - */ - @javax.annotation.Nullable - public OrganizationModel getOrganization() { - return organization; - } - - public void setOrganization(OrganizationModel organization) { - this.organization = organization; - } - - - public ProductModel productId(UUID productId) { - this.productId = productId; - return this; - } - - /** - * Identifier of the Product. - * @return productId - */ - @javax.annotation.Nullable - public UUID getProductId() { - return productId; - } - - public void setProductId(UUID productId) { - this.productId = productId; - } - - - public ProductModel name(String name) { - this.name = name; - return this; - } - - /** - * Name of the Product. - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public ProductModel description(String description) { - this.description = description; - return this; - } - - /** - * Description of the Product. - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - - public ProductModel order(Integer order) { - this.order = order; - return this; - } - - /** - * The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. - * @return order - */ - @javax.annotation.Nullable - public Integer getOrder() { - return order; - } - - public void setOrder(Integer order) { - this.order = order; - } - - - public ProductModel reasonRequired(Boolean reasonRequired) { - this.reasonRequired = reasonRequired; - return this; - } - - /** - * Determines whether a mandatory reason must be given every time when the Feature Flags or Settings within a Product are saved. - * @return reasonRequired - */ - @javax.annotation.Nullable - public Boolean getReasonRequired() { - return reasonRequired; - } - - public void setReasonRequired(Boolean reasonRequired) { - this.reasonRequired = reasonRequired; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the ProductModel instance itself - */ - public ProductModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProductModel productModel = (ProductModel) o; - return Objects.equals(this.organization, productModel.organization) && - Objects.equals(this.productId, productModel.productId) && - Objects.equals(this.name, productModel.name) && - Objects.equals(this.description, productModel.description) && - Objects.equals(this.order, productModel.order) && - Objects.equals(this.reasonRequired, productModel.reasonRequired)&& - Objects.equals(this.additionalProperties, productModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(organization, productId, name, description, order, reasonRequired, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ProductModel {\n"); - sb.append(" organization: ").append(toIndentedString(organization)).append("\n"); - sb.append(" productId: ").append(toIndentedString(productId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append(" reasonRequired: ").append(toIndentedString(reasonRequired)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("organization"); - openapiFields.add("productId"); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("order"); - openapiFields.add("reasonRequired"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ProductModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ProductModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ProductModel is not found in the empty JSON string", ProductModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `organization` - if (jsonObj.get("organization") != null && !jsonObj.get("organization").isJsonNull()) { - OrganizationModel.validateJsonElement(jsonObj.get("organization")); - } - if ((jsonObj.get("productId") != null && !jsonObj.get("productId").isJsonNull()) && !jsonObj.get("productId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `productId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productId").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ProductModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ProductModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ProductModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ProductModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public ProductModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ProductModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ProductModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of ProductModel - * @throws IOException if the JSON string is invalid with respect to ProductModel - */ - public static ProductModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ProductModel.class); - } - - /** - * Convert an instance of ProductModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ReasonRequiredEnvironmentModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ReasonRequiredEnvironmentModel.java deleted file mode 100644 index 77c15ec..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/ReasonRequiredEnvironmentModel.java +++ /dev/null @@ -1,355 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * ReasonRequiredEnvironmentModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class ReasonRequiredEnvironmentModel { - public static final String SERIALIZED_NAME_ENVIRONMENT_ID = "environmentId"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) - private UUID environmentId; - - public static final String SERIALIZED_NAME_REASON_REQUIRED = "reasonRequired"; - @SerializedName(SERIALIZED_NAME_REASON_REQUIRED) - private Boolean reasonRequired; - - public static final String SERIALIZED_NAME_ENVIRONMENT_NAME = "environmentName"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT_NAME) - private String environmentName; - - public ReasonRequiredEnvironmentModel() { - } - - public ReasonRequiredEnvironmentModel environmentId(UUID environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Identifier of the Environment. - * @return environmentId - */ - @javax.annotation.Nullable - public UUID getEnvironmentId() { - return environmentId; - } - - public void setEnvironmentId(UUID environmentId) { - this.environmentId = environmentId; - } - - - public ReasonRequiredEnvironmentModel reasonRequired(Boolean reasonRequired) { - this.reasonRequired = reasonRequired; - return this; - } - - /** - * Indicates that a mandatory note is required in this Environment for saving and publishing. - * @return reasonRequired - */ - @javax.annotation.Nullable - public Boolean getReasonRequired() { - return reasonRequired; - } - - public void setReasonRequired(Boolean reasonRequired) { - this.reasonRequired = reasonRequired; - } - - - public ReasonRequiredEnvironmentModel environmentName(String environmentName) { - this.environmentName = environmentName; - return this; - } - - /** - * Name of the Environment. - * @return environmentName - */ - @javax.annotation.Nullable - public String getEnvironmentName() { - return environmentName; - } - - public void setEnvironmentName(String environmentName) { - this.environmentName = environmentName; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the ReasonRequiredEnvironmentModel instance itself - */ - public ReasonRequiredEnvironmentModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReasonRequiredEnvironmentModel reasonRequiredEnvironmentModel = (ReasonRequiredEnvironmentModel) o; - return Objects.equals(this.environmentId, reasonRequiredEnvironmentModel.environmentId) && - Objects.equals(this.reasonRequired, reasonRequiredEnvironmentModel.reasonRequired) && - Objects.equals(this.environmentName, reasonRequiredEnvironmentModel.environmentName)&& - Objects.equals(this.additionalProperties, reasonRequiredEnvironmentModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(environmentId, reasonRequired, environmentName, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReasonRequiredEnvironmentModel {\n"); - sb.append(" environmentId: ").append(toIndentedString(environmentId)).append("\n"); - sb.append(" reasonRequired: ").append(toIndentedString(reasonRequired)).append("\n"); - sb.append(" environmentName: ").append(toIndentedString(environmentName)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("environmentId"); - openapiFields.add("reasonRequired"); - openapiFields.add("environmentName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ReasonRequiredEnvironmentModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ReasonRequiredEnvironmentModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ReasonRequiredEnvironmentModel is not found in the empty JSON string", ReasonRequiredEnvironmentModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("environmentId") != null && !jsonObj.get("environmentId").isJsonNull()) && !jsonObj.get("environmentId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `environmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentId").toString())); - } - if ((jsonObj.get("environmentName") != null && !jsonObj.get("environmentName").isJsonNull()) && !jsonObj.get("environmentName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `environmentName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ReasonRequiredEnvironmentModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ReasonRequiredEnvironmentModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ReasonRequiredEnvironmentModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ReasonRequiredEnvironmentModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public ReasonRequiredEnvironmentModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ReasonRequiredEnvironmentModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ReasonRequiredEnvironmentModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of ReasonRequiredEnvironmentModel - * @throws IOException if the JSON string is invalid with respect to ReasonRequiredEnvironmentModel - */ - public static ReasonRequiredEnvironmentModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ReasonRequiredEnvironmentModel.class); - } - - /** - * Convert an instance of ReasonRequiredEnvironmentModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLine.java b/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLine.java deleted file mode 100644 index 58be71a..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLine.java +++ /dev/null @@ -1,333 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * Determines a code reference line. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class ReferenceLine { - public static final String SERIALIZED_NAME_LINE_TEXT = "lineText"; - @SerializedName(SERIALIZED_NAME_LINE_TEXT) - private String lineText; - - public static final String SERIALIZED_NAME_LINE_NUMBER = "lineNumber"; - @SerializedName(SERIALIZED_NAME_LINE_NUMBER) - private Integer lineNumber; - - public ReferenceLine() { - } - - public ReferenceLine lineText(String lineText) { - this.lineText = lineText; - return this; - } - - /** - * The content of the reference line. - * @return lineText - */ - @javax.annotation.Nullable - public String getLineText() { - return lineText; - } - - public void setLineText(String lineText) { - this.lineText = lineText; - } - - - public ReferenceLine lineNumber(Integer lineNumber) { - this.lineNumber = lineNumber; - return this; - } - - /** - * The line number. - * @return lineNumber - */ - @javax.annotation.Nonnull - public Integer getLineNumber() { - return lineNumber; - } - - public void setLineNumber(Integer lineNumber) { - this.lineNumber = lineNumber; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the ReferenceLine instance itself - */ - public ReferenceLine putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReferenceLine referenceLine = (ReferenceLine) o; - return Objects.equals(this.lineText, referenceLine.lineText) && - Objects.equals(this.lineNumber, referenceLine.lineNumber)&& - Objects.equals(this.additionalProperties, referenceLine.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(lineText, lineNumber, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReferenceLine {\n"); - sb.append(" lineText: ").append(toIndentedString(lineText)).append("\n"); - sb.append(" lineNumber: ").append(toIndentedString(lineNumber)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("lineText"); - openapiFields.add("lineNumber"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("lineNumber"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ReferenceLine - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ReferenceLine.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ReferenceLine is not found in the empty JSON string", ReferenceLine.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ReferenceLine.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("lineText") != null && !jsonObj.get("lineText").isJsonNull()) && !jsonObj.get("lineText").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lineText` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lineText").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ReferenceLine.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ReferenceLine' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ReferenceLine.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ReferenceLine value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public ReferenceLine read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ReferenceLine instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ReferenceLine given an JSON string - * - * @param jsonString JSON string - * @return An instance of ReferenceLine - * @throws IOException if the JSON string is invalid with respect to ReferenceLine - */ - public static ReferenceLine fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ReferenceLine.class); - } - - /** - * Convert an instance of ReferenceLine to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLines.java b/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLines.java deleted file mode 100644 index c1f1458..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLines.java +++ /dev/null @@ -1,464 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.ReferenceLine; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * ReferenceLines - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class ReferenceLines { - public static final String SERIALIZED_NAME_FILE = "file"; - @SerializedName(SERIALIZED_NAME_FILE) - private String _file; - - public static final String SERIALIZED_NAME_FILE_URL = "fileUrl"; - @SerializedName(SERIALIZED_NAME_FILE_URL) - private String fileUrl; - - public static final String SERIALIZED_NAME_PRE_LINES = "preLines"; - @SerializedName(SERIALIZED_NAME_PRE_LINES) - private List preLines; - - public static final String SERIALIZED_NAME_POST_LINES = "postLines"; - @SerializedName(SERIALIZED_NAME_POST_LINES) - private List postLines; - - public static final String SERIALIZED_NAME_REFERENCE_LINE = "referenceLine"; - @SerializedName(SERIALIZED_NAME_REFERENCE_LINE) - private ReferenceLine referenceLine; - - public ReferenceLines() { - } - - public ReferenceLines _file(String _file) { - this._file = _file; - return this; - } - - /** - * The file's name in where the code reference has been found. (Appears on the ConfigCat Dashboard) - * @return _file - */ - @javax.annotation.Nonnull - public String getFile() { - return _file; - } - - public void setFile(String _file) { - this._file = _file; - } - - - public ReferenceLines fileUrl(String fileUrl) { - this.fileUrl = fileUrl; - return this; - } - - /** - * The file's url. (Used to point to the file on the repository's website) - * @return fileUrl - */ - @javax.annotation.Nullable - public String getFileUrl() { - return fileUrl; - } - - public void setFileUrl(String fileUrl) { - this.fileUrl = fileUrl; - } - - - public ReferenceLines preLines(List preLines) { - this.preLines = preLines; - return this; - } - - public ReferenceLines addPreLinesItem(ReferenceLine preLinesItem) { - if (this.preLines == null) { - this.preLines = new ArrayList<>(); - } - this.preLines.add(preLinesItem); - return this; - } - - /** - * The lines before the actual reference line. - * @return preLines - */ - @javax.annotation.Nullable - public List getPreLines() { - return preLines; - } - - public void setPreLines(List preLines) { - this.preLines = preLines; - } - - - public ReferenceLines postLines(List postLines) { - this.postLines = postLines; - return this; - } - - public ReferenceLines addPostLinesItem(ReferenceLine postLinesItem) { - if (this.postLines == null) { - this.postLines = new ArrayList<>(); - } - this.postLines.add(postLinesItem); - return this; - } - - /** - * The lines after the actual reference line. - * @return postLines - */ - @javax.annotation.Nullable - public List getPostLines() { - return postLines; - } - - public void setPostLines(List postLines) { - this.postLines = postLines; - } - - - public ReferenceLines referenceLine(ReferenceLine referenceLine) { - this.referenceLine = referenceLine; - return this; - } - - /** - * Get referenceLine - * @return referenceLine - */ - @javax.annotation.Nonnull - public ReferenceLine getReferenceLine() { - return referenceLine; - } - - public void setReferenceLine(ReferenceLine referenceLine) { - this.referenceLine = referenceLine; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the ReferenceLines instance itself - */ - public ReferenceLines putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReferenceLines referenceLines = (ReferenceLines) o; - return Objects.equals(this._file, referenceLines._file) && - Objects.equals(this.fileUrl, referenceLines.fileUrl) && - Objects.equals(this.preLines, referenceLines.preLines) && - Objects.equals(this.postLines, referenceLines.postLines) && - Objects.equals(this.referenceLine, referenceLines.referenceLine)&& - Objects.equals(this.additionalProperties, referenceLines.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(_file, fileUrl, preLines, postLines, referenceLine, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReferenceLines {\n"); - sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); - sb.append(" fileUrl: ").append(toIndentedString(fileUrl)).append("\n"); - sb.append(" preLines: ").append(toIndentedString(preLines)).append("\n"); - sb.append(" postLines: ").append(toIndentedString(postLines)).append("\n"); - sb.append(" referenceLine: ").append(toIndentedString(referenceLine)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("file"); - openapiFields.add("fileUrl"); - openapiFields.add("preLines"); - openapiFields.add("postLines"); - openapiFields.add("referenceLine"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("file"); - openapiRequiredFields.add("referenceLine"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ReferenceLines - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ReferenceLines.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ReferenceLines is not found in the empty JSON string", ReferenceLines.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ReferenceLines.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("file").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `file` to be a primitive type in the JSON string but got `%s`", jsonObj.get("file").toString())); - } - if ((jsonObj.get("fileUrl") != null && !jsonObj.get("fileUrl").isJsonNull()) && !jsonObj.get("fileUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fileUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fileUrl").toString())); - } - if (jsonObj.get("preLines") != null && !jsonObj.get("preLines").isJsonNull()) { - JsonArray jsonArraypreLines = jsonObj.getAsJsonArray("preLines"); - if (jsonArraypreLines != null) { - // ensure the json data is an array - if (!jsonObj.get("preLines").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `preLines` to be an array in the JSON string but got `%s`", jsonObj.get("preLines").toString())); - } - - // validate the optional field `preLines` (array) - for (int i = 0; i < jsonArraypreLines.size(); i++) { - ReferenceLine.validateJsonElement(jsonArraypreLines.get(i)); - }; - } - } - if (jsonObj.get("postLines") != null && !jsonObj.get("postLines").isJsonNull()) { - JsonArray jsonArraypostLines = jsonObj.getAsJsonArray("postLines"); - if (jsonArraypostLines != null) { - // ensure the json data is an array - if (!jsonObj.get("postLines").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `postLines` to be an array in the JSON string but got `%s`", jsonObj.get("postLines").toString())); - } - - // validate the optional field `postLines` (array) - for (int i = 0; i < jsonArraypostLines.size(); i++) { - ReferenceLine.validateJsonElement(jsonArraypostLines.get(i)); - }; - } - } - // validate the required field `referenceLine` - ReferenceLine.validateJsonElement(jsonObj.get("referenceLine")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ReferenceLines.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ReferenceLines' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ReferenceLines.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ReferenceLines value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public ReferenceLines read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ReferenceLines instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ReferenceLines given an JSON string - * - * @param jsonString JSON string - * @return An instance of ReferenceLines - * @throws IOException if the JSON string is invalid with respect to ReferenceLines - */ - public static ReferenceLines fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ReferenceLines.class); - } - - /** - * Convert an instance of ReferenceLines to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ReplaceSettingModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ReplaceSettingModel.java deleted file mode 100644 index 5aea8be..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/ReplaceSettingModel.java +++ /dev/null @@ -1,402 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * ReplaceSettingModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class ReplaceSettingModel { - public static final String SERIALIZED_NAME_HINT = "hint"; - @SerializedName(SERIALIZED_NAME_HINT) - private String hint; - - public static final String SERIALIZED_NAME_TAGS = "tags"; - @SerializedName(SERIALIZED_NAME_TAGS) - private List tags; - - public static final String SERIALIZED_NAME_ORDER = "order"; - @SerializedName(SERIALIZED_NAME_ORDER) - private Integer order; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public ReplaceSettingModel() { - } - - public ReplaceSettingModel hint(String hint) { - this.hint = hint; - return this; - } - - /** - * A short description for the setting, shown on the Dashboard UI. - * @return hint - */ - @javax.annotation.Nullable - public String getHint() { - return hint; - } - - public void setHint(String hint) { - this.hint = hint; - } - - - public ReplaceSettingModel tags(List tags) { - this.tags = tags; - return this; - } - - public ReplaceSettingModel addTagsItem(Long tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * The IDs of the tags which are attached to the setting. - * @return tags - */ - @javax.annotation.Nullable - public List getTags() { - return tags; - } - - public void setTags(List tags) { - this.tags = tags; - } - - - public ReplaceSettingModel order(Integer order) { - this.order = order; - return this; - } - - /** - * The order of the Setting represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. - * @return order - */ - @javax.annotation.Nullable - public Integer getOrder() { - return order; - } - - public void setOrder(Integer order) { - this.order = order; - } - - - public ReplaceSettingModel name(String name) { - this.name = name; - return this; - } - - /** - * The name of the Feature Flag or Setting. - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the ReplaceSettingModel instance itself - */ - public ReplaceSettingModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReplaceSettingModel replaceSettingModel = (ReplaceSettingModel) o; - return Objects.equals(this.hint, replaceSettingModel.hint) && - Objects.equals(this.tags, replaceSettingModel.tags) && - Objects.equals(this.order, replaceSettingModel.order) && - Objects.equals(this.name, replaceSettingModel.name)&& - Objects.equals(this.additionalProperties, replaceSettingModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(hint, tags, order, name, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReplaceSettingModel {\n"); - sb.append(" hint: ").append(toIndentedString(hint)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("hint"); - openapiFields.add("tags"); - openapiFields.add("order"); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ReplaceSettingModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ReplaceSettingModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ReplaceSettingModel is not found in the empty JSON string", ReplaceSettingModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ReplaceSettingModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("hint") != null && !jsonObj.get("hint").isJsonNull()) && !jsonObj.get("hint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hint").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull() && !jsonObj.get("tags").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ReplaceSettingModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ReplaceSettingModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ReplaceSettingModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ReplaceSettingModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public ReplaceSettingModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ReplaceSettingModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ReplaceSettingModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of ReplaceSettingModel - * @throws IOException if the JSON string is invalid with respect to ReplaceSettingModel - */ - public static ReplaceSettingModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ReplaceSettingModel.class); - } - - /** - * Convert an instance of ReplaceSettingModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/RolloutPercentageItemModel.java b/src/main/java/com/configcat/publicapi/java/client/model/RolloutPercentageItemModel.java deleted file mode 100644 index 609c4fe..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/RolloutPercentageItemModel.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * RolloutPercentageItemModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class RolloutPercentageItemModel { - public static final String SERIALIZED_NAME_PERCENTAGE = "percentage"; - @SerializedName(SERIALIZED_NAME_PERCENTAGE) - private Long percentage; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private Object value = null; - - public RolloutPercentageItemModel() { - } - - public RolloutPercentageItemModel percentage(Long percentage) { - this.percentage = percentage; - return this; - } - - /** - * The percentage value for the rule. - * @return percentage - */ - @javax.annotation.Nonnull - public Long getPercentage() { - return percentage; - } - - public void setPercentage(Long percentage) { - this.percentage = percentage; - } - - - public RolloutPercentageItemModel value(Object value) { - this.value = value; - return this; - } - - /** - * The value to serve when the user falls in the percentage rule. It must respect the setting type. - * @return value - */ - @javax.annotation.Nullable - public Object getValue() { - return value; - } - - public void setValue(Object value) { - this.value = value; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the RolloutPercentageItemModel instance itself - */ - public RolloutPercentageItemModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RolloutPercentageItemModel rolloutPercentageItemModel = (RolloutPercentageItemModel) o; - return Objects.equals(this.percentage, rolloutPercentageItemModel.percentage) && - Objects.equals(this.value, rolloutPercentageItemModel.value)&& - Objects.equals(this.additionalProperties, rolloutPercentageItemModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(percentage, value, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RolloutPercentageItemModel {\n"); - sb.append(" percentage: ").append(toIndentedString(percentage)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("percentage"); - openapiFields.add("value"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("percentage"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RolloutPercentageItemModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!RolloutPercentageItemModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in RolloutPercentageItemModel is not found in the empty JSON string", RolloutPercentageItemModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : RolloutPercentageItemModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RolloutPercentageItemModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RolloutPercentageItemModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(RolloutPercentageItemModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, RolloutPercentageItemModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public RolloutPercentageItemModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - RolloutPercentageItemModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of RolloutPercentageItemModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of RolloutPercentageItemModel - * @throws IOException if the JSON string is invalid with respect to RolloutPercentageItemModel - */ - public static RolloutPercentageItemModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RolloutPercentageItemModel.class); - } - - /** - * Convert an instance of RolloutPercentageItemModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/RolloutRuleComparator.java b/src/main/java/com/configcat/publicapi/java/client/model/RolloutRuleComparator.java deleted file mode 100644 index b7fbb7c..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/RolloutRuleComparator.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * The comparison operator the evaluation process must use when it compares the given user attribute's value with the comparison value. - */ -@JsonAdapter(RolloutRuleComparator.Adapter.class) -public enum RolloutRuleComparator { - - IS_ONE_OF("isOneOf"), - - IS_NOT_ONE_OF("isNotOneOf"), - - CONTAINS("contains"), - - DOES_NOT_CONTAIN("doesNotContain"), - - SEM_VER_IS_ONE_OF("semVerIsOneOf"), - - SEM_VER_IS_NOT_ONE_OF("semVerIsNotOneOf"), - - SEM_VER_LESS("semVerLess"), - - SEM_VER_LESS_OR_EQUALS("semVerLessOrEquals"), - - SEM_VER_GREATER("semVerGreater"), - - SEM_VER_GREATER_OR_EQUALS("semVerGreaterOrEquals"), - - NUMBER_EQUALS("numberEquals"), - - NUMBER_DOES_NOT_EQUAL("numberDoesNotEqual"), - - NUMBER_LESS("numberLess"), - - NUMBER_LESS_OR_EQUALS("numberLessOrEquals"), - - NUMBER_GREATER("numberGreater"), - - NUMBER_GREATER_OR_EQUALS("numberGreaterOrEquals"), - - SENSITIVE_IS_ONE_OF("sensitiveIsOneOf"), - - SENSITIVE_IS_NOT_ONE_OF("sensitiveIsNotOneOf"); - - private String value; - - RolloutRuleComparator(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static RolloutRuleComparator fromValue(String value) { - for (RolloutRuleComparator b : RolloutRuleComparator.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final RolloutRuleComparator enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public RolloutRuleComparator read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return RolloutRuleComparator.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - RolloutRuleComparator.fromValue(value); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/RolloutRuleModel.java b/src/main/java/com/configcat/publicapi/java/client/model/RolloutRuleModel.java deleted file mode 100644 index c56ac7c..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/RolloutRuleModel.java +++ /dev/null @@ -1,446 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.RolloutRuleComparator; -import com.configcat.publicapi.java.client.model.SegmentComparator; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * RolloutRuleModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class RolloutRuleModel { - public static final String SERIALIZED_NAME_COMPARISON_ATTRIBUTE = "comparisonAttribute"; - @SerializedName(SERIALIZED_NAME_COMPARISON_ATTRIBUTE) - private String comparisonAttribute; - - public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; - @SerializedName(SERIALIZED_NAME_COMPARATOR) - private RolloutRuleComparator comparator; - - public static final String SERIALIZED_NAME_COMPARISON_VALUE = "comparisonValue"; - @SerializedName(SERIALIZED_NAME_COMPARISON_VALUE) - private String comparisonValue; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private Object value = null; - - public static final String SERIALIZED_NAME_SEGMENT_COMPARATOR = "segmentComparator"; - @SerializedName(SERIALIZED_NAME_SEGMENT_COMPARATOR) - private SegmentComparator segmentComparator; - - public static final String SERIALIZED_NAME_SEGMENT_ID = "segmentId"; - @SerializedName(SERIALIZED_NAME_SEGMENT_ID) - private UUID segmentId; - - public RolloutRuleModel() { - } - - public RolloutRuleModel comparisonAttribute(String comparisonAttribute) { - this.comparisonAttribute = comparisonAttribute; - return this; - } - - /** - * The user attribute to compare. - * @return comparisonAttribute - */ - @javax.annotation.Nullable - public String getComparisonAttribute() { - return comparisonAttribute; - } - - public void setComparisonAttribute(String comparisonAttribute) { - this.comparisonAttribute = comparisonAttribute; - } - - - public RolloutRuleModel comparator(RolloutRuleComparator comparator) { - this.comparator = comparator; - return this; - } - - /** - * Get comparator - * @return comparator - */ - @javax.annotation.Nullable - public RolloutRuleComparator getComparator() { - return comparator; - } - - public void setComparator(RolloutRuleComparator comparator) { - this.comparator = comparator; - } - - - public RolloutRuleModel comparisonValue(String comparisonValue) { - this.comparisonValue = comparisonValue; - return this; - } - - /** - * The value to compare against. - * @return comparisonValue - */ - @javax.annotation.Nullable - public String getComparisonValue() { - return comparisonValue; - } - - public void setComparisonValue(String comparisonValue) { - this.comparisonValue = comparisonValue; - } - - - public RolloutRuleModel value(Object value) { - this.value = value; - return this; - } - - /** - * The value to serve when the comparison matches. It must respect the setting type. - * @return value - */ - @javax.annotation.Nullable - public Object getValue() { - return value; - } - - public void setValue(Object value) { - this.value = value; - } - - - public RolloutRuleModel segmentComparator(SegmentComparator segmentComparator) { - this.segmentComparator = segmentComparator; - return this; - } - - /** - * Get segmentComparator - * @return segmentComparator - */ - @javax.annotation.Nullable - public SegmentComparator getSegmentComparator() { - return segmentComparator; - } - - public void setSegmentComparator(SegmentComparator segmentComparator) { - this.segmentComparator = segmentComparator; - } - - - public RolloutRuleModel segmentId(UUID segmentId) { - this.segmentId = segmentId; - return this; - } - - /** - * The segment to compare against. - * @return segmentId - */ - @javax.annotation.Nullable - public UUID getSegmentId() { - return segmentId; - } - - public void setSegmentId(UUID segmentId) { - this.segmentId = segmentId; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the RolloutRuleModel instance itself - */ - public RolloutRuleModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RolloutRuleModel rolloutRuleModel = (RolloutRuleModel) o; - return Objects.equals(this.comparisonAttribute, rolloutRuleModel.comparisonAttribute) && - Objects.equals(this.comparator, rolloutRuleModel.comparator) && - Objects.equals(this.comparisonValue, rolloutRuleModel.comparisonValue) && - Objects.equals(this.value, rolloutRuleModel.value) && - Objects.equals(this.segmentComparator, rolloutRuleModel.segmentComparator) && - Objects.equals(this.segmentId, rolloutRuleModel.segmentId)&& - Objects.equals(this.additionalProperties, rolloutRuleModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(comparisonAttribute, comparator, comparisonValue, value, segmentComparator, segmentId, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RolloutRuleModel {\n"); - sb.append(" comparisonAttribute: ").append(toIndentedString(comparisonAttribute)).append("\n"); - sb.append(" comparator: ").append(toIndentedString(comparator)).append("\n"); - sb.append(" comparisonValue: ").append(toIndentedString(comparisonValue)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" segmentComparator: ").append(toIndentedString(segmentComparator)).append("\n"); - sb.append(" segmentId: ").append(toIndentedString(segmentId)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("comparisonAttribute"); - openapiFields.add("comparator"); - openapiFields.add("comparisonValue"); - openapiFields.add("value"); - openapiFields.add("segmentComparator"); - openapiFields.add("segmentId"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RolloutRuleModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!RolloutRuleModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in RolloutRuleModel is not found in the empty JSON string", RolloutRuleModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("comparisonAttribute") != null && !jsonObj.get("comparisonAttribute").isJsonNull()) && !jsonObj.get("comparisonAttribute").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `comparisonAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonAttribute").toString())); - } - // validate the optional field `comparator` - if (jsonObj.get("comparator") != null && !jsonObj.get("comparator").isJsonNull()) { - RolloutRuleComparator.validateJsonElement(jsonObj.get("comparator")); - } - if ((jsonObj.get("comparisonValue") != null && !jsonObj.get("comparisonValue").isJsonNull()) && !jsonObj.get("comparisonValue").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `comparisonValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonValue").toString())); - } - // validate the optional field `segmentComparator` - if (jsonObj.get("segmentComparator") != null && !jsonObj.get("segmentComparator").isJsonNull()) { - SegmentComparator.validateJsonElement(jsonObj.get("segmentComparator")); - } - if ((jsonObj.get("segmentId") != null && !jsonObj.get("segmentId").isJsonNull()) && !jsonObj.get("segmentId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `segmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("segmentId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RolloutRuleModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RolloutRuleModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(RolloutRuleModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, RolloutRuleModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public RolloutRuleModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - RolloutRuleModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of RolloutRuleModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of RolloutRuleModel - * @throws IOException if the JSON string is invalid with respect to RolloutRuleModel - */ - public static RolloutRuleModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RolloutRuleModel.class); - } - - /** - * Convert an instance of RolloutRuleModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SdkKeysModel.java b/src/main/java/com/configcat/publicapi/java/client/model/SdkKeysModel.java deleted file mode 100644 index 86cb5f2..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/SdkKeysModel.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * SdkKeysModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class SdkKeysModel { - public static final String SERIALIZED_NAME_PRIMARY = "primary"; - @SerializedName(SERIALIZED_NAME_PRIMARY) - private String primary; - - public static final String SERIALIZED_NAME_SECONDARY = "secondary"; - @SerializedName(SERIALIZED_NAME_SECONDARY) - private String secondary; - - public SdkKeysModel() { - } - - public SdkKeysModel primary(String primary) { - this.primary = primary; - return this; - } - - /** - * The primary SDK key. - * @return primary - */ - @javax.annotation.Nullable - public String getPrimary() { - return primary; - } - - public void setPrimary(String primary) { - this.primary = primary; - } - - - public SdkKeysModel secondary(String secondary) { - this.secondary = secondary; - return this; - } - - /** - * The secondary SDK key. - * @return secondary - */ - @javax.annotation.Nullable - public String getSecondary() { - return secondary; - } - - public void setSecondary(String secondary) { - this.secondary = secondary; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the SdkKeysModel instance itself - */ - public SdkKeysModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SdkKeysModel sdkKeysModel = (SdkKeysModel) o; - return Objects.equals(this.primary, sdkKeysModel.primary) && - Objects.equals(this.secondary, sdkKeysModel.secondary)&& - Objects.equals(this.additionalProperties, sdkKeysModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(primary, secondary, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SdkKeysModel {\n"); - sb.append(" primary: ").append(toIndentedString(primary)).append("\n"); - sb.append(" secondary: ").append(toIndentedString(secondary)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("primary"); - openapiFields.add("secondary"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SdkKeysModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SdkKeysModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SdkKeysModel is not found in the empty JSON string", SdkKeysModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("primary") != null && !jsonObj.get("primary").isJsonNull()) && !jsonObj.get("primary").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `primary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("primary").toString())); - } - if ((jsonObj.get("secondary") != null && !jsonObj.get("secondary").isJsonNull()) && !jsonObj.get("secondary").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `secondary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secondary").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SdkKeysModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SdkKeysModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SdkKeysModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SdkKeysModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public SdkKeysModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - SdkKeysModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SdkKeysModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of SdkKeysModel - * @throws IOException if the JSON string is invalid with respect to SdkKeysModel - */ - public static SdkKeysModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SdkKeysModel.class); - } - - /** - * Convert an instance of SdkKeysModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SegmentComparator.java b/src/main/java/com/configcat/publicapi/java/client/model/SegmentComparator.java deleted file mode 100644 index 23e3626..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/SegmentComparator.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * The segment comparison operator used during the evaluation process. - */ -@JsonAdapter(SegmentComparator.Adapter.class) -public enum SegmentComparator { - - IS_IN("isIn"), - - IS_NOT_IN("isNotIn"); - - private String value; - - SegmentComparator(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static SegmentComparator fromValue(String value) { - for (SegmentComparator b : SegmentComparator.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final SegmentComparator enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public SegmentComparator read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return SegmentComparator.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - SegmentComparator.fromValue(value); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SegmentConditionModel.java b/src/main/java/com/configcat/publicapi/java/client/model/SegmentConditionModel.java deleted file mode 100644 index 6018f51..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/SegmentConditionModel.java +++ /dev/null @@ -1,326 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.SegmentComparator; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.UUID; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * Describes a condition that is based on a segment. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class SegmentConditionModel { - public static final String SERIALIZED_NAME_SEGMENT_ID = "segmentId"; - @SerializedName(SERIALIZED_NAME_SEGMENT_ID) - private UUID segmentId; - - public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; - @SerializedName(SERIALIZED_NAME_COMPARATOR) - private SegmentComparator comparator; - - public SegmentConditionModel() { - } - - public SegmentConditionModel segmentId(UUID segmentId) { - this.segmentId = segmentId; - return this; - } - - /** - * The segment's identifier. - * @return segmentId - */ - @javax.annotation.Nonnull - public UUID getSegmentId() { - return segmentId; - } - - public void setSegmentId(UUID segmentId) { - this.segmentId = segmentId; - } - - - public SegmentConditionModel comparator(SegmentComparator comparator) { - this.comparator = comparator; - return this; - } - - /** - * Get comparator - * @return comparator - */ - @javax.annotation.Nonnull - public SegmentComparator getComparator() { - return comparator; - } - - public void setComparator(SegmentComparator comparator) { - this.comparator = comparator; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the SegmentConditionModel instance itself - */ - public SegmentConditionModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SegmentConditionModel segmentConditionModel = (SegmentConditionModel) o; - return Objects.equals(this.segmentId, segmentConditionModel.segmentId) && - Objects.equals(this.comparator, segmentConditionModel.comparator)&& - Objects.equals(this.additionalProperties, segmentConditionModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(segmentId, comparator, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SegmentConditionModel {\n"); - sb.append(" segmentId: ").append(toIndentedString(segmentId)).append("\n"); - sb.append(" comparator: ").append(toIndentedString(comparator)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("segmentId"); - openapiFields.add("comparator"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("segmentId"); - openapiRequiredFields.add("comparator"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SegmentConditionModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SegmentConditionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SegmentConditionModel is not found in the empty JSON string", SegmentConditionModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SegmentConditionModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("segmentId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `segmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("segmentId").toString())); - } - // validate the required field `comparator` - SegmentComparator.validateJsonElement(jsonObj.get("comparator")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SegmentConditionModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SegmentConditionModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SegmentConditionModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SegmentConditionModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public SegmentConditionModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - SegmentConditionModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SegmentConditionModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of SegmentConditionModel - * @throws IOException if the JSON string is invalid with respect to SegmentConditionModel - */ - public static SegmentConditionModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SegmentConditionModel.class); - } - - /** - * Convert an instance of SegmentConditionModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SegmentListModel.java b/src/main/java/com/configcat/publicapi/java/client/model/SegmentListModel.java deleted file mode 100644 index f417c76..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/SegmentListModel.java +++ /dev/null @@ -1,584 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.ProductModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * SegmentListModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class SegmentListModel { - public static final String SERIALIZED_NAME_PRODUCT = "product"; - @SerializedName(SERIALIZED_NAME_PRODUCT) - private ProductModel product; - - public static final String SERIALIZED_NAME_SEGMENT_ID = "segmentId"; - @SerializedName(SERIALIZED_NAME_SEGMENT_ID) - private UUID segmentId; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_CREATOR_EMAIL = "creatorEmail"; - @SerializedName(SERIALIZED_NAME_CREATOR_EMAIL) - private String creatorEmail; - - public static final String SERIALIZED_NAME_CREATOR_FULL_NAME = "creatorFullName"; - @SerializedName(SERIALIZED_NAME_CREATOR_FULL_NAME) - private String creatorFullName; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_LAST_UPDATER_EMAIL = "lastUpdaterEmail"; - @SerializedName(SERIALIZED_NAME_LAST_UPDATER_EMAIL) - private String lastUpdaterEmail; - - public static final String SERIALIZED_NAME_LAST_UPDATER_FULL_NAME = "lastUpdaterFullName"; - @SerializedName(SERIALIZED_NAME_LAST_UPDATER_FULL_NAME) - private String lastUpdaterFullName; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private OffsetDateTime updatedAt; - - public static final String SERIALIZED_NAME_USAGE = "usage"; - @SerializedName(SERIALIZED_NAME_USAGE) - private Integer usage; - - public SegmentListModel() { - } - - public SegmentListModel product(ProductModel product) { - this.product = product; - return this; - } - - /** - * Get product - * @return product - */ - @javax.annotation.Nullable - public ProductModel getProduct() { - return product; - } - - public void setProduct(ProductModel product) { - this.product = product; - } - - - public SegmentListModel segmentId(UUID segmentId) { - this.segmentId = segmentId; - return this; - } - - /** - * Identifier of the Segment. - * @return segmentId - */ - @javax.annotation.Nullable - public UUID getSegmentId() { - return segmentId; - } - - public void setSegmentId(UUID segmentId) { - this.segmentId = segmentId; - } - - - public SegmentListModel name(String name) { - this.name = name; - return this; - } - - /** - * Name of the Segment. - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public SegmentListModel description(String description) { - this.description = description; - return this; - } - - /** - * Description of the Segment. - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - - public SegmentListModel creatorEmail(String creatorEmail) { - this.creatorEmail = creatorEmail; - return this; - } - - /** - * The email of the user who created the Segment. - * @return creatorEmail - */ - @javax.annotation.Nullable - public String getCreatorEmail() { - return creatorEmail; - } - - public void setCreatorEmail(String creatorEmail) { - this.creatorEmail = creatorEmail; - } - - - public SegmentListModel creatorFullName(String creatorFullName) { - this.creatorFullName = creatorFullName; - return this; - } - - /** - * The name of the user who created the Segment. - * @return creatorFullName - */ - @javax.annotation.Nullable - public String getCreatorFullName() { - return creatorFullName; - } - - public void setCreatorFullName(String creatorFullName) { - this.creatorFullName = creatorFullName; - } - - - public SegmentListModel createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * The date and time when the Segment was created. - * @return createdAt - */ - @javax.annotation.Nullable - public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - - public SegmentListModel lastUpdaterEmail(String lastUpdaterEmail) { - this.lastUpdaterEmail = lastUpdaterEmail; - return this; - } - - /** - * The email of the user who last updated the Segment. - * @return lastUpdaterEmail - */ - @javax.annotation.Nullable - public String getLastUpdaterEmail() { - return lastUpdaterEmail; - } - - public void setLastUpdaterEmail(String lastUpdaterEmail) { - this.lastUpdaterEmail = lastUpdaterEmail; - } - - - public SegmentListModel lastUpdaterFullName(String lastUpdaterFullName) { - this.lastUpdaterFullName = lastUpdaterFullName; - return this; - } - - /** - * The name of the user who last updated the Segment. - * @return lastUpdaterFullName - */ - @javax.annotation.Nullable - public String getLastUpdaterFullName() { - return lastUpdaterFullName; - } - - public void setLastUpdaterFullName(String lastUpdaterFullName) { - this.lastUpdaterFullName = lastUpdaterFullName; - } - - - public SegmentListModel updatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * The date and time when the Segment was last updated. - * @return updatedAt - */ - @javax.annotation.Nullable - public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - } - - - public SegmentListModel usage(Integer usage) { - this.usage = usage; - return this; - } - - /** - * Determines how many Feature Flags and Settings are using the Segment. - * @return usage - */ - @javax.annotation.Nullable - public Integer getUsage() { - return usage; - } - - public void setUsage(Integer usage) { - this.usage = usage; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the SegmentListModel instance itself - */ - public SegmentListModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SegmentListModel segmentListModel = (SegmentListModel) o; - return Objects.equals(this.product, segmentListModel.product) && - Objects.equals(this.segmentId, segmentListModel.segmentId) && - Objects.equals(this.name, segmentListModel.name) && - Objects.equals(this.description, segmentListModel.description) && - Objects.equals(this.creatorEmail, segmentListModel.creatorEmail) && - Objects.equals(this.creatorFullName, segmentListModel.creatorFullName) && - Objects.equals(this.createdAt, segmentListModel.createdAt) && - Objects.equals(this.lastUpdaterEmail, segmentListModel.lastUpdaterEmail) && - Objects.equals(this.lastUpdaterFullName, segmentListModel.lastUpdaterFullName) && - Objects.equals(this.updatedAt, segmentListModel.updatedAt) && - Objects.equals(this.usage, segmentListModel.usage)&& - Objects.equals(this.additionalProperties, segmentListModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(product, segmentId, name, description, creatorEmail, creatorFullName, createdAt, lastUpdaterEmail, lastUpdaterFullName, updatedAt, usage, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SegmentListModel {\n"); - sb.append(" product: ").append(toIndentedString(product)).append("\n"); - sb.append(" segmentId: ").append(toIndentedString(segmentId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" creatorEmail: ").append(toIndentedString(creatorEmail)).append("\n"); - sb.append(" creatorFullName: ").append(toIndentedString(creatorFullName)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" lastUpdaterEmail: ").append(toIndentedString(lastUpdaterEmail)).append("\n"); - sb.append(" lastUpdaterFullName: ").append(toIndentedString(lastUpdaterFullName)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" usage: ").append(toIndentedString(usage)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("product"); - openapiFields.add("segmentId"); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("creatorEmail"); - openapiFields.add("creatorFullName"); - openapiFields.add("createdAt"); - openapiFields.add("lastUpdaterEmail"); - openapiFields.add("lastUpdaterFullName"); - openapiFields.add("updatedAt"); - openapiFields.add("usage"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SegmentListModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SegmentListModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SegmentListModel is not found in the empty JSON string", SegmentListModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `product` - if (jsonObj.get("product") != null && !jsonObj.get("product").isJsonNull()) { - ProductModel.validateJsonElement(jsonObj.get("product")); - } - if ((jsonObj.get("segmentId") != null && !jsonObj.get("segmentId").isJsonNull()) && !jsonObj.get("segmentId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `segmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("segmentId").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if ((jsonObj.get("creatorEmail") != null && !jsonObj.get("creatorEmail").isJsonNull()) && !jsonObj.get("creatorEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `creatorEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creatorEmail").toString())); - } - if ((jsonObj.get("creatorFullName") != null && !jsonObj.get("creatorFullName").isJsonNull()) && !jsonObj.get("creatorFullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `creatorFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creatorFullName").toString())); - } - if ((jsonObj.get("lastUpdaterEmail") != null && !jsonObj.get("lastUpdaterEmail").isJsonNull()) && !jsonObj.get("lastUpdaterEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterEmail").toString())); - } - if ((jsonObj.get("lastUpdaterFullName") != null && !jsonObj.get("lastUpdaterFullName").isJsonNull()) && !jsonObj.get("lastUpdaterFullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterFullName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SegmentListModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SegmentListModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SegmentListModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SegmentListModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public SegmentListModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - SegmentListModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SegmentListModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of SegmentListModel - * @throws IOException if the JSON string is invalid with respect to SegmentListModel - */ - public static SegmentListModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SegmentListModel.class); - } - - /** - * Convert an instance of SegmentListModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SegmentModel.java b/src/main/java/com/configcat/publicapi/java/client/model/SegmentModel.java deleted file mode 100644 index a9d1ec6..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/SegmentModel.java +++ /dev/null @@ -1,647 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.ProductModel; -import com.configcat.publicapi.java.client.model.RolloutRuleComparator; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * SegmentModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class SegmentModel { - public static final String SERIALIZED_NAME_PRODUCT = "product"; - @SerializedName(SERIALIZED_NAME_PRODUCT) - private ProductModel product; - - public static final String SERIALIZED_NAME_SEGMENT_ID = "segmentId"; - @SerializedName(SERIALIZED_NAME_SEGMENT_ID) - private UUID segmentId; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_CREATOR_EMAIL = "creatorEmail"; - @SerializedName(SERIALIZED_NAME_CREATOR_EMAIL) - private String creatorEmail; - - public static final String SERIALIZED_NAME_CREATOR_FULL_NAME = "creatorFullName"; - @SerializedName(SERIALIZED_NAME_CREATOR_FULL_NAME) - private String creatorFullName; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_LAST_UPDATER_EMAIL = "lastUpdaterEmail"; - @SerializedName(SERIALIZED_NAME_LAST_UPDATER_EMAIL) - private String lastUpdaterEmail; - - public static final String SERIALIZED_NAME_LAST_UPDATER_FULL_NAME = "lastUpdaterFullName"; - @SerializedName(SERIALIZED_NAME_LAST_UPDATER_FULL_NAME) - private String lastUpdaterFullName; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private OffsetDateTime updatedAt; - - public static final String SERIALIZED_NAME_COMPARISON_ATTRIBUTE = "comparisonAttribute"; - @SerializedName(SERIALIZED_NAME_COMPARISON_ATTRIBUTE) - private String comparisonAttribute; - - public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; - @SerializedName(SERIALIZED_NAME_COMPARATOR) - private RolloutRuleComparator comparator; - - public static final String SERIALIZED_NAME_COMPARISON_VALUE = "comparisonValue"; - @SerializedName(SERIALIZED_NAME_COMPARISON_VALUE) - private String comparisonValue; - - public SegmentModel() { - } - - public SegmentModel product(ProductModel product) { - this.product = product; - return this; - } - - /** - * Get product - * @return product - */ - @javax.annotation.Nullable - public ProductModel getProduct() { - return product; - } - - public void setProduct(ProductModel product) { - this.product = product; - } - - - public SegmentModel segmentId(UUID segmentId) { - this.segmentId = segmentId; - return this; - } - - /** - * Identifier of the Segment. - * @return segmentId - */ - @javax.annotation.Nullable - public UUID getSegmentId() { - return segmentId; - } - - public void setSegmentId(UUID segmentId) { - this.segmentId = segmentId; - } - - - public SegmentModel name(String name) { - this.name = name; - return this; - } - - /** - * Name of the Segment. - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public SegmentModel description(String description) { - this.description = description; - return this; - } - - /** - * Description of the Segment. - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - - public SegmentModel creatorEmail(String creatorEmail) { - this.creatorEmail = creatorEmail; - return this; - } - - /** - * The email of the user who created the Segment. - * @return creatorEmail - */ - @javax.annotation.Nullable - public String getCreatorEmail() { - return creatorEmail; - } - - public void setCreatorEmail(String creatorEmail) { - this.creatorEmail = creatorEmail; - } - - - public SegmentModel creatorFullName(String creatorFullName) { - this.creatorFullName = creatorFullName; - return this; - } - - /** - * The name of the user who created the Segment. - * @return creatorFullName - */ - @javax.annotation.Nullable - public String getCreatorFullName() { - return creatorFullName; - } - - public void setCreatorFullName(String creatorFullName) { - this.creatorFullName = creatorFullName; - } - - - public SegmentModel createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * The date and time when the Segment was created. - * @return createdAt - */ - @javax.annotation.Nullable - public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - - public SegmentModel lastUpdaterEmail(String lastUpdaterEmail) { - this.lastUpdaterEmail = lastUpdaterEmail; - return this; - } - - /** - * The email of the user who last updated the Segment. - * @return lastUpdaterEmail - */ - @javax.annotation.Nullable - public String getLastUpdaterEmail() { - return lastUpdaterEmail; - } - - public void setLastUpdaterEmail(String lastUpdaterEmail) { - this.lastUpdaterEmail = lastUpdaterEmail; - } - - - public SegmentModel lastUpdaterFullName(String lastUpdaterFullName) { - this.lastUpdaterFullName = lastUpdaterFullName; - return this; - } - - /** - * The name of the user who last updated the Segment. - * @return lastUpdaterFullName - */ - @javax.annotation.Nullable - public String getLastUpdaterFullName() { - return lastUpdaterFullName; - } - - public void setLastUpdaterFullName(String lastUpdaterFullName) { - this.lastUpdaterFullName = lastUpdaterFullName; - } - - - public SegmentModel updatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * The date and time when the Segment was last updated. - * @return updatedAt - */ - @javax.annotation.Nullable - public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - } - - - public SegmentModel comparisonAttribute(String comparisonAttribute) { - this.comparisonAttribute = comparisonAttribute; - return this; - } - - /** - * The user's attribute the evaluation process must take into account. - * @return comparisonAttribute - */ - @javax.annotation.Nullable - public String getComparisonAttribute() { - return comparisonAttribute; - } - - public void setComparisonAttribute(String comparisonAttribute) { - this.comparisonAttribute = comparisonAttribute; - } - - - public SegmentModel comparator(RolloutRuleComparator comparator) { - this.comparator = comparator; - return this; - } - - /** - * Get comparator - * @return comparator - */ - @javax.annotation.Nullable - public RolloutRuleComparator getComparator() { - return comparator; - } - - public void setComparator(RolloutRuleComparator comparator) { - this.comparator = comparator; - } - - - public SegmentModel comparisonValue(String comparisonValue) { - this.comparisonValue = comparisonValue; - return this; - } - - /** - * The value to compare with the given user attribute's value. - * @return comparisonValue - */ - @javax.annotation.Nullable - public String getComparisonValue() { - return comparisonValue; - } - - public void setComparisonValue(String comparisonValue) { - this.comparisonValue = comparisonValue; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the SegmentModel instance itself - */ - public SegmentModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SegmentModel segmentModel = (SegmentModel) o; - return Objects.equals(this.product, segmentModel.product) && - Objects.equals(this.segmentId, segmentModel.segmentId) && - Objects.equals(this.name, segmentModel.name) && - Objects.equals(this.description, segmentModel.description) && - Objects.equals(this.creatorEmail, segmentModel.creatorEmail) && - Objects.equals(this.creatorFullName, segmentModel.creatorFullName) && - Objects.equals(this.createdAt, segmentModel.createdAt) && - Objects.equals(this.lastUpdaterEmail, segmentModel.lastUpdaterEmail) && - Objects.equals(this.lastUpdaterFullName, segmentModel.lastUpdaterFullName) && - Objects.equals(this.updatedAt, segmentModel.updatedAt) && - Objects.equals(this.comparisonAttribute, segmentModel.comparisonAttribute) && - Objects.equals(this.comparator, segmentModel.comparator) && - Objects.equals(this.comparisonValue, segmentModel.comparisonValue)&& - Objects.equals(this.additionalProperties, segmentModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(product, segmentId, name, description, creatorEmail, creatorFullName, createdAt, lastUpdaterEmail, lastUpdaterFullName, updatedAt, comparisonAttribute, comparator, comparisonValue, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SegmentModel {\n"); - sb.append(" product: ").append(toIndentedString(product)).append("\n"); - sb.append(" segmentId: ").append(toIndentedString(segmentId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" creatorEmail: ").append(toIndentedString(creatorEmail)).append("\n"); - sb.append(" creatorFullName: ").append(toIndentedString(creatorFullName)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" lastUpdaterEmail: ").append(toIndentedString(lastUpdaterEmail)).append("\n"); - sb.append(" lastUpdaterFullName: ").append(toIndentedString(lastUpdaterFullName)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" comparisonAttribute: ").append(toIndentedString(comparisonAttribute)).append("\n"); - sb.append(" comparator: ").append(toIndentedString(comparator)).append("\n"); - sb.append(" comparisonValue: ").append(toIndentedString(comparisonValue)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("product"); - openapiFields.add("segmentId"); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("creatorEmail"); - openapiFields.add("creatorFullName"); - openapiFields.add("createdAt"); - openapiFields.add("lastUpdaterEmail"); - openapiFields.add("lastUpdaterFullName"); - openapiFields.add("updatedAt"); - openapiFields.add("comparisonAttribute"); - openapiFields.add("comparator"); - openapiFields.add("comparisonValue"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SegmentModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SegmentModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SegmentModel is not found in the empty JSON string", SegmentModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `product` - if (jsonObj.get("product") != null && !jsonObj.get("product").isJsonNull()) { - ProductModel.validateJsonElement(jsonObj.get("product")); - } - if ((jsonObj.get("segmentId") != null && !jsonObj.get("segmentId").isJsonNull()) && !jsonObj.get("segmentId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `segmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("segmentId").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if ((jsonObj.get("creatorEmail") != null && !jsonObj.get("creatorEmail").isJsonNull()) && !jsonObj.get("creatorEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `creatorEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creatorEmail").toString())); - } - if ((jsonObj.get("creatorFullName") != null && !jsonObj.get("creatorFullName").isJsonNull()) && !jsonObj.get("creatorFullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `creatorFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creatorFullName").toString())); - } - if ((jsonObj.get("lastUpdaterEmail") != null && !jsonObj.get("lastUpdaterEmail").isJsonNull()) && !jsonObj.get("lastUpdaterEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterEmail").toString())); - } - if ((jsonObj.get("lastUpdaterFullName") != null && !jsonObj.get("lastUpdaterFullName").isJsonNull()) && !jsonObj.get("lastUpdaterFullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterFullName").toString())); - } - if ((jsonObj.get("comparisonAttribute") != null && !jsonObj.get("comparisonAttribute").isJsonNull()) && !jsonObj.get("comparisonAttribute").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `comparisonAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonAttribute").toString())); - } - // validate the optional field `comparator` - if (jsonObj.get("comparator") != null && !jsonObj.get("comparator").isJsonNull()) { - RolloutRuleComparator.validateJsonElement(jsonObj.get("comparator")); - } - if ((jsonObj.get("comparisonValue") != null && !jsonObj.get("comparisonValue").isJsonNull()) && !jsonObj.get("comparisonValue").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `comparisonValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonValue").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SegmentModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SegmentModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SegmentModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SegmentModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public SegmentModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - SegmentModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SegmentModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of SegmentModel - * @throws IOException if the JSON string is invalid with respect to SegmentModel - */ - public static SegmentModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SegmentModel.class); - } - - /** - * Convert an instance of SegmentModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SettingDataModel.java b/src/main/java/com/configcat/publicapi/java/client/model/SettingDataModel.java deleted file mode 100644 index e0673a7..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/SettingDataModel.java +++ /dev/null @@ -1,551 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.SettingType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * Metadata of a Feature Flag or Setting. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class SettingDataModel { - public static final String SERIALIZED_NAME_SETTING_ID = "settingId"; - @SerializedName(SERIALIZED_NAME_SETTING_ID) - private Integer settingId; - - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_HINT = "hint"; - @SerializedName(SERIALIZED_NAME_HINT) - private String hint; - - public static final String SERIALIZED_NAME_SETTING_TYPE = "settingType"; - @SerializedName(SERIALIZED_NAME_SETTING_TYPE) - private SettingType settingType; - - public static final String SERIALIZED_NAME_ORDER = "order"; - @SerializedName(SERIALIZED_NAME_ORDER) - private Integer order; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_CREATOR_EMAIL = "creatorEmail"; - @SerializedName(SERIALIZED_NAME_CREATOR_EMAIL) - private String creatorEmail; - - public static final String SERIALIZED_NAME_CREATOR_FULL_NAME = "creatorFullName"; - @SerializedName(SERIALIZED_NAME_CREATOR_FULL_NAME) - private String creatorFullName; - - public static final String SERIALIZED_NAME_IS_WATCHING = "isWatching"; - @SerializedName(SERIALIZED_NAME_IS_WATCHING) - private Boolean isWatching; - - public SettingDataModel() { - } - - public SettingDataModel settingId(Integer settingId) { - this.settingId = settingId; - return this; - } - - /** - * Identifier of the Feature Flag or Setting. - * @return settingId - */ - @javax.annotation.Nullable - public Integer getSettingId() { - return settingId; - } - - public void setSettingId(Integer settingId) { - this.settingId = settingId; - } - - - public SettingDataModel key(String key) { - this.key = key; - return this; - } - - /** - * Key of the Feature Flag or Setting. - * @return key - */ - @javax.annotation.Nullable - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - - public SettingDataModel name(String name) { - this.name = name; - return this; - } - - /** - * Name of the Feature Flag or Setting. - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public SettingDataModel hint(String hint) { - this.hint = hint; - return this; - } - - /** - * Description of the Feature Flag or Setting. - * @return hint - */ - @javax.annotation.Nullable - public String getHint() { - return hint; - } - - public void setHint(String hint) { - this.hint = hint; - } - - - public SettingDataModel settingType(SettingType settingType) { - this.settingType = settingType; - return this; - } - - /** - * Get settingType - * @return settingType - */ - @javax.annotation.Nullable - public SettingType getSettingType() { - return settingType; - } - - public void setSettingType(SettingType settingType) { - this.settingType = settingType; - } - - - public SettingDataModel order(Integer order) { - this.order = order; - return this; - } - - /** - * The order of the Feature Flag or Setting represented on the ConfigCat Dashboard. - * @return order - */ - @javax.annotation.Nullable - public Integer getOrder() { - return order; - } - - public void setOrder(Integer order) { - this.order = order; - } - - - public SettingDataModel createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * The creation time of the Feature Flag or Setting. - * @return createdAt - */ - @javax.annotation.Nullable - public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - - public SettingDataModel creatorEmail(String creatorEmail) { - this.creatorEmail = creatorEmail; - return this; - } - - /** - * The user's email address who created the Feature Flag or Setting. - * @return creatorEmail - */ - @javax.annotation.Nullable - public String getCreatorEmail() { - return creatorEmail; - } - - public void setCreatorEmail(String creatorEmail) { - this.creatorEmail = creatorEmail; - } - - - public SettingDataModel creatorFullName(String creatorFullName) { - this.creatorFullName = creatorFullName; - return this; - } - - /** - * The user's name who created the Feature Flag or Setting. - * @return creatorFullName - */ - @javax.annotation.Nullable - public String getCreatorFullName() { - return creatorFullName; - } - - public void setCreatorFullName(String creatorFullName) { - this.creatorFullName = creatorFullName; - } - - - public SettingDataModel isWatching(Boolean isWatching) { - this.isWatching = isWatching; - return this; - } - - /** - * Get isWatching - * @return isWatching - */ - @javax.annotation.Nullable - public Boolean getIsWatching() { - return isWatching; - } - - public void setIsWatching(Boolean isWatching) { - this.isWatching = isWatching; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the SettingDataModel instance itself - */ - public SettingDataModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SettingDataModel settingDataModel = (SettingDataModel) o; - return Objects.equals(this.settingId, settingDataModel.settingId) && - Objects.equals(this.key, settingDataModel.key) && - Objects.equals(this.name, settingDataModel.name) && - Objects.equals(this.hint, settingDataModel.hint) && - Objects.equals(this.settingType, settingDataModel.settingType) && - Objects.equals(this.order, settingDataModel.order) && - Objects.equals(this.createdAt, settingDataModel.createdAt) && - Objects.equals(this.creatorEmail, settingDataModel.creatorEmail) && - Objects.equals(this.creatorFullName, settingDataModel.creatorFullName) && - Objects.equals(this.isWatching, settingDataModel.isWatching)&& - Objects.equals(this.additionalProperties, settingDataModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(settingId, key, name, hint, settingType, order, createdAt, creatorEmail, creatorFullName, isWatching, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SettingDataModel {\n"); - sb.append(" settingId: ").append(toIndentedString(settingId)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" hint: ").append(toIndentedString(hint)).append("\n"); - sb.append(" settingType: ").append(toIndentedString(settingType)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" creatorEmail: ").append(toIndentedString(creatorEmail)).append("\n"); - sb.append(" creatorFullName: ").append(toIndentedString(creatorFullName)).append("\n"); - sb.append(" isWatching: ").append(toIndentedString(isWatching)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("settingId"); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("hint"); - openapiFields.add("settingType"); - openapiFields.add("order"); - openapiFields.add("createdAt"); - openapiFields.add("creatorEmail"); - openapiFields.add("creatorFullName"); - openapiFields.add("isWatching"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SettingDataModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SettingDataModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SettingDataModel is not found in the empty JSON string", SettingDataModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("key") != null && !jsonObj.get("key").isJsonNull()) && !jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("hint") != null && !jsonObj.get("hint").isJsonNull()) && !jsonObj.get("hint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hint").toString())); - } - // validate the optional field `settingType` - if (jsonObj.get("settingType") != null && !jsonObj.get("settingType").isJsonNull()) { - SettingType.validateJsonElement(jsonObj.get("settingType")); - } - if ((jsonObj.get("creatorEmail") != null && !jsonObj.get("creatorEmail").isJsonNull()) && !jsonObj.get("creatorEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `creatorEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creatorEmail").toString())); - } - if ((jsonObj.get("creatorFullName") != null && !jsonObj.get("creatorFullName").isJsonNull()) && !jsonObj.get("creatorFullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `creatorFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creatorFullName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SettingDataModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SettingDataModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SettingDataModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SettingDataModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public SettingDataModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - SettingDataModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SettingDataModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of SettingDataModel - * @throws IOException if the JSON string is invalid with respect to SettingDataModel - */ - public static SettingDataModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SettingDataModel.class); - } - - /** - * Convert an instance of SettingDataModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SettingFormulaModel.java b/src/main/java/com/configcat/publicapi/java/client/model/SettingFormulaModel.java deleted file mode 100644 index 6d7d3d9..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/SettingFormulaModel.java +++ /dev/null @@ -1,782 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.ConfigModel; -import com.configcat.publicapi.java.client.model.EnvironmentModel; -import com.configcat.publicapi.java.client.model.FeatureFlagLimitations; -import com.configcat.publicapi.java.client.model.IntegrationLinkModel; -import com.configcat.publicapi.java.client.model.SettingDataModel; -import com.configcat.publicapi.java.client.model.SettingTagModel; -import com.configcat.publicapi.java.client.model.TargetingRuleModel; -import com.configcat.publicapi.java.client.model.ValueModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * SettingFormulaModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class SettingFormulaModel { - public static final String SERIALIZED_NAME_LAST_VERSION_ID = "lastVersionId"; - @SerializedName(SERIALIZED_NAME_LAST_VERSION_ID) - private UUID lastVersionId; - - public static final String SERIALIZED_NAME_DEFAULT_VALUE = "defaultValue"; - @SerializedName(SERIALIZED_NAME_DEFAULT_VALUE) - private ValueModel defaultValue; - - public static final String SERIALIZED_NAME_TARGETING_RULES = "targetingRules"; - @SerializedName(SERIALIZED_NAME_TARGETING_RULES) - private List targetingRules; - - public static final String SERIALIZED_NAME_SETTING = "setting"; - @SerializedName(SERIALIZED_NAME_SETTING) - private SettingDataModel setting; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private OffsetDateTime updatedAt; - - public static final String SERIALIZED_NAME_PERCENTAGE_EVALUATION_ATTRIBUTE = "percentageEvaluationAttribute"; - @SerializedName(SERIALIZED_NAME_PERCENTAGE_EVALUATION_ATTRIBUTE) - private String percentageEvaluationAttribute; - - public static final String SERIALIZED_NAME_LAST_UPDATER_USER_EMAIL = "lastUpdaterUserEmail"; - @SerializedName(SERIALIZED_NAME_LAST_UPDATER_USER_EMAIL) - private String lastUpdaterUserEmail; - - public static final String SERIALIZED_NAME_LAST_UPDATER_USER_FULL_NAME = "lastUpdaterUserFullName"; - @SerializedName(SERIALIZED_NAME_LAST_UPDATER_USER_FULL_NAME) - private String lastUpdaterUserFullName; - - public static final String SERIALIZED_NAME_INTEGRATION_LINKS = "integrationLinks"; - @SerializedName(SERIALIZED_NAME_INTEGRATION_LINKS) - private List integrationLinks; - - public static final String SERIALIZED_NAME_SETTING_TAGS = "settingTags"; - @SerializedName(SERIALIZED_NAME_SETTING_TAGS) - private List settingTags; - - public static final String SERIALIZED_NAME_SETTING_IDS_WHERE_PREREQUISITE = "settingIdsWherePrerequisite"; - @SerializedName(SERIALIZED_NAME_SETTING_IDS_WHERE_PREREQUISITE) - private List settingIdsWherePrerequisite; - - public static final String SERIALIZED_NAME_CONFIG = "config"; - @SerializedName(SERIALIZED_NAME_CONFIG) - private ConfigModel config; - - public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT) - private EnvironmentModel environment; - - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public static final String SERIALIZED_NAME_FEATURE_FLAG_LIMITATIONS = "featureFlagLimitations"; - @SerializedName(SERIALIZED_NAME_FEATURE_FLAG_LIMITATIONS) - private FeatureFlagLimitations featureFlagLimitations; - - public SettingFormulaModel() { - } - - public SettingFormulaModel lastVersionId(UUID lastVersionId) { - this.lastVersionId = lastVersionId; - return this; - } - - /** - * Get lastVersionId - * @return lastVersionId - */ - @javax.annotation.Nullable - public UUID getLastVersionId() { - return lastVersionId; - } - - public void setLastVersionId(UUID lastVersionId) { - this.lastVersionId = lastVersionId; - } - - - public SettingFormulaModel defaultValue(ValueModel defaultValue) { - this.defaultValue = defaultValue; - return this; - } - - /** - * Get defaultValue - * @return defaultValue - */ - @javax.annotation.Nullable - public ValueModel getDefaultValue() { - return defaultValue; - } - - public void setDefaultValue(ValueModel defaultValue) { - this.defaultValue = defaultValue; - } - - - public SettingFormulaModel targetingRules(List targetingRules) { - this.targetingRules = targetingRules; - return this; - } - - public SettingFormulaModel addTargetingRulesItem(TargetingRuleModel targetingRulesItem) { - if (this.targetingRules == null) { - this.targetingRules = new ArrayList<>(); - } - this.targetingRules.add(targetingRulesItem); - return this; - } - - /** - * The targeting rules of the Feature Flag or Setting. - * @return targetingRules - */ - @javax.annotation.Nullable - public List getTargetingRules() { - return targetingRules; - } - - public void setTargetingRules(List targetingRules) { - this.targetingRules = targetingRules; - } - - - public SettingFormulaModel setting(SettingDataModel setting) { - this.setting = setting; - return this; - } - - /** - * Get setting - * @return setting - */ - @javax.annotation.Nullable - public SettingDataModel getSetting() { - return setting; - } - - public void setSetting(SettingDataModel setting) { - this.setting = setting; - } - - - public SettingFormulaModel updatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * The last updated date and time when the Feature Flag or Setting. - * @return updatedAt - */ - @javax.annotation.Nullable - public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - } - - - public SettingFormulaModel percentageEvaluationAttribute(String percentageEvaluationAttribute) { - this.percentageEvaluationAttribute = percentageEvaluationAttribute; - return this; - } - - /** - * The user attribute used for percentage evaluation. If not set, it defaults to the `Identifier` user object attribute. - * @return percentageEvaluationAttribute - */ - @javax.annotation.Nullable - public String getPercentageEvaluationAttribute() { - return percentageEvaluationAttribute; - } - - public void setPercentageEvaluationAttribute(String percentageEvaluationAttribute) { - this.percentageEvaluationAttribute = percentageEvaluationAttribute; - } - - - public SettingFormulaModel lastUpdaterUserEmail(String lastUpdaterUserEmail) { - this.lastUpdaterUserEmail = lastUpdaterUserEmail; - return this; - } - - /** - * The email of the user who last updated the Feature Flag or Setting. - * @return lastUpdaterUserEmail - */ - @javax.annotation.Nullable - public String getLastUpdaterUserEmail() { - return lastUpdaterUserEmail; - } - - public void setLastUpdaterUserEmail(String lastUpdaterUserEmail) { - this.lastUpdaterUserEmail = lastUpdaterUserEmail; - } - - - public SettingFormulaModel lastUpdaterUserFullName(String lastUpdaterUserFullName) { - this.lastUpdaterUserFullName = lastUpdaterUserFullName; - return this; - } - - /** - * The name of the user who last updated the Feature Flag or Setting. - * @return lastUpdaterUserFullName - */ - @javax.annotation.Nullable - public String getLastUpdaterUserFullName() { - return lastUpdaterUserFullName; - } - - public void setLastUpdaterUserFullName(String lastUpdaterUserFullName) { - this.lastUpdaterUserFullName = lastUpdaterUserFullName; - } - - - public SettingFormulaModel integrationLinks(List integrationLinks) { - this.integrationLinks = integrationLinks; - return this; - } - - public SettingFormulaModel addIntegrationLinksItem(IntegrationLinkModel integrationLinksItem) { - if (this.integrationLinks == null) { - this.integrationLinks = new ArrayList<>(); - } - this.integrationLinks.add(integrationLinksItem); - return this; - } - - /** - * The integration links attached to the Feature Flag or Setting. - * @return integrationLinks - */ - @javax.annotation.Nullable - public List getIntegrationLinks() { - return integrationLinks; - } - - public void setIntegrationLinks(List integrationLinks) { - this.integrationLinks = integrationLinks; - } - - - public SettingFormulaModel settingTags(List settingTags) { - this.settingTags = settingTags; - return this; - } - - public SettingFormulaModel addSettingTagsItem(SettingTagModel settingTagsItem) { - if (this.settingTags == null) { - this.settingTags = new ArrayList<>(); - } - this.settingTags.add(settingTagsItem); - return this; - } - - /** - * The tags attached to the Feature Flag or Setting. - * @return settingTags - */ - @javax.annotation.Nullable - public List getSettingTags() { - return settingTags; - } - - public void setSettingTags(List settingTags) { - this.settingTags = settingTags; - } - - - public SettingFormulaModel settingIdsWherePrerequisite(List settingIdsWherePrerequisite) { - this.settingIdsWherePrerequisite = settingIdsWherePrerequisite; - return this; - } - - public SettingFormulaModel addSettingIdsWherePrerequisiteItem(Integer settingIdsWherePrerequisiteItem) { - if (this.settingIdsWherePrerequisite == null) { - this.settingIdsWherePrerequisite = new ArrayList<>(); - } - this.settingIdsWherePrerequisite.add(settingIdsWherePrerequisiteItem); - return this; - } - - /** - * List of Feature Flag and Setting IDs where the actual Feature Flag or Setting is prerequisite. - * @return settingIdsWherePrerequisite - */ - @javax.annotation.Nullable - public List getSettingIdsWherePrerequisite() { - return settingIdsWherePrerequisite; - } - - public void setSettingIdsWherePrerequisite(List settingIdsWherePrerequisite) { - this.settingIdsWherePrerequisite = settingIdsWherePrerequisite; - } - - - public SettingFormulaModel config(ConfigModel config) { - this.config = config; - return this; - } - - /** - * Get config - * @return config - */ - @javax.annotation.Nullable - public ConfigModel getConfig() { - return config; - } - - public void setConfig(ConfigModel config) { - this.config = config; - } - - - public SettingFormulaModel environment(EnvironmentModel environment) { - this.environment = environment; - return this; - } - - /** - * Get environment - * @return environment - */ - @javax.annotation.Nullable - public EnvironmentModel getEnvironment() { - return environment; - } - - public void setEnvironment(EnvironmentModel environment) { - this.environment = environment; - } - - - public SettingFormulaModel readOnly(Boolean readOnly) { - this.readOnly = readOnly; - return this; - } - - /** - * Get readOnly - * @return readOnly - */ - @javax.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - - public SettingFormulaModel featureFlagLimitations(FeatureFlagLimitations featureFlagLimitations) { - this.featureFlagLimitations = featureFlagLimitations; - return this; - } - - /** - * Get featureFlagLimitations - * @return featureFlagLimitations - */ - @javax.annotation.Nullable - public FeatureFlagLimitations getFeatureFlagLimitations() { - return featureFlagLimitations; - } - - public void setFeatureFlagLimitations(FeatureFlagLimitations featureFlagLimitations) { - this.featureFlagLimitations = featureFlagLimitations; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the SettingFormulaModel instance itself - */ - public SettingFormulaModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SettingFormulaModel settingFormulaModel = (SettingFormulaModel) o; - return Objects.equals(this.lastVersionId, settingFormulaModel.lastVersionId) && - Objects.equals(this.defaultValue, settingFormulaModel.defaultValue) && - Objects.equals(this.targetingRules, settingFormulaModel.targetingRules) && - Objects.equals(this.setting, settingFormulaModel.setting) && - Objects.equals(this.updatedAt, settingFormulaModel.updatedAt) && - Objects.equals(this.percentageEvaluationAttribute, settingFormulaModel.percentageEvaluationAttribute) && - Objects.equals(this.lastUpdaterUserEmail, settingFormulaModel.lastUpdaterUserEmail) && - Objects.equals(this.lastUpdaterUserFullName, settingFormulaModel.lastUpdaterUserFullName) && - Objects.equals(this.integrationLinks, settingFormulaModel.integrationLinks) && - Objects.equals(this.settingTags, settingFormulaModel.settingTags) && - Objects.equals(this.settingIdsWherePrerequisite, settingFormulaModel.settingIdsWherePrerequisite) && - Objects.equals(this.config, settingFormulaModel.config) && - Objects.equals(this.environment, settingFormulaModel.environment) && - Objects.equals(this.readOnly, settingFormulaModel.readOnly) && - Objects.equals(this.featureFlagLimitations, settingFormulaModel.featureFlagLimitations)&& - Objects.equals(this.additionalProperties, settingFormulaModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(lastVersionId, defaultValue, targetingRules, setting, updatedAt, percentageEvaluationAttribute, lastUpdaterUserEmail, lastUpdaterUserFullName, integrationLinks, settingTags, settingIdsWherePrerequisite, config, environment, readOnly, featureFlagLimitations, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SettingFormulaModel {\n"); - sb.append(" lastVersionId: ").append(toIndentedString(lastVersionId)).append("\n"); - sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); - sb.append(" targetingRules: ").append(toIndentedString(targetingRules)).append("\n"); - sb.append(" setting: ").append(toIndentedString(setting)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" percentageEvaluationAttribute: ").append(toIndentedString(percentageEvaluationAttribute)).append("\n"); - sb.append(" lastUpdaterUserEmail: ").append(toIndentedString(lastUpdaterUserEmail)).append("\n"); - sb.append(" lastUpdaterUserFullName: ").append(toIndentedString(lastUpdaterUserFullName)).append("\n"); - sb.append(" integrationLinks: ").append(toIndentedString(integrationLinks)).append("\n"); - sb.append(" settingTags: ").append(toIndentedString(settingTags)).append("\n"); - sb.append(" settingIdsWherePrerequisite: ").append(toIndentedString(settingIdsWherePrerequisite)).append("\n"); - sb.append(" config: ").append(toIndentedString(config)).append("\n"); - sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); - sb.append(" featureFlagLimitations: ").append(toIndentedString(featureFlagLimitations)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("lastVersionId"); - openapiFields.add("defaultValue"); - openapiFields.add("targetingRules"); - openapiFields.add("setting"); - openapiFields.add("updatedAt"); - openapiFields.add("percentageEvaluationAttribute"); - openapiFields.add("lastUpdaterUserEmail"); - openapiFields.add("lastUpdaterUserFullName"); - openapiFields.add("integrationLinks"); - openapiFields.add("settingTags"); - openapiFields.add("settingIdsWherePrerequisite"); - openapiFields.add("config"); - openapiFields.add("environment"); - openapiFields.add("readOnly"); - openapiFields.add("featureFlagLimitations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SettingFormulaModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SettingFormulaModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SettingFormulaModel is not found in the empty JSON string", SettingFormulaModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("lastVersionId") != null && !jsonObj.get("lastVersionId").isJsonNull()) && !jsonObj.get("lastVersionId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lastVersionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastVersionId").toString())); - } - // validate the optional field `defaultValue` - if (jsonObj.get("defaultValue") != null && !jsonObj.get("defaultValue").isJsonNull()) { - ValueModel.validateJsonElement(jsonObj.get("defaultValue")); - } - if (jsonObj.get("targetingRules") != null && !jsonObj.get("targetingRules").isJsonNull()) { - JsonArray jsonArraytargetingRules = jsonObj.getAsJsonArray("targetingRules"); - if (jsonArraytargetingRules != null) { - // ensure the json data is an array - if (!jsonObj.get("targetingRules").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `targetingRules` to be an array in the JSON string but got `%s`", jsonObj.get("targetingRules").toString())); - } - - // validate the optional field `targetingRules` (array) - for (int i = 0; i < jsonArraytargetingRules.size(); i++) { - TargetingRuleModel.validateJsonElement(jsonArraytargetingRules.get(i)); - }; - } - } - // validate the optional field `setting` - if (jsonObj.get("setting") != null && !jsonObj.get("setting").isJsonNull()) { - SettingDataModel.validateJsonElement(jsonObj.get("setting")); - } - if ((jsonObj.get("percentageEvaluationAttribute") != null && !jsonObj.get("percentageEvaluationAttribute").isJsonNull()) && !jsonObj.get("percentageEvaluationAttribute").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `percentageEvaluationAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("percentageEvaluationAttribute").toString())); - } - if ((jsonObj.get("lastUpdaterUserEmail") != null && !jsonObj.get("lastUpdaterUserEmail").isJsonNull()) && !jsonObj.get("lastUpdaterUserEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterUserEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterUserEmail").toString())); - } - if ((jsonObj.get("lastUpdaterUserFullName") != null && !jsonObj.get("lastUpdaterUserFullName").isJsonNull()) && !jsonObj.get("lastUpdaterUserFullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterUserFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterUserFullName").toString())); - } - if (jsonObj.get("integrationLinks") != null && !jsonObj.get("integrationLinks").isJsonNull()) { - JsonArray jsonArrayintegrationLinks = jsonObj.getAsJsonArray("integrationLinks"); - if (jsonArrayintegrationLinks != null) { - // ensure the json data is an array - if (!jsonObj.get("integrationLinks").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `integrationLinks` to be an array in the JSON string but got `%s`", jsonObj.get("integrationLinks").toString())); - } - - // validate the optional field `integrationLinks` (array) - for (int i = 0; i < jsonArrayintegrationLinks.size(); i++) { - IntegrationLinkModel.validateJsonElement(jsonArrayintegrationLinks.get(i)); - }; - } - } - if (jsonObj.get("settingTags") != null && !jsonObj.get("settingTags").isJsonNull()) { - JsonArray jsonArraysettingTags = jsonObj.getAsJsonArray("settingTags"); - if (jsonArraysettingTags != null) { - // ensure the json data is an array - if (!jsonObj.get("settingTags").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `settingTags` to be an array in the JSON string but got `%s`", jsonObj.get("settingTags").toString())); - } - - // validate the optional field `settingTags` (array) - for (int i = 0; i < jsonArraysettingTags.size(); i++) { - SettingTagModel.validateJsonElement(jsonArraysettingTags.get(i)); - }; - } - } - // ensure the optional json data is an array if present - if (jsonObj.get("settingIdsWherePrerequisite") != null && !jsonObj.get("settingIdsWherePrerequisite").isJsonNull() && !jsonObj.get("settingIdsWherePrerequisite").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `settingIdsWherePrerequisite` to be an array in the JSON string but got `%s`", jsonObj.get("settingIdsWherePrerequisite").toString())); - } - // validate the optional field `config` - if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { - ConfigModel.validateJsonElement(jsonObj.get("config")); - } - // validate the optional field `environment` - if (jsonObj.get("environment") != null && !jsonObj.get("environment").isJsonNull()) { - EnvironmentModel.validateJsonElement(jsonObj.get("environment")); - } - // validate the optional field `featureFlagLimitations` - if (jsonObj.get("featureFlagLimitations") != null && !jsonObj.get("featureFlagLimitations").isJsonNull()) { - FeatureFlagLimitations.validateJsonElement(jsonObj.get("featureFlagLimitations")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SettingFormulaModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SettingFormulaModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SettingFormulaModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SettingFormulaModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public SettingFormulaModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - SettingFormulaModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SettingFormulaModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of SettingFormulaModel - * @throws IOException if the JSON string is invalid with respect to SettingFormulaModel - */ - public static SettingFormulaModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SettingFormulaModel.class); - } - - /** - * Convert an instance of SettingFormulaModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SettingModel.java b/src/main/java/com/configcat/publicapi/java/client/model/SettingModel.java deleted file mode 100644 index 047dae8..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/SettingModel.java +++ /dev/null @@ -1,577 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.SettingType; -import com.configcat.publicapi.java.client.model.TagModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * Metadata of a Feature Flag or Setting. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class SettingModel { - public static final String SERIALIZED_NAME_SETTING_ID = "settingId"; - @SerializedName(SERIALIZED_NAME_SETTING_ID) - private Integer settingId; - - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_HINT = "hint"; - @SerializedName(SERIALIZED_NAME_HINT) - private String hint; - - public static final String SERIALIZED_NAME_ORDER = "order"; - @SerializedName(SERIALIZED_NAME_ORDER) - private Integer order; - - public static final String SERIALIZED_NAME_SETTING_TYPE = "settingType"; - @SerializedName(SERIALIZED_NAME_SETTING_TYPE) - private SettingType settingType; - - public static final String SERIALIZED_NAME_CONFIG_ID = "configId"; - @SerializedName(SERIALIZED_NAME_CONFIG_ID) - private UUID configId; - - public static final String SERIALIZED_NAME_CONFIG_NAME = "configName"; - @SerializedName(SERIALIZED_NAME_CONFIG_NAME) - private String configName; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_TAGS = "tags"; - @SerializedName(SERIALIZED_NAME_TAGS) - private List tags; - - public SettingModel() { - } - - public SettingModel settingId(Integer settingId) { - this.settingId = settingId; - return this; - } - - /** - * Identifier of the Feature Flag or Setting. - * @return settingId - */ - @javax.annotation.Nullable - public Integer getSettingId() { - return settingId; - } - - public void setSettingId(Integer settingId) { - this.settingId = settingId; - } - - - public SettingModel key(String key) { - this.key = key; - return this; - } - - /** - * Key of the Feature Flag or Setting. - * @return key - */ - @javax.annotation.Nullable - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - - public SettingModel name(String name) { - this.name = name; - return this; - } - - /** - * Name of the Feature Flag or Setting. - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public SettingModel hint(String hint) { - this.hint = hint; - return this; - } - - /** - * Description of the Feature Flag or Setting. - * @return hint - */ - @javax.annotation.Nullable - public String getHint() { - return hint; - } - - public void setHint(String hint) { - this.hint = hint; - } - - - public SettingModel order(Integer order) { - this.order = order; - return this; - } - - /** - * The order of the Feature Flag or Setting represented on the ConfigCat Dashboard. - * @return order - */ - @javax.annotation.Nullable - public Integer getOrder() { - return order; - } - - public void setOrder(Integer order) { - this.order = order; - } - - - public SettingModel settingType(SettingType settingType) { - this.settingType = settingType; - return this; - } - - /** - * Get settingType - * @return settingType - */ - @javax.annotation.Nullable - public SettingType getSettingType() { - return settingType; - } - - public void setSettingType(SettingType settingType) { - this.settingType = settingType; - } - - - public SettingModel configId(UUID configId) { - this.configId = configId; - return this; - } - - /** - * Identifier of the Feature Flag's Config. - * @return configId - */ - @javax.annotation.Nullable - public UUID getConfigId() { - return configId; - } - - public void setConfigId(UUID configId) { - this.configId = configId; - } - - - public SettingModel configName(String configName) { - this.configName = configName; - return this; - } - - /** - * Name of the Feature Flag's Config. - * @return configName - */ - @javax.annotation.Nullable - public String getConfigName() { - return configName; - } - - public void setConfigName(String configName) { - this.configName = configName; - } - - - public SettingModel createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * The creation time of the Feature Flag or Setting. - * @return createdAt - */ - @javax.annotation.Nullable - public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - - public SettingModel tags(List tags) { - this.tags = tags; - return this; - } - - public SettingModel addTagsItem(TagModel tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * The tags attached to the Feature Flag or Setting. - * @return tags - */ - @javax.annotation.Nullable - public List getTags() { - return tags; - } - - public void setTags(List tags) { - this.tags = tags; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the SettingModel instance itself - */ - public SettingModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SettingModel settingModel = (SettingModel) o; - return Objects.equals(this.settingId, settingModel.settingId) && - Objects.equals(this.key, settingModel.key) && - Objects.equals(this.name, settingModel.name) && - Objects.equals(this.hint, settingModel.hint) && - Objects.equals(this.order, settingModel.order) && - Objects.equals(this.settingType, settingModel.settingType) && - Objects.equals(this.configId, settingModel.configId) && - Objects.equals(this.configName, settingModel.configName) && - Objects.equals(this.createdAt, settingModel.createdAt) && - Objects.equals(this.tags, settingModel.tags)&& - Objects.equals(this.additionalProperties, settingModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(settingId, key, name, hint, order, settingType, configId, configName, createdAt, tags, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SettingModel {\n"); - sb.append(" settingId: ").append(toIndentedString(settingId)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" hint: ").append(toIndentedString(hint)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append(" settingType: ").append(toIndentedString(settingType)).append("\n"); - sb.append(" configId: ").append(toIndentedString(configId)).append("\n"); - sb.append(" configName: ").append(toIndentedString(configName)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("settingId"); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("hint"); - openapiFields.add("order"); - openapiFields.add("settingType"); - openapiFields.add("configId"); - openapiFields.add("configName"); - openapiFields.add("createdAt"); - openapiFields.add("tags"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SettingModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SettingModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SettingModel is not found in the empty JSON string", SettingModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("key") != null && !jsonObj.get("key").isJsonNull()) && !jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("hint") != null && !jsonObj.get("hint").isJsonNull()) && !jsonObj.get("hint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hint").toString())); - } - // validate the optional field `settingType` - if (jsonObj.get("settingType") != null && !jsonObj.get("settingType").isJsonNull()) { - SettingType.validateJsonElement(jsonObj.get("settingType")); - } - if ((jsonObj.get("configId") != null && !jsonObj.get("configId").isJsonNull()) && !jsonObj.get("configId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `configId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("configId").toString())); - } - if ((jsonObj.get("configName") != null && !jsonObj.get("configName").isJsonNull()) && !jsonObj.get("configName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `configName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("configName").toString())); - } - if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull()) { - JsonArray jsonArraytags = jsonObj.getAsJsonArray("tags"); - if (jsonArraytags != null) { - // ensure the json data is an array - if (!jsonObj.get("tags").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); - } - - // validate the optional field `tags` (array) - for (int i = 0; i < jsonArraytags.size(); i++) { - TagModel.validateJsonElement(jsonArraytags.get(i)); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SettingModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SettingModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SettingModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SettingModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public SettingModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - SettingModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SettingModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of SettingModel - * @throws IOException if the JSON string is invalid with respect to SettingModel - */ - public static SettingModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SettingModel.class); - } - - /** - * Convert an instance of SettingModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SettingTagModel.java b/src/main/java/com/configcat/publicapi/java/client/model/SettingTagModel.java deleted file mode 100644 index ade46fa..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/SettingTagModel.java +++ /dev/null @@ -1,380 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * SettingTagModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class SettingTagModel { - public static final String SERIALIZED_NAME_SETTING_TAG_ID = "settingTagId"; - @SerializedName(SERIALIZED_NAME_SETTING_TAG_ID) - private Long settingTagId; - - public static final String SERIALIZED_NAME_TAG_ID = "tagId"; - @SerializedName(SERIALIZED_NAME_TAG_ID) - private Long tagId; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_COLOR = "color"; - @SerializedName(SERIALIZED_NAME_COLOR) - private String color; - - public SettingTagModel() { - } - - public SettingTagModel settingTagId(Long settingTagId) { - this.settingTagId = settingTagId; - return this; - } - - /** - * Get settingTagId - * @return settingTagId - */ - @javax.annotation.Nullable - public Long getSettingTagId() { - return settingTagId; - } - - public void setSettingTagId(Long settingTagId) { - this.settingTagId = settingTagId; - } - - - public SettingTagModel tagId(Long tagId) { - this.tagId = tagId; - return this; - } - - /** - * Get tagId - * @return tagId - */ - @javax.annotation.Nullable - public Long getTagId() { - return tagId; - } - - public void setTagId(Long tagId) { - this.tagId = tagId; - } - - - public SettingTagModel name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public SettingTagModel color(String color) { - this.color = color; - return this; - } - - /** - * Get color - * @return color - */ - @javax.annotation.Nullable - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the SettingTagModel instance itself - */ - public SettingTagModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SettingTagModel settingTagModel = (SettingTagModel) o; - return Objects.equals(this.settingTagId, settingTagModel.settingTagId) && - Objects.equals(this.tagId, settingTagModel.tagId) && - Objects.equals(this.name, settingTagModel.name) && - Objects.equals(this.color, settingTagModel.color)&& - Objects.equals(this.additionalProperties, settingTagModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(settingTagId, tagId, name, color, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SettingTagModel {\n"); - sb.append(" settingTagId: ").append(toIndentedString(settingTagId)).append("\n"); - sb.append(" tagId: ").append(toIndentedString(tagId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("settingTagId"); - openapiFields.add("tagId"); - openapiFields.add("name"); - openapiFields.add("color"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SettingTagModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SettingTagModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SettingTagModel is not found in the empty JSON string", SettingTagModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("color") != null && !jsonObj.get("color").isJsonNull()) && !jsonObj.get("color").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SettingTagModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SettingTagModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SettingTagModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SettingTagModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public SettingTagModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - SettingTagModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SettingTagModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of SettingTagModel - * @throws IOException if the JSON string is invalid with respect to SettingTagModel - */ - public static SettingTagModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SettingTagModel.class); - } - - /** - * Convert an instance of SettingTagModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SettingType.java b/src/main/java/com/configcat/publicapi/java/client/model/SettingType.java deleted file mode 100644 index b78ac4b..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/SettingType.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * The type of the Feature Flag or Setting. - */ -@JsonAdapter(SettingType.Adapter.class) -public enum SettingType { - - BOOLEAN("boolean"), - - STRING("string"), - - INT("int"), - - DOUBLE("double"); - - private String value; - - SettingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static SettingType fromValue(String value) { - for (SettingType b : SettingType.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final SettingType enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public SettingType read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return SettingType.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - SettingType.fromValue(value); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SettingValueModel.java b/src/main/java/com/configcat/publicapi/java/client/model/SettingValueModel.java deleted file mode 100644 index ccfa672..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/SettingValueModel.java +++ /dev/null @@ -1,729 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.ConfigModel; -import com.configcat.publicapi.java.client.model.EnvironmentModel; -import com.configcat.publicapi.java.client.model.FeatureFlagLimitations; -import com.configcat.publicapi.java.client.model.IntegrationLinkModel; -import com.configcat.publicapi.java.client.model.RolloutPercentageItemModel; -import com.configcat.publicapi.java.client.model.RolloutRuleModel; -import com.configcat.publicapi.java.client.model.SettingDataModel; -import com.configcat.publicapi.java.client.model.SettingTagModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * SettingValueModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class SettingValueModel { - public static final String SERIALIZED_NAME_ROLLOUT_RULES = "rolloutRules"; - @SerializedName(SERIALIZED_NAME_ROLLOUT_RULES) - private List rolloutRules; - - public static final String SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS = "rolloutPercentageItems"; - @SerializedName(SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS) - private List rolloutPercentageItems; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private Object value = null; - - public static final String SERIALIZED_NAME_SETTING = "setting"; - @SerializedName(SERIALIZED_NAME_SETTING) - private SettingDataModel setting; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private OffsetDateTime updatedAt; - - public static final String SERIALIZED_NAME_LAST_UPDATER_USER_EMAIL = "lastUpdaterUserEmail"; - @SerializedName(SERIALIZED_NAME_LAST_UPDATER_USER_EMAIL) - private String lastUpdaterUserEmail; - - public static final String SERIALIZED_NAME_LAST_UPDATER_USER_FULL_NAME = "lastUpdaterUserFullName"; - @SerializedName(SERIALIZED_NAME_LAST_UPDATER_USER_FULL_NAME) - private String lastUpdaterUserFullName; - - public static final String SERIALIZED_NAME_INTEGRATION_LINKS = "integrationLinks"; - @SerializedName(SERIALIZED_NAME_INTEGRATION_LINKS) - private List integrationLinks; - - public static final String SERIALIZED_NAME_SETTING_TAGS = "settingTags"; - @SerializedName(SERIALIZED_NAME_SETTING_TAGS) - private List settingTags; - - public static final String SERIALIZED_NAME_CONFIG = "config"; - @SerializedName(SERIALIZED_NAME_CONFIG) - private ConfigModel config; - - public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT) - private EnvironmentModel environment; - - public static final String SERIALIZED_NAME_FEATURE_FLAG_LIMITATIONS = "featureFlagLimitations"; - @SerializedName(SERIALIZED_NAME_FEATURE_FLAG_LIMITATIONS) - private FeatureFlagLimitations featureFlagLimitations; - - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public SettingValueModel() { - } - - public SettingValueModel rolloutRules(List rolloutRules) { - this.rolloutRules = rolloutRules; - return this; - } - - public SettingValueModel addRolloutRulesItem(RolloutRuleModel rolloutRulesItem) { - if (this.rolloutRules == null) { - this.rolloutRules = new ArrayList<>(); - } - this.rolloutRules.add(rolloutRulesItem); - return this; - } - - /** - * The targeting rule collection. - * @return rolloutRules - */ - @javax.annotation.Nullable - public List getRolloutRules() { - return rolloutRules; - } - - public void setRolloutRules(List rolloutRules) { - this.rolloutRules = rolloutRules; - } - - - public SettingValueModel rolloutPercentageItems(List rolloutPercentageItems) { - this.rolloutPercentageItems = rolloutPercentageItems; - return this; - } - - public SettingValueModel addRolloutPercentageItemsItem(RolloutPercentageItemModel rolloutPercentageItemsItem) { - if (this.rolloutPercentageItems == null) { - this.rolloutPercentageItems = new ArrayList<>(); - } - this.rolloutPercentageItems.add(rolloutPercentageItemsItem); - return this; - } - - /** - * The percentage rule collection. - * @return rolloutPercentageItems - */ - @javax.annotation.Nullable - public List getRolloutPercentageItems() { - return rolloutPercentageItems; - } - - public void setRolloutPercentageItems(List rolloutPercentageItems) { - this.rolloutPercentageItems = rolloutPercentageItems; - } - - - public SettingValueModel value(Object value) { - this.value = value; - return this; - } - - /** - * The value to serve. It must respect the setting type. - * @return value - */ - @javax.annotation.Nullable - public Object getValue() { - return value; - } - - public void setValue(Object value) { - this.value = value; - } - - - public SettingValueModel setting(SettingDataModel setting) { - this.setting = setting; - return this; - } - - /** - * Get setting - * @return setting - */ - @javax.annotation.Nullable - public SettingDataModel getSetting() { - return setting; - } - - public void setSetting(SettingDataModel setting) { - this.setting = setting; - } - - - public SettingValueModel updatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * The last updated date and time when the Feature Flag or Setting. - * @return updatedAt - */ - @javax.annotation.Nullable - public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - } - - - public SettingValueModel lastUpdaterUserEmail(String lastUpdaterUserEmail) { - this.lastUpdaterUserEmail = lastUpdaterUserEmail; - return this; - } - - /** - * The email of the user who last updated the Feature Flag or Setting. - * @return lastUpdaterUserEmail - */ - @javax.annotation.Nullable - public String getLastUpdaterUserEmail() { - return lastUpdaterUserEmail; - } - - public void setLastUpdaterUserEmail(String lastUpdaterUserEmail) { - this.lastUpdaterUserEmail = lastUpdaterUserEmail; - } - - - public SettingValueModel lastUpdaterUserFullName(String lastUpdaterUserFullName) { - this.lastUpdaterUserFullName = lastUpdaterUserFullName; - return this; - } - - /** - * The name of the user who last updated the Feature Flag or Setting. - * @return lastUpdaterUserFullName - */ - @javax.annotation.Nullable - public String getLastUpdaterUserFullName() { - return lastUpdaterUserFullName; - } - - public void setLastUpdaterUserFullName(String lastUpdaterUserFullName) { - this.lastUpdaterUserFullName = lastUpdaterUserFullName; - } - - - public SettingValueModel integrationLinks(List integrationLinks) { - this.integrationLinks = integrationLinks; - return this; - } - - public SettingValueModel addIntegrationLinksItem(IntegrationLinkModel integrationLinksItem) { - if (this.integrationLinks == null) { - this.integrationLinks = new ArrayList<>(); - } - this.integrationLinks.add(integrationLinksItem); - return this; - } - - /** - * The integration links attached to the Feature Flag or Setting. - * @return integrationLinks - */ - @javax.annotation.Nullable - public List getIntegrationLinks() { - return integrationLinks; - } - - public void setIntegrationLinks(List integrationLinks) { - this.integrationLinks = integrationLinks; - } - - - public SettingValueModel settingTags(List settingTags) { - this.settingTags = settingTags; - return this; - } - - public SettingValueModel addSettingTagsItem(SettingTagModel settingTagsItem) { - if (this.settingTags == null) { - this.settingTags = new ArrayList<>(); - } - this.settingTags.add(settingTagsItem); - return this; - } - - /** - * The tags attached to the Feature Flag or Setting. - * @return settingTags - */ - @javax.annotation.Nullable - public List getSettingTags() { - return settingTags; - } - - public void setSettingTags(List settingTags) { - this.settingTags = settingTags; - } - - - public SettingValueModel config(ConfigModel config) { - this.config = config; - return this; - } - - /** - * Get config - * @return config - */ - @javax.annotation.Nullable - public ConfigModel getConfig() { - return config; - } - - public void setConfig(ConfigModel config) { - this.config = config; - } - - - public SettingValueModel environment(EnvironmentModel environment) { - this.environment = environment; - return this; - } - - /** - * Get environment - * @return environment - */ - @javax.annotation.Nullable - public EnvironmentModel getEnvironment() { - return environment; - } - - public void setEnvironment(EnvironmentModel environment) { - this.environment = environment; - } - - - public SettingValueModel featureFlagLimitations(FeatureFlagLimitations featureFlagLimitations) { - this.featureFlagLimitations = featureFlagLimitations; - return this; - } - - /** - * Get featureFlagLimitations - * @return featureFlagLimitations - */ - @javax.annotation.Nullable - public FeatureFlagLimitations getFeatureFlagLimitations() { - return featureFlagLimitations; - } - - public void setFeatureFlagLimitations(FeatureFlagLimitations featureFlagLimitations) { - this.featureFlagLimitations = featureFlagLimitations; - } - - - public SettingValueModel readOnly(Boolean readOnly) { - this.readOnly = readOnly; - return this; - } - - /** - * Get readOnly - * @return readOnly - */ - @javax.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the SettingValueModel instance itself - */ - public SettingValueModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SettingValueModel settingValueModel = (SettingValueModel) o; - return Objects.equals(this.rolloutRules, settingValueModel.rolloutRules) && - Objects.equals(this.rolloutPercentageItems, settingValueModel.rolloutPercentageItems) && - Objects.equals(this.value, settingValueModel.value) && - Objects.equals(this.setting, settingValueModel.setting) && - Objects.equals(this.updatedAt, settingValueModel.updatedAt) && - Objects.equals(this.lastUpdaterUserEmail, settingValueModel.lastUpdaterUserEmail) && - Objects.equals(this.lastUpdaterUserFullName, settingValueModel.lastUpdaterUserFullName) && - Objects.equals(this.integrationLinks, settingValueModel.integrationLinks) && - Objects.equals(this.settingTags, settingValueModel.settingTags) && - Objects.equals(this.config, settingValueModel.config) && - Objects.equals(this.environment, settingValueModel.environment) && - Objects.equals(this.featureFlagLimitations, settingValueModel.featureFlagLimitations) && - Objects.equals(this.readOnly, settingValueModel.readOnly)&& - Objects.equals(this.additionalProperties, settingValueModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(rolloutRules, rolloutPercentageItems, value, setting, updatedAt, lastUpdaterUserEmail, lastUpdaterUserFullName, integrationLinks, settingTags, config, environment, featureFlagLimitations, readOnly, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SettingValueModel {\n"); - sb.append(" rolloutRules: ").append(toIndentedString(rolloutRules)).append("\n"); - sb.append(" rolloutPercentageItems: ").append(toIndentedString(rolloutPercentageItems)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" setting: ").append(toIndentedString(setting)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" lastUpdaterUserEmail: ").append(toIndentedString(lastUpdaterUserEmail)).append("\n"); - sb.append(" lastUpdaterUserFullName: ").append(toIndentedString(lastUpdaterUserFullName)).append("\n"); - sb.append(" integrationLinks: ").append(toIndentedString(integrationLinks)).append("\n"); - sb.append(" settingTags: ").append(toIndentedString(settingTags)).append("\n"); - sb.append(" config: ").append(toIndentedString(config)).append("\n"); - sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); - sb.append(" featureFlagLimitations: ").append(toIndentedString(featureFlagLimitations)).append("\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("rolloutRules"); - openapiFields.add("rolloutPercentageItems"); - openapiFields.add("value"); - openapiFields.add("setting"); - openapiFields.add("updatedAt"); - openapiFields.add("lastUpdaterUserEmail"); - openapiFields.add("lastUpdaterUserFullName"); - openapiFields.add("integrationLinks"); - openapiFields.add("settingTags"); - openapiFields.add("config"); - openapiFields.add("environment"); - openapiFields.add("featureFlagLimitations"); - openapiFields.add("readOnly"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SettingValueModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SettingValueModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SettingValueModel is not found in the empty JSON string", SettingValueModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("rolloutRules") != null && !jsonObj.get("rolloutRules").isJsonNull()) { - JsonArray jsonArrayrolloutRules = jsonObj.getAsJsonArray("rolloutRules"); - if (jsonArrayrolloutRules != null) { - // ensure the json data is an array - if (!jsonObj.get("rolloutRules").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `rolloutRules` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutRules").toString())); - } - - // validate the optional field `rolloutRules` (array) - for (int i = 0; i < jsonArrayrolloutRules.size(); i++) { - RolloutRuleModel.validateJsonElement(jsonArrayrolloutRules.get(i)); - }; - } - } - if (jsonObj.get("rolloutPercentageItems") != null && !jsonObj.get("rolloutPercentageItems").isJsonNull()) { - JsonArray jsonArrayrolloutPercentageItems = jsonObj.getAsJsonArray("rolloutPercentageItems"); - if (jsonArrayrolloutPercentageItems != null) { - // ensure the json data is an array - if (!jsonObj.get("rolloutPercentageItems").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `rolloutPercentageItems` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutPercentageItems").toString())); - } - - // validate the optional field `rolloutPercentageItems` (array) - for (int i = 0; i < jsonArrayrolloutPercentageItems.size(); i++) { - RolloutPercentageItemModel.validateJsonElement(jsonArrayrolloutPercentageItems.get(i)); - }; - } - } - // validate the optional field `setting` - if (jsonObj.get("setting") != null && !jsonObj.get("setting").isJsonNull()) { - SettingDataModel.validateJsonElement(jsonObj.get("setting")); - } - if ((jsonObj.get("lastUpdaterUserEmail") != null && !jsonObj.get("lastUpdaterUserEmail").isJsonNull()) && !jsonObj.get("lastUpdaterUserEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterUserEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterUserEmail").toString())); - } - if ((jsonObj.get("lastUpdaterUserFullName") != null && !jsonObj.get("lastUpdaterUserFullName").isJsonNull()) && !jsonObj.get("lastUpdaterUserFullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterUserFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterUserFullName").toString())); - } - if (jsonObj.get("integrationLinks") != null && !jsonObj.get("integrationLinks").isJsonNull()) { - JsonArray jsonArrayintegrationLinks = jsonObj.getAsJsonArray("integrationLinks"); - if (jsonArrayintegrationLinks != null) { - // ensure the json data is an array - if (!jsonObj.get("integrationLinks").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `integrationLinks` to be an array in the JSON string but got `%s`", jsonObj.get("integrationLinks").toString())); - } - - // validate the optional field `integrationLinks` (array) - for (int i = 0; i < jsonArrayintegrationLinks.size(); i++) { - IntegrationLinkModel.validateJsonElement(jsonArrayintegrationLinks.get(i)); - }; - } - } - if (jsonObj.get("settingTags") != null && !jsonObj.get("settingTags").isJsonNull()) { - JsonArray jsonArraysettingTags = jsonObj.getAsJsonArray("settingTags"); - if (jsonArraysettingTags != null) { - // ensure the json data is an array - if (!jsonObj.get("settingTags").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `settingTags` to be an array in the JSON string but got `%s`", jsonObj.get("settingTags").toString())); - } - - // validate the optional field `settingTags` (array) - for (int i = 0; i < jsonArraysettingTags.size(); i++) { - SettingTagModel.validateJsonElement(jsonArraysettingTags.get(i)); - }; - } - } - // validate the optional field `config` - if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { - ConfigModel.validateJsonElement(jsonObj.get("config")); - } - // validate the optional field `environment` - if (jsonObj.get("environment") != null && !jsonObj.get("environment").isJsonNull()) { - EnvironmentModel.validateJsonElement(jsonObj.get("environment")); - } - // validate the optional field `featureFlagLimitations` - if (jsonObj.get("featureFlagLimitations") != null && !jsonObj.get("featureFlagLimitations").isJsonNull()) { - FeatureFlagLimitations.validateJsonElement(jsonObj.get("featureFlagLimitations")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SettingValueModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SettingValueModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SettingValueModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SettingValueModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public SettingValueModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - SettingValueModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SettingValueModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of SettingValueModel - * @throws IOException if the JSON string is invalid with respect to SettingValueModel - */ - public static SettingValueModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SettingValueModel.class); - } - - /** - * Convert an instance of SettingValueModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/TagModel.java b/src/main/java/com/configcat/publicapi/java/client/model/TagModel.java deleted file mode 100644 index e56cccd..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/TagModel.java +++ /dev/null @@ -1,385 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.ProductModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * TagModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class TagModel { - public static final String SERIALIZED_NAME_PRODUCT = "product"; - @SerializedName(SERIALIZED_NAME_PRODUCT) - private ProductModel product; - - public static final String SERIALIZED_NAME_TAG_ID = "tagId"; - @SerializedName(SERIALIZED_NAME_TAG_ID) - private Long tagId; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_COLOR = "color"; - @SerializedName(SERIALIZED_NAME_COLOR) - private String color; - - public TagModel() { - } - - public TagModel product(ProductModel product) { - this.product = product; - return this; - } - - /** - * Get product - * @return product - */ - @javax.annotation.Nullable - public ProductModel getProduct() { - return product; - } - - public void setProduct(ProductModel product) { - this.product = product; - } - - - public TagModel tagId(Long tagId) { - this.tagId = tagId; - return this; - } - - /** - * Identifier of the Tag. - * @return tagId - */ - @javax.annotation.Nullable - public Long getTagId() { - return tagId; - } - - public void setTagId(Long tagId) { - this.tagId = tagId; - } - - - public TagModel name(String name) { - this.name = name; - return this; - } - - /** - * Name of the Tag. - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public TagModel color(String color) { - this.color = color; - return this; - } - - /** - * The configured color of the Tag. - * @return color - */ - @javax.annotation.Nullable - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the TagModel instance itself - */ - public TagModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TagModel tagModel = (TagModel) o; - return Objects.equals(this.product, tagModel.product) && - Objects.equals(this.tagId, tagModel.tagId) && - Objects.equals(this.name, tagModel.name) && - Objects.equals(this.color, tagModel.color)&& - Objects.equals(this.additionalProperties, tagModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(product, tagId, name, color, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TagModel {\n"); - sb.append(" product: ").append(toIndentedString(product)).append("\n"); - sb.append(" tagId: ").append(toIndentedString(tagId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("product"); - openapiFields.add("tagId"); - openapiFields.add("name"); - openapiFields.add("color"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TagModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TagModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TagModel is not found in the empty JSON string", TagModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `product` - if (jsonObj.get("product") != null && !jsonObj.get("product").isJsonNull()) { - ProductModel.validateJsonElement(jsonObj.get("product")); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("color") != null && !jsonObj.get("color").isJsonNull()) && !jsonObj.get("color").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TagModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TagModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TagModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TagModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public TagModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - TagModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TagModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of TagModel - * @throws IOException if the JSON string is invalid with respect to TagModel - */ - public static TagModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TagModel.class); - } - - /** - * Convert an instance of TagModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/TargetingRuleModel.java b/src/main/java/com/configcat/publicapi/java/client/model/TargetingRuleModel.java deleted file mode 100644 index 6c9a448..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/TargetingRuleModel.java +++ /dev/null @@ -1,401 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.ConditionModel; -import com.configcat.publicapi.java.client.model.PercentageOptionModel; -import com.configcat.publicapi.java.client.model.ValueModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * TargetingRuleModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class TargetingRuleModel { - public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; - @SerializedName(SERIALIZED_NAME_CONDITIONS) - private List conditions; - - public static final String SERIALIZED_NAME_PERCENTAGE_OPTIONS = "percentageOptions"; - @SerializedName(SERIALIZED_NAME_PERCENTAGE_OPTIONS) - private List percentageOptions; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private ValueModel value; - - public TargetingRuleModel() { - } - - public TargetingRuleModel conditions(List conditions) { - this.conditions = conditions; - return this; - } - - public TargetingRuleModel addConditionsItem(ConditionModel conditionsItem) { - if (this.conditions == null) { - this.conditions = new ArrayList<>(); - } - this.conditions.add(conditionsItem); - return this; - } - - /** - * The list of conditions that are combined with logical AND operators. It can be one of the following: - User condition - Segment condition - Prerequisite flag condition - * @return conditions - */ - @javax.annotation.Nullable - public List getConditions() { - return conditions; - } - - public void setConditions(List conditions) { - this.conditions = conditions; - } - - - public TargetingRuleModel percentageOptions(List percentageOptions) { - this.percentageOptions = percentageOptions; - return this; - } - - public TargetingRuleModel addPercentageOptionsItem(PercentageOptionModel percentageOptionsItem) { - if (this.percentageOptions == null) { - this.percentageOptions = new ArrayList<>(); - } - this.percentageOptions.add(percentageOptionsItem); - return this; - } - - /** - * The percentage options from where the evaluation process will choose a value based on the flag's percentage evaluation attribute. - * @return percentageOptions - */ - @javax.annotation.Nullable - public List getPercentageOptions() { - return percentageOptions; - } - - public void setPercentageOptions(List percentageOptions) { - this.percentageOptions = percentageOptions; - } - - - public TargetingRuleModel value(ValueModel value) { - this.value = value; - return this; - } - - /** - * Get value - * @return value - */ - @javax.annotation.Nullable - public ValueModel getValue() { - return value; - } - - public void setValue(ValueModel value) { - this.value = value; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the TargetingRuleModel instance itself - */ - public TargetingRuleModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TargetingRuleModel targetingRuleModel = (TargetingRuleModel) o; - return Objects.equals(this.conditions, targetingRuleModel.conditions) && - Objects.equals(this.percentageOptions, targetingRuleModel.percentageOptions) && - Objects.equals(this.value, targetingRuleModel.value)&& - Objects.equals(this.additionalProperties, targetingRuleModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(conditions, percentageOptions, value, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TargetingRuleModel {\n"); - sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); - sb.append(" percentageOptions: ").append(toIndentedString(percentageOptions)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("conditions"); - openapiFields.add("percentageOptions"); - openapiFields.add("value"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TargetingRuleModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TargetingRuleModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TargetingRuleModel is not found in the empty JSON string", TargetingRuleModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("conditions") != null && !jsonObj.get("conditions").isJsonNull()) { - JsonArray jsonArrayconditions = jsonObj.getAsJsonArray("conditions"); - if (jsonArrayconditions != null) { - // ensure the json data is an array - if (!jsonObj.get("conditions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `conditions` to be an array in the JSON string but got `%s`", jsonObj.get("conditions").toString())); - } - - // validate the optional field `conditions` (array) - for (int i = 0; i < jsonArrayconditions.size(); i++) { - ConditionModel.validateJsonElement(jsonArrayconditions.get(i)); - }; - } - } - if (jsonObj.get("percentageOptions") != null && !jsonObj.get("percentageOptions").isJsonNull()) { - JsonArray jsonArraypercentageOptions = jsonObj.getAsJsonArray("percentageOptions"); - if (jsonArraypercentageOptions != null) { - // ensure the json data is an array - if (!jsonObj.get("percentageOptions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `percentageOptions` to be an array in the JSON string but got `%s`", jsonObj.get("percentageOptions").toString())); - } - - // validate the optional field `percentageOptions` (array) - for (int i = 0; i < jsonArraypercentageOptions.size(); i++) { - PercentageOptionModel.validateJsonElement(jsonArraypercentageOptions.get(i)); - }; - } - } - // validate the optional field `value` - if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { - ValueModel.validateJsonElement(jsonObj.get("value")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TargetingRuleModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TargetingRuleModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TargetingRuleModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TargetingRuleModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public TargetingRuleModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - TargetingRuleModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TargetingRuleModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of TargetingRuleModel - * @throws IOException if the JSON string is invalid with respect to TargetingRuleModel - */ - public static TargetingRuleModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TargetingRuleModel.class); - } - - /** - * Convert an instance of TargetingRuleModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateConfigRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateConfigRequest.java deleted file mode 100644 index a493157..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateConfigRequest.java +++ /dev/null @@ -1,354 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateConfigRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class UpdateConfigRequest { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_ORDER = "order"; - @SerializedName(SERIALIZED_NAME_ORDER) - private Integer order; - - public UpdateConfigRequest() { - } - - public UpdateConfigRequest name(String name) { - this.name = name; - return this; - } - - /** - * The name of the Config. - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public UpdateConfigRequest description(String description) { - this.description = description; - return this; - } - - /** - * The description of the Config. - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - - public UpdateConfigRequest order(Integer order) { - this.order = order; - return this; - } - - /** - * The order of the Config represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. - * @return order - */ - @javax.annotation.Nullable - public Integer getOrder() { - return order; - } - - public void setOrder(Integer order) { - this.order = order; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the UpdateConfigRequest instance itself - */ - public UpdateConfigRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateConfigRequest updateConfigRequest = (UpdateConfigRequest) o; - return Objects.equals(this.name, updateConfigRequest.name) && - Objects.equals(this.description, updateConfigRequest.description) && - Objects.equals(this.order, updateConfigRequest.order)&& - Objects.equals(this.additionalProperties, updateConfigRequest.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(name, description, order, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateConfigRequest {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("order"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdateConfigRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateConfigRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateConfigRequest is not found in the empty JSON string", UpdateConfigRequest.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateConfigRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateConfigRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UpdateConfigRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateConfigRequest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UpdateConfigRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UpdateConfigRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateConfigRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateConfigRequest - * @throws IOException if the JSON string is invalid with respect to UpdateConfigRequest - */ - public static UpdateConfigRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateConfigRequest.class); - } - - /** - * Convert an instance of UpdateConfigRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateEnvironmentModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateEnvironmentModel.java deleted file mode 100644 index 622daab..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateEnvironmentModel.java +++ /dev/null @@ -1,383 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateEnvironmentModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class UpdateEnvironmentModel { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_COLOR = "color"; - @SerializedName(SERIALIZED_NAME_COLOR) - private String color; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_ORDER = "order"; - @SerializedName(SERIALIZED_NAME_ORDER) - private Integer order; - - public UpdateEnvironmentModel() { - } - - public UpdateEnvironmentModel name(String name) { - this.name = name; - return this; - } - - /** - * The name of the Environment. - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public UpdateEnvironmentModel color(String color) { - this.color = color; - return this; - } - - /** - * The color of the Environment. RGB or HTML color codes are allowed. - * @return color - */ - @javax.annotation.Nullable - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - - public UpdateEnvironmentModel description(String description) { - this.description = description; - return this; - } - - /** - * The description of the Environment. - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - - public UpdateEnvironmentModel order(Integer order) { - this.order = order; - return this; - } - - /** - * The order of the Environment represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. - * @return order - */ - @javax.annotation.Nullable - public Integer getOrder() { - return order; - } - - public void setOrder(Integer order) { - this.order = order; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the UpdateEnvironmentModel instance itself - */ - public UpdateEnvironmentModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateEnvironmentModel updateEnvironmentModel = (UpdateEnvironmentModel) o; - return Objects.equals(this.name, updateEnvironmentModel.name) && - Objects.equals(this.color, updateEnvironmentModel.color) && - Objects.equals(this.description, updateEnvironmentModel.description) && - Objects.equals(this.order, updateEnvironmentModel.order)&& - Objects.equals(this.additionalProperties, updateEnvironmentModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(name, color, description, order, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateEnvironmentModel {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("color"); - openapiFields.add("description"); - openapiFields.add("order"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdateEnvironmentModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateEnvironmentModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateEnvironmentModel is not found in the empty JSON string", UpdateEnvironmentModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("color") != null && !jsonObj.get("color").isJsonNull()) && !jsonObj.get("color").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateEnvironmentModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateEnvironmentModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UpdateEnvironmentModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateEnvironmentModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UpdateEnvironmentModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UpdateEnvironmentModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateEnvironmentModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateEnvironmentModel - * @throws IOException if the JSON string is invalid with respect to UpdateEnvironmentModel - */ - public static UpdateEnvironmentModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateEnvironmentModel.class); - } - - /** - * Convert an instance of UpdateEnvironmentModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaModel.java deleted file mode 100644 index 8f0421a..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaModel.java +++ /dev/null @@ -1,387 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.TargetingRuleModel; -import com.configcat.publicapi.java.client.model.ValueModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateEvaluationFormulaModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class UpdateEvaluationFormulaModel { - public static final String SERIALIZED_NAME_DEFAULT_VALUE = "defaultValue"; - @SerializedName(SERIALIZED_NAME_DEFAULT_VALUE) - private ValueModel defaultValue; - - public static final String SERIALIZED_NAME_TARGETING_RULES = "targetingRules"; - @SerializedName(SERIALIZED_NAME_TARGETING_RULES) - private List targetingRules; - - public static final String SERIALIZED_NAME_PERCENTAGE_EVALUATION_ATTRIBUTE = "percentageEvaluationAttribute"; - @SerializedName(SERIALIZED_NAME_PERCENTAGE_EVALUATION_ATTRIBUTE) - private String percentageEvaluationAttribute; - - public UpdateEvaluationFormulaModel() { - } - - public UpdateEvaluationFormulaModel defaultValue(ValueModel defaultValue) { - this.defaultValue = defaultValue; - return this; - } - - /** - * Get defaultValue - * @return defaultValue - */ - @javax.annotation.Nonnull - public ValueModel getDefaultValue() { - return defaultValue; - } - - public void setDefaultValue(ValueModel defaultValue) { - this.defaultValue = defaultValue; - } - - - public UpdateEvaluationFormulaModel targetingRules(List targetingRules) { - this.targetingRules = targetingRules; - return this; - } - - public UpdateEvaluationFormulaModel addTargetingRulesItem(TargetingRuleModel targetingRulesItem) { - if (this.targetingRules == null) { - this.targetingRules = new ArrayList<>(); - } - this.targetingRules.add(targetingRulesItem); - return this; - } - - /** - * The targeting rules of the Feature Flag or Setting. - * @return targetingRules - */ - @javax.annotation.Nullable - public List getTargetingRules() { - return targetingRules; - } - - public void setTargetingRules(List targetingRules) { - this.targetingRules = targetingRules; - } - - - public UpdateEvaluationFormulaModel percentageEvaluationAttribute(String percentageEvaluationAttribute) { - this.percentageEvaluationAttribute = percentageEvaluationAttribute; - return this; - } - - /** - * The user attribute used for percentage evaluation. If not set, it defaults to the `Identifier` user object attribute. - * @return percentageEvaluationAttribute - */ - @javax.annotation.Nullable - public String getPercentageEvaluationAttribute() { - return percentageEvaluationAttribute; - } - - public void setPercentageEvaluationAttribute(String percentageEvaluationAttribute) { - this.percentageEvaluationAttribute = percentageEvaluationAttribute; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the UpdateEvaluationFormulaModel instance itself - */ - public UpdateEvaluationFormulaModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateEvaluationFormulaModel updateEvaluationFormulaModel = (UpdateEvaluationFormulaModel) o; - return Objects.equals(this.defaultValue, updateEvaluationFormulaModel.defaultValue) && - Objects.equals(this.targetingRules, updateEvaluationFormulaModel.targetingRules) && - Objects.equals(this.percentageEvaluationAttribute, updateEvaluationFormulaModel.percentageEvaluationAttribute)&& - Objects.equals(this.additionalProperties, updateEvaluationFormulaModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(defaultValue, targetingRules, percentageEvaluationAttribute, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateEvaluationFormulaModel {\n"); - sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); - sb.append(" targetingRules: ").append(toIndentedString(targetingRules)).append("\n"); - sb.append(" percentageEvaluationAttribute: ").append(toIndentedString(percentageEvaluationAttribute)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("defaultValue"); - openapiFields.add("targetingRules"); - openapiFields.add("percentageEvaluationAttribute"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("defaultValue"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdateEvaluationFormulaModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateEvaluationFormulaModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateEvaluationFormulaModel is not found in the empty JSON string", UpdateEvaluationFormulaModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UpdateEvaluationFormulaModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `defaultValue` - ValueModel.validateJsonElement(jsonObj.get("defaultValue")); - if (jsonObj.get("targetingRules") != null && !jsonObj.get("targetingRules").isJsonNull()) { - JsonArray jsonArraytargetingRules = jsonObj.getAsJsonArray("targetingRules"); - if (jsonArraytargetingRules != null) { - // ensure the json data is an array - if (!jsonObj.get("targetingRules").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `targetingRules` to be an array in the JSON string but got `%s`", jsonObj.get("targetingRules").toString())); - } - - // validate the optional field `targetingRules` (array) - for (int i = 0; i < jsonArraytargetingRules.size(); i++) { - TargetingRuleModel.validateJsonElement(jsonArraytargetingRules.get(i)); - }; - } - } - if ((jsonObj.get("percentageEvaluationAttribute") != null && !jsonObj.get("percentageEvaluationAttribute").isJsonNull()) && !jsonObj.get("percentageEvaluationAttribute").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `percentageEvaluationAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("percentageEvaluationAttribute").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateEvaluationFormulaModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateEvaluationFormulaModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UpdateEvaluationFormulaModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateEvaluationFormulaModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UpdateEvaluationFormulaModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UpdateEvaluationFormulaModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateEvaluationFormulaModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateEvaluationFormulaModel - * @throws IOException if the JSON string is invalid with respect to UpdateEvaluationFormulaModel - */ - public static UpdateEvaluationFormulaModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateEvaluationFormulaModel.class); - } - - /** - * Convert an instance of UpdateEvaluationFormulaModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaWithIdModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaWithIdModel.java deleted file mode 100644 index 1cdd9af..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaWithIdModel.java +++ /dev/null @@ -1,413 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.TargetingRuleModel; -import com.configcat.publicapi.java.client.model.ValueModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateEvaluationFormulaWithIdModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class UpdateEvaluationFormulaWithIdModel { - public static final String SERIALIZED_NAME_DEFAULT_VALUE = "defaultValue"; - @SerializedName(SERIALIZED_NAME_DEFAULT_VALUE) - private ValueModel defaultValue; - - public static final String SERIALIZED_NAME_TARGETING_RULES = "targetingRules"; - @SerializedName(SERIALIZED_NAME_TARGETING_RULES) - private List targetingRules; - - public static final String SERIALIZED_NAME_PERCENTAGE_EVALUATION_ATTRIBUTE = "percentageEvaluationAttribute"; - @SerializedName(SERIALIZED_NAME_PERCENTAGE_EVALUATION_ATTRIBUTE) - private String percentageEvaluationAttribute; - - public static final String SERIALIZED_NAME_SETTING_ID = "settingId"; - @SerializedName(SERIALIZED_NAME_SETTING_ID) - private Integer settingId; - - public UpdateEvaluationFormulaWithIdModel() { - } - - public UpdateEvaluationFormulaWithIdModel defaultValue(ValueModel defaultValue) { - this.defaultValue = defaultValue; - return this; - } - - /** - * Get defaultValue - * @return defaultValue - */ - @javax.annotation.Nonnull - public ValueModel getDefaultValue() { - return defaultValue; - } - - public void setDefaultValue(ValueModel defaultValue) { - this.defaultValue = defaultValue; - } - - - public UpdateEvaluationFormulaWithIdModel targetingRules(List targetingRules) { - this.targetingRules = targetingRules; - return this; - } - - public UpdateEvaluationFormulaWithIdModel addTargetingRulesItem(TargetingRuleModel targetingRulesItem) { - if (this.targetingRules == null) { - this.targetingRules = new ArrayList<>(); - } - this.targetingRules.add(targetingRulesItem); - return this; - } - - /** - * The targeting rules of the Feature Flag or Setting. - * @return targetingRules - */ - @javax.annotation.Nullable - public List getTargetingRules() { - return targetingRules; - } - - public void setTargetingRules(List targetingRules) { - this.targetingRules = targetingRules; - } - - - public UpdateEvaluationFormulaWithIdModel percentageEvaluationAttribute(String percentageEvaluationAttribute) { - this.percentageEvaluationAttribute = percentageEvaluationAttribute; - return this; - } - - /** - * The user attribute used for percentage evaluation. If not set, it defaults to the `Identifier` user object attribute. - * @return percentageEvaluationAttribute - */ - @javax.annotation.Nullable - public String getPercentageEvaluationAttribute() { - return percentageEvaluationAttribute; - } - - public void setPercentageEvaluationAttribute(String percentageEvaluationAttribute) { - this.percentageEvaluationAttribute = percentageEvaluationAttribute; - } - - - public UpdateEvaluationFormulaWithIdModel settingId(Integer settingId) { - this.settingId = settingId; - return this; - } - - /** - * The identifier of the feature flag or setting. - * @return settingId - */ - @javax.annotation.Nullable - public Integer getSettingId() { - return settingId; - } - - public void setSettingId(Integer settingId) { - this.settingId = settingId; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the UpdateEvaluationFormulaWithIdModel instance itself - */ - public UpdateEvaluationFormulaWithIdModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateEvaluationFormulaWithIdModel updateEvaluationFormulaWithIdModel = (UpdateEvaluationFormulaWithIdModel) o; - return Objects.equals(this.defaultValue, updateEvaluationFormulaWithIdModel.defaultValue) && - Objects.equals(this.targetingRules, updateEvaluationFormulaWithIdModel.targetingRules) && - Objects.equals(this.percentageEvaluationAttribute, updateEvaluationFormulaWithIdModel.percentageEvaluationAttribute) && - Objects.equals(this.settingId, updateEvaluationFormulaWithIdModel.settingId)&& - Objects.equals(this.additionalProperties, updateEvaluationFormulaWithIdModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(defaultValue, targetingRules, percentageEvaluationAttribute, settingId, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateEvaluationFormulaWithIdModel {\n"); - sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); - sb.append(" targetingRules: ").append(toIndentedString(targetingRules)).append("\n"); - sb.append(" percentageEvaluationAttribute: ").append(toIndentedString(percentageEvaluationAttribute)).append("\n"); - sb.append(" settingId: ").append(toIndentedString(settingId)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("defaultValue"); - openapiFields.add("targetingRules"); - openapiFields.add("percentageEvaluationAttribute"); - openapiFields.add("settingId"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("defaultValue"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdateEvaluationFormulaWithIdModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateEvaluationFormulaWithIdModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateEvaluationFormulaWithIdModel is not found in the empty JSON string", UpdateEvaluationFormulaWithIdModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UpdateEvaluationFormulaWithIdModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `defaultValue` - ValueModel.validateJsonElement(jsonObj.get("defaultValue")); - if (jsonObj.get("targetingRules") != null && !jsonObj.get("targetingRules").isJsonNull()) { - JsonArray jsonArraytargetingRules = jsonObj.getAsJsonArray("targetingRules"); - if (jsonArraytargetingRules != null) { - // ensure the json data is an array - if (!jsonObj.get("targetingRules").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `targetingRules` to be an array in the JSON string but got `%s`", jsonObj.get("targetingRules").toString())); - } - - // validate the optional field `targetingRules` (array) - for (int i = 0; i < jsonArraytargetingRules.size(); i++) { - TargetingRuleModel.validateJsonElement(jsonArraytargetingRules.get(i)); - }; - } - } - if ((jsonObj.get("percentageEvaluationAttribute") != null && !jsonObj.get("percentageEvaluationAttribute").isJsonNull()) && !jsonObj.get("percentageEvaluationAttribute").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `percentageEvaluationAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("percentageEvaluationAttribute").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateEvaluationFormulaWithIdModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateEvaluationFormulaWithIdModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UpdateEvaluationFormulaWithIdModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateEvaluationFormulaWithIdModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UpdateEvaluationFormulaWithIdModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UpdateEvaluationFormulaWithIdModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateEvaluationFormulaWithIdModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateEvaluationFormulaWithIdModel - * @throws IOException if the JSON string is invalid with respect to UpdateEvaluationFormulaWithIdModel - */ - public static UpdateEvaluationFormulaWithIdModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateEvaluationFormulaWithIdModel.class); - } - - /** - * Convert an instance of UpdateEvaluationFormulaWithIdModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulasModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulasModel.java deleted file mode 100644 index 1e0b555..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulasModel.java +++ /dev/null @@ -1,321 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.UpdateEvaluationFormulaWithIdModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateEvaluationFormulasModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class UpdateEvaluationFormulasModel { - public static final String SERIALIZED_NAME_UPDATE_FORMULAS = "updateFormulas"; - @SerializedName(SERIALIZED_NAME_UPDATE_FORMULAS) - private List updateFormulas; - - public UpdateEvaluationFormulasModel() { - } - - public UpdateEvaluationFormulasModel updateFormulas(List updateFormulas) { - this.updateFormulas = updateFormulas; - return this; - } - - public UpdateEvaluationFormulasModel addUpdateFormulasItem(UpdateEvaluationFormulaWithIdModel updateFormulasItem) { - if (this.updateFormulas == null) { - this.updateFormulas = new ArrayList<>(); - } - this.updateFormulas.add(updateFormulasItem); - return this; - } - - /** - * Evaluation descriptors of each updated Feature Flag and Setting. - * @return updateFormulas - */ - @javax.annotation.Nullable - public List getUpdateFormulas() { - return updateFormulas; - } - - public void setUpdateFormulas(List updateFormulas) { - this.updateFormulas = updateFormulas; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the UpdateEvaluationFormulasModel instance itself - */ - public UpdateEvaluationFormulasModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateEvaluationFormulasModel updateEvaluationFormulasModel = (UpdateEvaluationFormulasModel) o; - return Objects.equals(this.updateFormulas, updateEvaluationFormulasModel.updateFormulas)&& - Objects.equals(this.additionalProperties, updateEvaluationFormulasModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(updateFormulas, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateEvaluationFormulasModel {\n"); - sb.append(" updateFormulas: ").append(toIndentedString(updateFormulas)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("updateFormulas"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdateEvaluationFormulasModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateEvaluationFormulasModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateEvaluationFormulasModel is not found in the empty JSON string", UpdateEvaluationFormulasModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("updateFormulas") != null && !jsonObj.get("updateFormulas").isJsonNull()) { - JsonArray jsonArrayupdateFormulas = jsonObj.getAsJsonArray("updateFormulas"); - if (jsonArrayupdateFormulas != null) { - // ensure the json data is an array - if (!jsonObj.get("updateFormulas").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `updateFormulas` to be an array in the JSON string but got `%s`", jsonObj.get("updateFormulas").toString())); - } - - // validate the optional field `updateFormulas` (array) - for (int i = 0; i < jsonArrayupdateFormulas.size(); i++) { - UpdateEvaluationFormulaWithIdModel.validateJsonElement(jsonArrayupdateFormulas.get(i)); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateEvaluationFormulasModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateEvaluationFormulasModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UpdateEvaluationFormulasModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateEvaluationFormulasModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UpdateEvaluationFormulasModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UpdateEvaluationFormulasModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateEvaluationFormulasModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateEvaluationFormulasModel - * @throws IOException if the JSON string is invalid with respect to UpdateEvaluationFormulasModel - */ - public static UpdateEvaluationFormulasModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateEvaluationFormulasModel.class); - } - - /** - * Convert an instance of UpdateEvaluationFormulasModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateMemberPermissionsRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateMemberPermissionsRequest.java deleted file mode 100644 index 4689ab5..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateMemberPermissionsRequest.java +++ /dev/null @@ -1,388 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateMemberPermissionsRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class UpdateMemberPermissionsRequest { - public static final String SERIALIZED_NAME_PERMISSION_GROUP_IDS = "permissionGroupIds"; - @SerializedName(SERIALIZED_NAME_PERMISSION_GROUP_IDS) - private List permissionGroupIds; - - public static final String SERIALIZED_NAME_IS_ADMIN = "isAdmin"; - @SerializedName(SERIALIZED_NAME_IS_ADMIN) - private Boolean isAdmin; - - public static final String SERIALIZED_NAME_IS_BILLING_MANAGER = "isBillingManager"; - @SerializedName(SERIALIZED_NAME_IS_BILLING_MANAGER) - private Boolean isBillingManager; - - public static final String SERIALIZED_NAME_REMOVE_FROM_PERMISSION_GROUPS_WHERE_ID_NOT_SET = "removeFromPermissionGroupsWhereIdNotSet"; - @SerializedName(SERIALIZED_NAME_REMOVE_FROM_PERMISSION_GROUPS_WHERE_ID_NOT_SET) - private Boolean removeFromPermissionGroupsWhereIdNotSet; - - public UpdateMemberPermissionsRequest() { - } - - public UpdateMemberPermissionsRequest permissionGroupIds(List permissionGroupIds) { - this.permissionGroupIds = permissionGroupIds; - return this; - } - - public UpdateMemberPermissionsRequest addPermissionGroupIdsItem(Long permissionGroupIdsItem) { - if (this.permissionGroupIds == null) { - this.permissionGroupIds = new ArrayList<>(); - } - this.permissionGroupIds.add(permissionGroupIdsItem); - return this; - } - - /** - * List of Permission Group identifiers to where the Member should be added. - * @return permissionGroupIds - */ - @javax.annotation.Nullable - public List getPermissionGroupIds() { - return permissionGroupIds; - } - - public void setPermissionGroupIds(List permissionGroupIds) { - this.permissionGroupIds = permissionGroupIds; - } - - - public UpdateMemberPermissionsRequest isAdmin(Boolean isAdmin) { - this.isAdmin = isAdmin; - return this; - } - - /** - * Indicates that the member must be Organization Admin. - * @return isAdmin - */ - @javax.annotation.Nullable - public Boolean getIsAdmin() { - return isAdmin; - } - - public void setIsAdmin(Boolean isAdmin) { - this.isAdmin = isAdmin; - } - - - public UpdateMemberPermissionsRequest isBillingManager(Boolean isBillingManager) { - this.isBillingManager = isBillingManager; - return this; - } - - /** - * Indicates that the member must be Billing Manager. - * @return isBillingManager - */ - @javax.annotation.Nullable - public Boolean getIsBillingManager() { - return isBillingManager; - } - - public void setIsBillingManager(Boolean isBillingManager) { - this.isBillingManager = isBillingManager; - } - - - public UpdateMemberPermissionsRequest removeFromPermissionGroupsWhereIdNotSet(Boolean removeFromPermissionGroupsWhereIdNotSet) { - this.removeFromPermissionGroupsWhereIdNotSet = removeFromPermissionGroupsWhereIdNotSet; - return this; - } - - /** - * When `true`, the member will be removed from those Permission Groups that are not listed in the `permissionGroupIds` field. - * @return removeFromPermissionGroupsWhereIdNotSet - */ - @javax.annotation.Nullable - public Boolean getRemoveFromPermissionGroupsWhereIdNotSet() { - return removeFromPermissionGroupsWhereIdNotSet; - } - - public void setRemoveFromPermissionGroupsWhereIdNotSet(Boolean removeFromPermissionGroupsWhereIdNotSet) { - this.removeFromPermissionGroupsWhereIdNotSet = removeFromPermissionGroupsWhereIdNotSet; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the UpdateMemberPermissionsRequest instance itself - */ - public UpdateMemberPermissionsRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateMemberPermissionsRequest updateMemberPermissionsRequest = (UpdateMemberPermissionsRequest) o; - return Objects.equals(this.permissionGroupIds, updateMemberPermissionsRequest.permissionGroupIds) && - Objects.equals(this.isAdmin, updateMemberPermissionsRequest.isAdmin) && - Objects.equals(this.isBillingManager, updateMemberPermissionsRequest.isBillingManager) && - Objects.equals(this.removeFromPermissionGroupsWhereIdNotSet, updateMemberPermissionsRequest.removeFromPermissionGroupsWhereIdNotSet)&& - Objects.equals(this.additionalProperties, updateMemberPermissionsRequest.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(permissionGroupIds, isAdmin, isBillingManager, removeFromPermissionGroupsWhereIdNotSet, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateMemberPermissionsRequest {\n"); - sb.append(" permissionGroupIds: ").append(toIndentedString(permissionGroupIds)).append("\n"); - sb.append(" isAdmin: ").append(toIndentedString(isAdmin)).append("\n"); - sb.append(" isBillingManager: ").append(toIndentedString(isBillingManager)).append("\n"); - sb.append(" removeFromPermissionGroupsWhereIdNotSet: ").append(toIndentedString(removeFromPermissionGroupsWhereIdNotSet)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("permissionGroupIds"); - openapiFields.add("isAdmin"); - openapiFields.add("isBillingManager"); - openapiFields.add("removeFromPermissionGroupsWhereIdNotSet"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdateMemberPermissionsRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateMemberPermissionsRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateMemberPermissionsRequest is not found in the empty JSON string", UpdateMemberPermissionsRequest.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the optional json data is an array if present - if (jsonObj.get("permissionGroupIds") != null && !jsonObj.get("permissionGroupIds").isJsonNull() && !jsonObj.get("permissionGroupIds").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `permissionGroupIds` to be an array in the JSON string but got `%s`", jsonObj.get("permissionGroupIds").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateMemberPermissionsRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateMemberPermissionsRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UpdateMemberPermissionsRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateMemberPermissionsRequest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UpdateMemberPermissionsRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UpdateMemberPermissionsRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateMemberPermissionsRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateMemberPermissionsRequest - * @throws IOException if the JSON string is invalid with respect to UpdateMemberPermissionsRequest - */ - public static UpdateMemberPermissionsRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateMemberPermissionsRequest.class); - } - - /** - * Convert an instance of UpdateMemberPermissionsRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdatePermissionGroupRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdatePermissionGroupRequest.java deleted file mode 100644 index 459ffb5..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdatePermissionGroupRequest.java +++ /dev/null @@ -1,958 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.AccessType; -import com.configcat.publicapi.java.client.model.CreateOrUpdateEnvironmentAccessModel; -import com.configcat.publicapi.java.client.model.EnvironmentAccessType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdatePermissionGroupRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class UpdatePermissionGroupRequest { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_CAN_MANAGE_MEMBERS = "canManageMembers"; - @SerializedName(SERIALIZED_NAME_CAN_MANAGE_MEMBERS) - private Boolean canManageMembers; - - public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_CONFIG = "canCreateOrUpdateConfig"; - @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_CONFIG) - private Boolean canCreateOrUpdateConfig; - - public static final String SERIALIZED_NAME_CAN_DELETE_CONFIG = "canDeleteConfig"; - @SerializedName(SERIALIZED_NAME_CAN_DELETE_CONFIG) - private Boolean canDeleteConfig; - - public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_ENVIRONMENT = "canCreateOrUpdateEnvironment"; - @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_ENVIRONMENT) - private Boolean canCreateOrUpdateEnvironment; - - public static final String SERIALIZED_NAME_CAN_DELETE_ENVIRONMENT = "canDeleteEnvironment"; - @SerializedName(SERIALIZED_NAME_CAN_DELETE_ENVIRONMENT) - private Boolean canDeleteEnvironment; - - public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SETTING = "canCreateOrUpdateSetting"; - @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SETTING) - private Boolean canCreateOrUpdateSetting; - - public static final String SERIALIZED_NAME_CAN_TAG_SETTING = "canTagSetting"; - @SerializedName(SERIALIZED_NAME_CAN_TAG_SETTING) - private Boolean canTagSetting; - - public static final String SERIALIZED_NAME_CAN_DELETE_SETTING = "canDeleteSetting"; - @SerializedName(SERIALIZED_NAME_CAN_DELETE_SETTING) - private Boolean canDeleteSetting; - - public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_TAG = "canCreateOrUpdateTag"; - @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_TAG) - private Boolean canCreateOrUpdateTag; - - public static final String SERIALIZED_NAME_CAN_DELETE_TAG = "canDeleteTag"; - @SerializedName(SERIALIZED_NAME_CAN_DELETE_TAG) - private Boolean canDeleteTag; - - public static final String SERIALIZED_NAME_CAN_MANAGE_WEBHOOK = "canManageWebhook"; - @SerializedName(SERIALIZED_NAME_CAN_MANAGE_WEBHOOK) - private Boolean canManageWebhook; - - public static final String SERIALIZED_NAME_CAN_USE_EXPORT_IMPORT = "canUseExportImport"; - @SerializedName(SERIALIZED_NAME_CAN_USE_EXPORT_IMPORT) - private Boolean canUseExportImport; - - public static final String SERIALIZED_NAME_CAN_MANAGE_PRODUCT_PREFERENCES = "canManageProductPreferences"; - @SerializedName(SERIALIZED_NAME_CAN_MANAGE_PRODUCT_PREFERENCES) - private Boolean canManageProductPreferences; - - public static final String SERIALIZED_NAME_CAN_MANAGE_INTEGRATIONS = "canManageIntegrations"; - @SerializedName(SERIALIZED_NAME_CAN_MANAGE_INTEGRATIONS) - private Boolean canManageIntegrations; - - public static final String SERIALIZED_NAME_CAN_VIEW_SDK_KEY = "canViewSdkKey"; - @SerializedName(SERIALIZED_NAME_CAN_VIEW_SDK_KEY) - private Boolean canViewSdkKey; - - public static final String SERIALIZED_NAME_CAN_ROTATE_SDK_KEY = "canRotateSdkKey"; - @SerializedName(SERIALIZED_NAME_CAN_ROTATE_SDK_KEY) - private Boolean canRotateSdkKey; - - public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SEGMENTS = "canCreateOrUpdateSegments"; - @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SEGMENTS) - private Boolean canCreateOrUpdateSegments; - - public static final String SERIALIZED_NAME_CAN_DELETE_SEGMENTS = "canDeleteSegments"; - @SerializedName(SERIALIZED_NAME_CAN_DELETE_SEGMENTS) - private Boolean canDeleteSegments; - - public static final String SERIALIZED_NAME_CAN_VIEW_PRODUCT_AUDIT_LOG = "canViewProductAuditLog"; - @SerializedName(SERIALIZED_NAME_CAN_VIEW_PRODUCT_AUDIT_LOG) - private Boolean canViewProductAuditLog; - - public static final String SERIALIZED_NAME_CAN_VIEW_PRODUCT_STATISTICS = "canViewProductStatistics"; - @SerializedName(SERIALIZED_NAME_CAN_VIEW_PRODUCT_STATISTICS) - private Boolean canViewProductStatistics; - - public static final String SERIALIZED_NAME_CAN_DISABLE2_F_A = "canDisable2FA"; - @SerializedName(SERIALIZED_NAME_CAN_DISABLE2_F_A) - private Boolean canDisable2FA; - - public static final String SERIALIZED_NAME_ACCESS_TYPE = "accessType"; - @SerializedName(SERIALIZED_NAME_ACCESS_TYPE) - private AccessType accessType; - - public static final String SERIALIZED_NAME_NEW_ENVIRONMENT_ACCESS_TYPE = "newEnvironmentAccessType"; - @SerializedName(SERIALIZED_NAME_NEW_ENVIRONMENT_ACCESS_TYPE) - private EnvironmentAccessType newEnvironmentAccessType; - - public static final String SERIALIZED_NAME_ENVIRONMENT_ACCESSES = "environmentAccesses"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ACCESSES) - private List environmentAccesses; - - public UpdatePermissionGroupRequest() { - } - - public UpdatePermissionGroupRequest name(String name) { - this.name = name; - return this; - } - - /** - * Name of the Permission Group. - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public UpdatePermissionGroupRequest canManageMembers(Boolean canManageMembers) { - this.canManageMembers = canManageMembers; - return this; - } - - /** - * Group members can manage team members. - * @return canManageMembers - */ - @javax.annotation.Nullable - public Boolean getCanManageMembers() { - return canManageMembers; - } - - public void setCanManageMembers(Boolean canManageMembers) { - this.canManageMembers = canManageMembers; - } - - - public UpdatePermissionGroupRequest canCreateOrUpdateConfig(Boolean canCreateOrUpdateConfig) { - this.canCreateOrUpdateConfig = canCreateOrUpdateConfig; - return this; - } - - /** - * Group members can create/update Configs. - * @return canCreateOrUpdateConfig - */ - @javax.annotation.Nullable - public Boolean getCanCreateOrUpdateConfig() { - return canCreateOrUpdateConfig; - } - - public void setCanCreateOrUpdateConfig(Boolean canCreateOrUpdateConfig) { - this.canCreateOrUpdateConfig = canCreateOrUpdateConfig; - } - - - public UpdatePermissionGroupRequest canDeleteConfig(Boolean canDeleteConfig) { - this.canDeleteConfig = canDeleteConfig; - return this; - } - - /** - * Group members can delete Configs. - * @return canDeleteConfig - */ - @javax.annotation.Nullable - public Boolean getCanDeleteConfig() { - return canDeleteConfig; - } - - public void setCanDeleteConfig(Boolean canDeleteConfig) { - this.canDeleteConfig = canDeleteConfig; - } - - - public UpdatePermissionGroupRequest canCreateOrUpdateEnvironment(Boolean canCreateOrUpdateEnvironment) { - this.canCreateOrUpdateEnvironment = canCreateOrUpdateEnvironment; - return this; - } - - /** - * Group members can create/update Environments. - * @return canCreateOrUpdateEnvironment - */ - @javax.annotation.Nullable - public Boolean getCanCreateOrUpdateEnvironment() { - return canCreateOrUpdateEnvironment; - } - - public void setCanCreateOrUpdateEnvironment(Boolean canCreateOrUpdateEnvironment) { - this.canCreateOrUpdateEnvironment = canCreateOrUpdateEnvironment; - } - - - public UpdatePermissionGroupRequest canDeleteEnvironment(Boolean canDeleteEnvironment) { - this.canDeleteEnvironment = canDeleteEnvironment; - return this; - } - - /** - * Group members can delete Environments. - * @return canDeleteEnvironment - */ - @javax.annotation.Nullable - public Boolean getCanDeleteEnvironment() { - return canDeleteEnvironment; - } - - public void setCanDeleteEnvironment(Boolean canDeleteEnvironment) { - this.canDeleteEnvironment = canDeleteEnvironment; - } - - - public UpdatePermissionGroupRequest canCreateOrUpdateSetting(Boolean canCreateOrUpdateSetting) { - this.canCreateOrUpdateSetting = canCreateOrUpdateSetting; - return this; - } - - /** - * Group members can create/update Feature Flags and Settings. - * @return canCreateOrUpdateSetting - */ - @javax.annotation.Nullable - public Boolean getCanCreateOrUpdateSetting() { - return canCreateOrUpdateSetting; - } - - public void setCanCreateOrUpdateSetting(Boolean canCreateOrUpdateSetting) { - this.canCreateOrUpdateSetting = canCreateOrUpdateSetting; - } - - - public UpdatePermissionGroupRequest canTagSetting(Boolean canTagSetting) { - this.canTagSetting = canTagSetting; - return this; - } - - /** - * Group members can attach/detach Tags to Feature Flags and Settings. - * @return canTagSetting - */ - @javax.annotation.Nullable - public Boolean getCanTagSetting() { - return canTagSetting; - } - - public void setCanTagSetting(Boolean canTagSetting) { - this.canTagSetting = canTagSetting; - } - - - public UpdatePermissionGroupRequest canDeleteSetting(Boolean canDeleteSetting) { - this.canDeleteSetting = canDeleteSetting; - return this; - } - - /** - * Group members can delete Feature Flags and Settings. - * @return canDeleteSetting - */ - @javax.annotation.Nullable - public Boolean getCanDeleteSetting() { - return canDeleteSetting; - } - - public void setCanDeleteSetting(Boolean canDeleteSetting) { - this.canDeleteSetting = canDeleteSetting; - } - - - public UpdatePermissionGroupRequest canCreateOrUpdateTag(Boolean canCreateOrUpdateTag) { - this.canCreateOrUpdateTag = canCreateOrUpdateTag; - return this; - } - - /** - * Group members can create/update Tags. - * @return canCreateOrUpdateTag - */ - @javax.annotation.Nullable - public Boolean getCanCreateOrUpdateTag() { - return canCreateOrUpdateTag; - } - - public void setCanCreateOrUpdateTag(Boolean canCreateOrUpdateTag) { - this.canCreateOrUpdateTag = canCreateOrUpdateTag; - } - - - public UpdatePermissionGroupRequest canDeleteTag(Boolean canDeleteTag) { - this.canDeleteTag = canDeleteTag; - return this; - } - - /** - * Group members can delete Tags. - * @return canDeleteTag - */ - @javax.annotation.Nullable - public Boolean getCanDeleteTag() { - return canDeleteTag; - } - - public void setCanDeleteTag(Boolean canDeleteTag) { - this.canDeleteTag = canDeleteTag; - } - - - public UpdatePermissionGroupRequest canManageWebhook(Boolean canManageWebhook) { - this.canManageWebhook = canManageWebhook; - return this; - } - - /** - * Group members can create/update/delete Webhooks. - * @return canManageWebhook - */ - @javax.annotation.Nullable - public Boolean getCanManageWebhook() { - return canManageWebhook; - } - - public void setCanManageWebhook(Boolean canManageWebhook) { - this.canManageWebhook = canManageWebhook; - } - - - public UpdatePermissionGroupRequest canUseExportImport(Boolean canUseExportImport) { - this.canUseExportImport = canUseExportImport; - return this; - } - - /** - * Group members can use the export/import feature. - * @return canUseExportImport - */ - @javax.annotation.Nullable - public Boolean getCanUseExportImport() { - return canUseExportImport; - } - - public void setCanUseExportImport(Boolean canUseExportImport) { - this.canUseExportImport = canUseExportImport; - } - - - public UpdatePermissionGroupRequest canManageProductPreferences(Boolean canManageProductPreferences) { - this.canManageProductPreferences = canManageProductPreferences; - return this; - } - - /** - * Group members can update Product preferences. - * @return canManageProductPreferences - */ - @javax.annotation.Nullable - public Boolean getCanManageProductPreferences() { - return canManageProductPreferences; - } - - public void setCanManageProductPreferences(Boolean canManageProductPreferences) { - this.canManageProductPreferences = canManageProductPreferences; - } - - - public UpdatePermissionGroupRequest canManageIntegrations(Boolean canManageIntegrations) { - this.canManageIntegrations = canManageIntegrations; - return this; - } - - /** - * Group members can add and configure integrations. - * @return canManageIntegrations - */ - @javax.annotation.Nullable - public Boolean getCanManageIntegrations() { - return canManageIntegrations; - } - - public void setCanManageIntegrations(Boolean canManageIntegrations) { - this.canManageIntegrations = canManageIntegrations; - } - - - public UpdatePermissionGroupRequest canViewSdkKey(Boolean canViewSdkKey) { - this.canViewSdkKey = canViewSdkKey; - return this; - } - - /** - * Group members has access to SDK keys. - * @return canViewSdkKey - */ - @javax.annotation.Nullable - public Boolean getCanViewSdkKey() { - return canViewSdkKey; - } - - public void setCanViewSdkKey(Boolean canViewSdkKey) { - this.canViewSdkKey = canViewSdkKey; - } - - - public UpdatePermissionGroupRequest canRotateSdkKey(Boolean canRotateSdkKey) { - this.canRotateSdkKey = canRotateSdkKey; - return this; - } - - /** - * Group members can rotate SDK keys. - * @return canRotateSdkKey - */ - @javax.annotation.Nullable - public Boolean getCanRotateSdkKey() { - return canRotateSdkKey; - } - - public void setCanRotateSdkKey(Boolean canRotateSdkKey) { - this.canRotateSdkKey = canRotateSdkKey; - } - - - public UpdatePermissionGroupRequest canCreateOrUpdateSegments(Boolean canCreateOrUpdateSegments) { - this.canCreateOrUpdateSegments = canCreateOrUpdateSegments; - return this; - } - - /** - * Group members can create/update Segments. - * @return canCreateOrUpdateSegments - */ - @javax.annotation.Nullable - public Boolean getCanCreateOrUpdateSegments() { - return canCreateOrUpdateSegments; - } - - public void setCanCreateOrUpdateSegments(Boolean canCreateOrUpdateSegments) { - this.canCreateOrUpdateSegments = canCreateOrUpdateSegments; - } - - - public UpdatePermissionGroupRequest canDeleteSegments(Boolean canDeleteSegments) { - this.canDeleteSegments = canDeleteSegments; - return this; - } - - /** - * Group members can delete Segments. - * @return canDeleteSegments - */ - @javax.annotation.Nullable - public Boolean getCanDeleteSegments() { - return canDeleteSegments; - } - - public void setCanDeleteSegments(Boolean canDeleteSegments) { - this.canDeleteSegments = canDeleteSegments; - } - - - public UpdatePermissionGroupRequest canViewProductAuditLog(Boolean canViewProductAuditLog) { - this.canViewProductAuditLog = canViewProductAuditLog; - return this; - } - - /** - * Group members has access to audit logs. - * @return canViewProductAuditLog - */ - @javax.annotation.Nullable - public Boolean getCanViewProductAuditLog() { - return canViewProductAuditLog; - } - - public void setCanViewProductAuditLog(Boolean canViewProductAuditLog) { - this.canViewProductAuditLog = canViewProductAuditLog; - } - - - public UpdatePermissionGroupRequest canViewProductStatistics(Boolean canViewProductStatistics) { - this.canViewProductStatistics = canViewProductStatistics; - return this; - } - - /** - * Group members has access to product statistics. - * @return canViewProductStatistics - */ - @javax.annotation.Nullable - public Boolean getCanViewProductStatistics() { - return canViewProductStatistics; - } - - public void setCanViewProductStatistics(Boolean canViewProductStatistics) { - this.canViewProductStatistics = canViewProductStatistics; - } - - - public UpdatePermissionGroupRequest canDisable2FA(Boolean canDisable2FA) { - this.canDisable2FA = canDisable2FA; - return this; - } - - /** - * Group members can disable two-factor authentication for other members. - * @return canDisable2FA - */ - @javax.annotation.Nullable - public Boolean getCanDisable2FA() { - return canDisable2FA; - } - - public void setCanDisable2FA(Boolean canDisable2FA) { - this.canDisable2FA = canDisable2FA; - } - - - public UpdatePermissionGroupRequest accessType(AccessType accessType) { - this.accessType = accessType; - return this; - } - - /** - * Get accessType - * @return accessType - */ - @javax.annotation.Nullable - public AccessType getAccessType() { - return accessType; - } - - public void setAccessType(AccessType accessType) { - this.accessType = accessType; - } - - - public UpdatePermissionGroupRequest newEnvironmentAccessType(EnvironmentAccessType newEnvironmentAccessType) { - this.newEnvironmentAccessType = newEnvironmentAccessType; - return this; - } - - /** - * Get newEnvironmentAccessType - * @return newEnvironmentAccessType - */ - @javax.annotation.Nullable - public EnvironmentAccessType getNewEnvironmentAccessType() { - return newEnvironmentAccessType; - } - - public void setNewEnvironmentAccessType(EnvironmentAccessType newEnvironmentAccessType) { - this.newEnvironmentAccessType = newEnvironmentAccessType; - } - - - public UpdatePermissionGroupRequest environmentAccesses(List environmentAccesses) { - this.environmentAccesses = environmentAccesses; - return this; - } - - public UpdatePermissionGroupRequest addEnvironmentAccessesItem(CreateOrUpdateEnvironmentAccessModel environmentAccessesItem) { - if (this.environmentAccesses == null) { - this.environmentAccesses = new ArrayList<>(); - } - this.environmentAccesses.add(environmentAccessesItem); - return this; - } - - /** - * List of environment specific permissions. - * @return environmentAccesses - */ - @javax.annotation.Nullable - public List getEnvironmentAccesses() { - return environmentAccesses; - } - - public void setEnvironmentAccesses(List environmentAccesses) { - this.environmentAccesses = environmentAccesses; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the UpdatePermissionGroupRequest instance itself - */ - public UpdatePermissionGroupRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdatePermissionGroupRequest updatePermissionGroupRequest = (UpdatePermissionGroupRequest) o; - return Objects.equals(this.name, updatePermissionGroupRequest.name) && - Objects.equals(this.canManageMembers, updatePermissionGroupRequest.canManageMembers) && - Objects.equals(this.canCreateOrUpdateConfig, updatePermissionGroupRequest.canCreateOrUpdateConfig) && - Objects.equals(this.canDeleteConfig, updatePermissionGroupRequest.canDeleteConfig) && - Objects.equals(this.canCreateOrUpdateEnvironment, updatePermissionGroupRequest.canCreateOrUpdateEnvironment) && - Objects.equals(this.canDeleteEnvironment, updatePermissionGroupRequest.canDeleteEnvironment) && - Objects.equals(this.canCreateOrUpdateSetting, updatePermissionGroupRequest.canCreateOrUpdateSetting) && - Objects.equals(this.canTagSetting, updatePermissionGroupRequest.canTagSetting) && - Objects.equals(this.canDeleteSetting, updatePermissionGroupRequest.canDeleteSetting) && - Objects.equals(this.canCreateOrUpdateTag, updatePermissionGroupRequest.canCreateOrUpdateTag) && - Objects.equals(this.canDeleteTag, updatePermissionGroupRequest.canDeleteTag) && - Objects.equals(this.canManageWebhook, updatePermissionGroupRequest.canManageWebhook) && - Objects.equals(this.canUseExportImport, updatePermissionGroupRequest.canUseExportImport) && - Objects.equals(this.canManageProductPreferences, updatePermissionGroupRequest.canManageProductPreferences) && - Objects.equals(this.canManageIntegrations, updatePermissionGroupRequest.canManageIntegrations) && - Objects.equals(this.canViewSdkKey, updatePermissionGroupRequest.canViewSdkKey) && - Objects.equals(this.canRotateSdkKey, updatePermissionGroupRequest.canRotateSdkKey) && - Objects.equals(this.canCreateOrUpdateSegments, updatePermissionGroupRequest.canCreateOrUpdateSegments) && - Objects.equals(this.canDeleteSegments, updatePermissionGroupRequest.canDeleteSegments) && - Objects.equals(this.canViewProductAuditLog, updatePermissionGroupRequest.canViewProductAuditLog) && - Objects.equals(this.canViewProductStatistics, updatePermissionGroupRequest.canViewProductStatistics) && - Objects.equals(this.canDisable2FA, updatePermissionGroupRequest.canDisable2FA) && - Objects.equals(this.accessType, updatePermissionGroupRequest.accessType) && - Objects.equals(this.newEnvironmentAccessType, updatePermissionGroupRequest.newEnvironmentAccessType) && - Objects.equals(this.environmentAccesses, updatePermissionGroupRequest.environmentAccesses)&& - Objects.equals(this.additionalProperties, updatePermissionGroupRequest.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(name, canManageMembers, canCreateOrUpdateConfig, canDeleteConfig, canCreateOrUpdateEnvironment, canDeleteEnvironment, canCreateOrUpdateSetting, canTagSetting, canDeleteSetting, canCreateOrUpdateTag, canDeleteTag, canManageWebhook, canUseExportImport, canManageProductPreferences, canManageIntegrations, canViewSdkKey, canRotateSdkKey, canCreateOrUpdateSegments, canDeleteSegments, canViewProductAuditLog, canViewProductStatistics, canDisable2FA, accessType, newEnvironmentAccessType, environmentAccesses, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdatePermissionGroupRequest {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" canManageMembers: ").append(toIndentedString(canManageMembers)).append("\n"); - sb.append(" canCreateOrUpdateConfig: ").append(toIndentedString(canCreateOrUpdateConfig)).append("\n"); - sb.append(" canDeleteConfig: ").append(toIndentedString(canDeleteConfig)).append("\n"); - sb.append(" canCreateOrUpdateEnvironment: ").append(toIndentedString(canCreateOrUpdateEnvironment)).append("\n"); - sb.append(" canDeleteEnvironment: ").append(toIndentedString(canDeleteEnvironment)).append("\n"); - sb.append(" canCreateOrUpdateSetting: ").append(toIndentedString(canCreateOrUpdateSetting)).append("\n"); - sb.append(" canTagSetting: ").append(toIndentedString(canTagSetting)).append("\n"); - sb.append(" canDeleteSetting: ").append(toIndentedString(canDeleteSetting)).append("\n"); - sb.append(" canCreateOrUpdateTag: ").append(toIndentedString(canCreateOrUpdateTag)).append("\n"); - sb.append(" canDeleteTag: ").append(toIndentedString(canDeleteTag)).append("\n"); - sb.append(" canManageWebhook: ").append(toIndentedString(canManageWebhook)).append("\n"); - sb.append(" canUseExportImport: ").append(toIndentedString(canUseExportImport)).append("\n"); - sb.append(" canManageProductPreferences: ").append(toIndentedString(canManageProductPreferences)).append("\n"); - sb.append(" canManageIntegrations: ").append(toIndentedString(canManageIntegrations)).append("\n"); - sb.append(" canViewSdkKey: ").append(toIndentedString(canViewSdkKey)).append("\n"); - sb.append(" canRotateSdkKey: ").append(toIndentedString(canRotateSdkKey)).append("\n"); - sb.append(" canCreateOrUpdateSegments: ").append(toIndentedString(canCreateOrUpdateSegments)).append("\n"); - sb.append(" canDeleteSegments: ").append(toIndentedString(canDeleteSegments)).append("\n"); - sb.append(" canViewProductAuditLog: ").append(toIndentedString(canViewProductAuditLog)).append("\n"); - sb.append(" canViewProductStatistics: ").append(toIndentedString(canViewProductStatistics)).append("\n"); - sb.append(" canDisable2FA: ").append(toIndentedString(canDisable2FA)).append("\n"); - sb.append(" accessType: ").append(toIndentedString(accessType)).append("\n"); - sb.append(" newEnvironmentAccessType: ").append(toIndentedString(newEnvironmentAccessType)).append("\n"); - sb.append(" environmentAccesses: ").append(toIndentedString(environmentAccesses)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("canManageMembers"); - openapiFields.add("canCreateOrUpdateConfig"); - openapiFields.add("canDeleteConfig"); - openapiFields.add("canCreateOrUpdateEnvironment"); - openapiFields.add("canDeleteEnvironment"); - openapiFields.add("canCreateOrUpdateSetting"); - openapiFields.add("canTagSetting"); - openapiFields.add("canDeleteSetting"); - openapiFields.add("canCreateOrUpdateTag"); - openapiFields.add("canDeleteTag"); - openapiFields.add("canManageWebhook"); - openapiFields.add("canUseExportImport"); - openapiFields.add("canManageProductPreferences"); - openapiFields.add("canManageIntegrations"); - openapiFields.add("canViewSdkKey"); - openapiFields.add("canRotateSdkKey"); - openapiFields.add("canCreateOrUpdateSegments"); - openapiFields.add("canDeleteSegments"); - openapiFields.add("canViewProductAuditLog"); - openapiFields.add("canViewProductStatistics"); - openapiFields.add("canDisable2FA"); - openapiFields.add("accessType"); - openapiFields.add("newEnvironmentAccessType"); - openapiFields.add("environmentAccesses"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdatePermissionGroupRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdatePermissionGroupRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UpdatePermissionGroupRequest is not found in the empty JSON string", UpdatePermissionGroupRequest.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - // validate the optional field `accessType` - if (jsonObj.get("accessType") != null && !jsonObj.get("accessType").isJsonNull()) { - AccessType.validateJsonElement(jsonObj.get("accessType")); - } - // validate the optional field `newEnvironmentAccessType` - if (jsonObj.get("newEnvironmentAccessType") != null && !jsonObj.get("newEnvironmentAccessType").isJsonNull()) { - EnvironmentAccessType.validateJsonElement(jsonObj.get("newEnvironmentAccessType")); - } - if (jsonObj.get("environmentAccesses") != null && !jsonObj.get("environmentAccesses").isJsonNull()) { - JsonArray jsonArrayenvironmentAccesses = jsonObj.getAsJsonArray("environmentAccesses"); - if (jsonArrayenvironmentAccesses != null) { - // ensure the json data is an array - if (!jsonObj.get("environmentAccesses").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `environmentAccesses` to be an array in the JSON string but got `%s`", jsonObj.get("environmentAccesses").toString())); - } - - // validate the optional field `environmentAccesses` (array) - for (int i = 0; i < jsonArrayenvironmentAccesses.size(); i++) { - CreateOrUpdateEnvironmentAccessModel.validateJsonElement(jsonArrayenvironmentAccesses.get(i)); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdatePermissionGroupRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdatePermissionGroupRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UpdatePermissionGroupRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdatePermissionGroupRequest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UpdatePermissionGroupRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UpdatePermissionGroupRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UpdatePermissionGroupRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdatePermissionGroupRequest - * @throws IOException if the JSON string is invalid with respect to UpdatePermissionGroupRequest - */ - public static UpdatePermissionGroupRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdatePermissionGroupRequest.class); - } - - /** - * Convert an instance of UpdatePermissionGroupRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdatePreferencesRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdatePreferencesRequest.java deleted file mode 100644 index 1a1c2f4..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdatePreferencesRequest.java +++ /dev/null @@ -1,430 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.KeyGenerationMode; -import com.configcat.publicapi.java.client.model.UpdateReasonRequiredEnvironmentModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdatePreferencesRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class UpdatePreferencesRequest { - public static final String SERIALIZED_NAME_REASON_REQUIRED = "reasonRequired"; - @SerializedName(SERIALIZED_NAME_REASON_REQUIRED) - private Boolean reasonRequired; - - public static final String SERIALIZED_NAME_KEY_GENERATION_MODE = "keyGenerationMode"; - @SerializedName(SERIALIZED_NAME_KEY_GENERATION_MODE) - private KeyGenerationMode keyGenerationMode; - - public static final String SERIALIZED_NAME_SHOW_VARIATION_ID = "showVariationId"; - @SerializedName(SERIALIZED_NAME_SHOW_VARIATION_ID) - private Boolean showVariationId; - - public static final String SERIALIZED_NAME_MANDATORY_SETTING_HINT = "mandatorySettingHint"; - @SerializedName(SERIALIZED_NAME_MANDATORY_SETTING_HINT) - private Boolean mandatorySettingHint; - - public static final String SERIALIZED_NAME_REASON_REQUIRED_ENVIRONMENTS = "reasonRequiredEnvironments"; - @SerializedName(SERIALIZED_NAME_REASON_REQUIRED_ENVIRONMENTS) - private List reasonRequiredEnvironments; - - public UpdatePreferencesRequest() { - } - - public UpdatePreferencesRequest reasonRequired(Boolean reasonRequired) { - this.reasonRequired = reasonRequired; - return this; - } - - /** - * Indicates that a mandatory note is required for saving and publishing. - * @return reasonRequired - */ - @javax.annotation.Nullable - public Boolean getReasonRequired() { - return reasonRequired; - } - - public void setReasonRequired(Boolean reasonRequired) { - this.reasonRequired = reasonRequired; - } - - - public UpdatePreferencesRequest keyGenerationMode(KeyGenerationMode keyGenerationMode) { - this.keyGenerationMode = keyGenerationMode; - return this; - } - - /** - * Get keyGenerationMode - * @return keyGenerationMode - */ - @javax.annotation.Nullable - public KeyGenerationMode getKeyGenerationMode() { - return keyGenerationMode; - } - - public void setKeyGenerationMode(KeyGenerationMode keyGenerationMode) { - this.keyGenerationMode = keyGenerationMode; - } - - - public UpdatePreferencesRequest showVariationId(Boolean showVariationId) { - this.showVariationId = showVariationId; - return this; - } - - /** - * Indicates whether a variation ID's must be shown on the ConfigCat Dashboard. - * @return showVariationId - */ - @javax.annotation.Nullable - public Boolean getShowVariationId() { - return showVariationId; - } - - public void setShowVariationId(Boolean showVariationId) { - this.showVariationId = showVariationId; - } - - - public UpdatePreferencesRequest mandatorySettingHint(Boolean mandatorySettingHint) { - this.mandatorySettingHint = mandatorySettingHint; - return this; - } - - /** - * Indicates whether Feature flags and Settings must have a hint. - * @return mandatorySettingHint - */ - @javax.annotation.Nullable - public Boolean getMandatorySettingHint() { - return mandatorySettingHint; - } - - public void setMandatorySettingHint(Boolean mandatorySettingHint) { - this.mandatorySettingHint = mandatorySettingHint; - } - - - public UpdatePreferencesRequest reasonRequiredEnvironments(List reasonRequiredEnvironments) { - this.reasonRequiredEnvironments = reasonRequiredEnvironments; - return this; - } - - public UpdatePreferencesRequest addReasonRequiredEnvironmentsItem(UpdateReasonRequiredEnvironmentModel reasonRequiredEnvironmentsItem) { - if (this.reasonRequiredEnvironments == null) { - this.reasonRequiredEnvironments = new ArrayList<>(); - } - this.reasonRequiredEnvironments.add(reasonRequiredEnvironmentsItem); - return this; - } - - /** - * List of Environments where mandatory note must be set before saving and publishing. - * @return reasonRequiredEnvironments - */ - @javax.annotation.Nullable - public List getReasonRequiredEnvironments() { - return reasonRequiredEnvironments; - } - - public void setReasonRequiredEnvironments(List reasonRequiredEnvironments) { - this.reasonRequiredEnvironments = reasonRequiredEnvironments; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the UpdatePreferencesRequest instance itself - */ - public UpdatePreferencesRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdatePreferencesRequest updatePreferencesRequest = (UpdatePreferencesRequest) o; - return Objects.equals(this.reasonRequired, updatePreferencesRequest.reasonRequired) && - Objects.equals(this.keyGenerationMode, updatePreferencesRequest.keyGenerationMode) && - Objects.equals(this.showVariationId, updatePreferencesRequest.showVariationId) && - Objects.equals(this.mandatorySettingHint, updatePreferencesRequest.mandatorySettingHint) && - Objects.equals(this.reasonRequiredEnvironments, updatePreferencesRequest.reasonRequiredEnvironments)&& - Objects.equals(this.additionalProperties, updatePreferencesRequest.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(reasonRequired, keyGenerationMode, showVariationId, mandatorySettingHint, reasonRequiredEnvironments, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdatePreferencesRequest {\n"); - sb.append(" reasonRequired: ").append(toIndentedString(reasonRequired)).append("\n"); - sb.append(" keyGenerationMode: ").append(toIndentedString(keyGenerationMode)).append("\n"); - sb.append(" showVariationId: ").append(toIndentedString(showVariationId)).append("\n"); - sb.append(" mandatorySettingHint: ").append(toIndentedString(mandatorySettingHint)).append("\n"); - sb.append(" reasonRequiredEnvironments: ").append(toIndentedString(reasonRequiredEnvironments)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("reasonRequired"); - openapiFields.add("keyGenerationMode"); - openapiFields.add("showVariationId"); - openapiFields.add("mandatorySettingHint"); - openapiFields.add("reasonRequiredEnvironments"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdatePreferencesRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdatePreferencesRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UpdatePreferencesRequest is not found in the empty JSON string", UpdatePreferencesRequest.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `keyGenerationMode` - if (jsonObj.get("keyGenerationMode") != null && !jsonObj.get("keyGenerationMode").isJsonNull()) { - KeyGenerationMode.validateJsonElement(jsonObj.get("keyGenerationMode")); - } - if (jsonObj.get("reasonRequiredEnvironments") != null && !jsonObj.get("reasonRequiredEnvironments").isJsonNull()) { - JsonArray jsonArrayreasonRequiredEnvironments = jsonObj.getAsJsonArray("reasonRequiredEnvironments"); - if (jsonArrayreasonRequiredEnvironments != null) { - // ensure the json data is an array - if (!jsonObj.get("reasonRequiredEnvironments").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `reasonRequiredEnvironments` to be an array in the JSON string but got `%s`", jsonObj.get("reasonRequiredEnvironments").toString())); - } - - // validate the optional field `reasonRequiredEnvironments` (array) - for (int i = 0; i < jsonArrayreasonRequiredEnvironments.size(); i++) { - UpdateReasonRequiredEnvironmentModel.validateJsonElement(jsonArrayreasonRequiredEnvironments.get(i)); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdatePreferencesRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdatePreferencesRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UpdatePreferencesRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdatePreferencesRequest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UpdatePreferencesRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UpdatePreferencesRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UpdatePreferencesRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdatePreferencesRequest - * @throws IOException if the JSON string is invalid with respect to UpdatePreferencesRequest - */ - public static UpdatePreferencesRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdatePreferencesRequest.class); - } - - /** - * Convert an instance of UpdatePreferencesRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateProductRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateProductRequest.java deleted file mode 100644 index 424e70f..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateProductRequest.java +++ /dev/null @@ -1,354 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateProductRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class UpdateProductRequest { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_ORDER = "order"; - @SerializedName(SERIALIZED_NAME_ORDER) - private Integer order; - - public UpdateProductRequest() { - } - - public UpdateProductRequest name(String name) { - this.name = name; - return this; - } - - /** - * The name of the Product. - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public UpdateProductRequest description(String description) { - this.description = description; - return this; - } - - /** - * The description of the Product. - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - - public UpdateProductRequest order(Integer order) { - this.order = order; - return this; - } - - /** - * The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. - * @return order - */ - @javax.annotation.Nullable - public Integer getOrder() { - return order; - } - - public void setOrder(Integer order) { - this.order = order; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the UpdateProductRequest instance itself - */ - public UpdateProductRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateProductRequest updateProductRequest = (UpdateProductRequest) o; - return Objects.equals(this.name, updateProductRequest.name) && - Objects.equals(this.description, updateProductRequest.description) && - Objects.equals(this.order, updateProductRequest.order)&& - Objects.equals(this.additionalProperties, updateProductRequest.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(name, description, order, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateProductRequest {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("order"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdateProductRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateProductRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateProductRequest is not found in the empty JSON string", UpdateProductRequest.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateProductRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateProductRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UpdateProductRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateProductRequest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UpdateProductRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UpdateProductRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateProductRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateProductRequest - * @throws IOException if the JSON string is invalid with respect to UpdateProductRequest - */ - public static UpdateProductRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateProductRequest.class); - } - - /** - * Convert an instance of UpdateProductRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateReasonRequiredEnvironmentModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateReasonRequiredEnvironmentModel.java deleted file mode 100644 index 1a5a906..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateReasonRequiredEnvironmentModel.java +++ /dev/null @@ -1,314 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.UUID; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateReasonRequiredEnvironmentModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class UpdateReasonRequiredEnvironmentModel { - public static final String SERIALIZED_NAME_ENVIRONMENT_ID = "environmentId"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) - private UUID environmentId; - - public static final String SERIALIZED_NAME_REASON_REQUIRED = "reasonRequired"; - @SerializedName(SERIALIZED_NAME_REASON_REQUIRED) - private Boolean reasonRequired; - - public UpdateReasonRequiredEnvironmentModel() { - } - - public UpdateReasonRequiredEnvironmentModel environmentId(UUID environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Identifier of the Environment. - * @return environmentId - */ - @javax.annotation.Nullable - public UUID getEnvironmentId() { - return environmentId; - } - - public void setEnvironmentId(UUID environmentId) { - this.environmentId = environmentId; - } - - - public UpdateReasonRequiredEnvironmentModel reasonRequired(Boolean reasonRequired) { - this.reasonRequired = reasonRequired; - return this; - } - - /** - * Indicates that a mandatory note is required in this Environment for saving and publishing. - * @return reasonRequired - */ - @javax.annotation.Nullable - public Boolean getReasonRequired() { - return reasonRequired; - } - - public void setReasonRequired(Boolean reasonRequired) { - this.reasonRequired = reasonRequired; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the UpdateReasonRequiredEnvironmentModel instance itself - */ - public UpdateReasonRequiredEnvironmentModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateReasonRequiredEnvironmentModel updateReasonRequiredEnvironmentModel = (UpdateReasonRequiredEnvironmentModel) o; - return Objects.equals(this.environmentId, updateReasonRequiredEnvironmentModel.environmentId) && - Objects.equals(this.reasonRequired, updateReasonRequiredEnvironmentModel.reasonRequired)&& - Objects.equals(this.additionalProperties, updateReasonRequiredEnvironmentModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(environmentId, reasonRequired, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateReasonRequiredEnvironmentModel {\n"); - sb.append(" environmentId: ").append(toIndentedString(environmentId)).append("\n"); - sb.append(" reasonRequired: ").append(toIndentedString(reasonRequired)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("environmentId"); - openapiFields.add("reasonRequired"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdateReasonRequiredEnvironmentModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateReasonRequiredEnvironmentModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateReasonRequiredEnvironmentModel is not found in the empty JSON string", UpdateReasonRequiredEnvironmentModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("environmentId") != null && !jsonObj.get("environmentId").isJsonNull()) && !jsonObj.get("environmentId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `environmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateReasonRequiredEnvironmentModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateReasonRequiredEnvironmentModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UpdateReasonRequiredEnvironmentModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateReasonRequiredEnvironmentModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UpdateReasonRequiredEnvironmentModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UpdateReasonRequiredEnvironmentModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateReasonRequiredEnvironmentModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateReasonRequiredEnvironmentModel - * @throws IOException if the JSON string is invalid with respect to UpdateReasonRequiredEnvironmentModel - */ - public static UpdateReasonRequiredEnvironmentModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateReasonRequiredEnvironmentModel.class); - } - - /** - * Convert an instance of UpdateReasonRequiredEnvironmentModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateSegmentModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateSegmentModel.java deleted file mode 100644 index af597ba..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateSegmentModel.java +++ /dev/null @@ -1,417 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.RolloutRuleComparator; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateSegmentModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class UpdateSegmentModel { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_COMPARISON_ATTRIBUTE = "comparisonAttribute"; - @SerializedName(SERIALIZED_NAME_COMPARISON_ATTRIBUTE) - private String comparisonAttribute; - - public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; - @SerializedName(SERIALIZED_NAME_COMPARATOR) - private RolloutRuleComparator comparator; - - public static final String SERIALIZED_NAME_COMPARISON_VALUE = "comparisonValue"; - @SerializedName(SERIALIZED_NAME_COMPARISON_VALUE) - private String comparisonValue; - - public UpdateSegmentModel() { - } - - public UpdateSegmentModel name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public UpdateSegmentModel description(String description) { - this.description = description; - return this; - } - - /** - * Get description - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - - public UpdateSegmentModel comparisonAttribute(String comparisonAttribute) { - this.comparisonAttribute = comparisonAttribute; - return this; - } - - /** - * Get comparisonAttribute - * @return comparisonAttribute - */ - @javax.annotation.Nullable - public String getComparisonAttribute() { - return comparisonAttribute; - } - - public void setComparisonAttribute(String comparisonAttribute) { - this.comparisonAttribute = comparisonAttribute; - } - - - public UpdateSegmentModel comparator(RolloutRuleComparator comparator) { - this.comparator = comparator; - return this; - } - - /** - * Get comparator - * @return comparator - */ - @javax.annotation.Nullable - public RolloutRuleComparator getComparator() { - return comparator; - } - - public void setComparator(RolloutRuleComparator comparator) { - this.comparator = comparator; - } - - - public UpdateSegmentModel comparisonValue(String comparisonValue) { - this.comparisonValue = comparisonValue; - return this; - } - - /** - * Get comparisonValue - * @return comparisonValue - */ - @javax.annotation.Nullable - public String getComparisonValue() { - return comparisonValue; - } - - public void setComparisonValue(String comparisonValue) { - this.comparisonValue = comparisonValue; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the UpdateSegmentModel instance itself - */ - public UpdateSegmentModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateSegmentModel updateSegmentModel = (UpdateSegmentModel) o; - return Objects.equals(this.name, updateSegmentModel.name) && - Objects.equals(this.description, updateSegmentModel.description) && - Objects.equals(this.comparisonAttribute, updateSegmentModel.comparisonAttribute) && - Objects.equals(this.comparator, updateSegmentModel.comparator) && - Objects.equals(this.comparisonValue, updateSegmentModel.comparisonValue)&& - Objects.equals(this.additionalProperties, updateSegmentModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(name, description, comparisonAttribute, comparator, comparisonValue, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateSegmentModel {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" comparisonAttribute: ").append(toIndentedString(comparisonAttribute)).append("\n"); - sb.append(" comparator: ").append(toIndentedString(comparator)).append("\n"); - sb.append(" comparisonValue: ").append(toIndentedString(comparisonValue)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("comparisonAttribute"); - openapiFields.add("comparator"); - openapiFields.add("comparisonValue"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdateSegmentModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateSegmentModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateSegmentModel is not found in the empty JSON string", UpdateSegmentModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if ((jsonObj.get("comparisonAttribute") != null && !jsonObj.get("comparisonAttribute").isJsonNull()) && !jsonObj.get("comparisonAttribute").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `comparisonAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonAttribute").toString())); - } - // validate the optional field `comparator` - if (jsonObj.get("comparator") != null && !jsonObj.get("comparator").isJsonNull()) { - RolloutRuleComparator.validateJsonElement(jsonObj.get("comparator")); - } - if ((jsonObj.get("comparisonValue") != null && !jsonObj.get("comparisonValue").isJsonNull()) && !jsonObj.get("comparisonValue").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `comparisonValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonValue").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateSegmentModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateSegmentModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UpdateSegmentModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateSegmentModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UpdateSegmentModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UpdateSegmentModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateSegmentModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateSegmentModel - * @throws IOException if the JSON string is invalid with respect to UpdateSegmentModel - */ - public static UpdateSegmentModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateSegmentModel.class); - } - - /** - * Convert an instance of UpdateSegmentModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueModel.java deleted file mode 100644 index 4164fb8..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueModel.java +++ /dev/null @@ -1,396 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.RolloutPercentageItemModel; -import com.configcat.publicapi.java.client.model.RolloutRuleModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateSettingValueModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class UpdateSettingValueModel { - public static final String SERIALIZED_NAME_ROLLOUT_RULES = "rolloutRules"; - @SerializedName(SERIALIZED_NAME_ROLLOUT_RULES) - private List rolloutRules; - - public static final String SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS = "rolloutPercentageItems"; - @SerializedName(SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS) - private List rolloutPercentageItems; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private Object value = null; - - public UpdateSettingValueModel() { - } - - public UpdateSettingValueModel rolloutRules(List rolloutRules) { - this.rolloutRules = rolloutRules; - return this; - } - - public UpdateSettingValueModel addRolloutRulesItem(RolloutRuleModel rolloutRulesItem) { - if (this.rolloutRules == null) { - this.rolloutRules = new ArrayList<>(); - } - this.rolloutRules.add(rolloutRulesItem); - return this; - } - - /** - * The targeting rule collection. - * @return rolloutRules - */ - @javax.annotation.Nullable - public List getRolloutRules() { - return rolloutRules; - } - - public void setRolloutRules(List rolloutRules) { - this.rolloutRules = rolloutRules; - } - - - public UpdateSettingValueModel rolloutPercentageItems(List rolloutPercentageItems) { - this.rolloutPercentageItems = rolloutPercentageItems; - return this; - } - - public UpdateSettingValueModel addRolloutPercentageItemsItem(RolloutPercentageItemModel rolloutPercentageItemsItem) { - if (this.rolloutPercentageItems == null) { - this.rolloutPercentageItems = new ArrayList<>(); - } - this.rolloutPercentageItems.add(rolloutPercentageItemsItem); - return this; - } - - /** - * The percentage rule collection. - * @return rolloutPercentageItems - */ - @javax.annotation.Nullable - public List getRolloutPercentageItems() { - return rolloutPercentageItems; - } - - public void setRolloutPercentageItems(List rolloutPercentageItems) { - this.rolloutPercentageItems = rolloutPercentageItems; - } - - - public UpdateSettingValueModel value(Object value) { - this.value = value; - return this; - } - - /** - * The value to serve. It must respect the setting type. - * @return value - */ - @javax.annotation.Nullable - public Object getValue() { - return value; - } - - public void setValue(Object value) { - this.value = value; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the UpdateSettingValueModel instance itself - */ - public UpdateSettingValueModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateSettingValueModel updateSettingValueModel = (UpdateSettingValueModel) o; - return Objects.equals(this.rolloutRules, updateSettingValueModel.rolloutRules) && - Objects.equals(this.rolloutPercentageItems, updateSettingValueModel.rolloutPercentageItems) && - Objects.equals(this.value, updateSettingValueModel.value)&& - Objects.equals(this.additionalProperties, updateSettingValueModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(rolloutRules, rolloutPercentageItems, value, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateSettingValueModel {\n"); - sb.append(" rolloutRules: ").append(toIndentedString(rolloutRules)).append("\n"); - sb.append(" rolloutPercentageItems: ").append(toIndentedString(rolloutPercentageItems)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("rolloutRules"); - openapiFields.add("rolloutPercentageItems"); - openapiFields.add("value"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdateSettingValueModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateSettingValueModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateSettingValueModel is not found in the empty JSON string", UpdateSettingValueModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("rolloutRules") != null && !jsonObj.get("rolloutRules").isJsonNull()) { - JsonArray jsonArrayrolloutRules = jsonObj.getAsJsonArray("rolloutRules"); - if (jsonArrayrolloutRules != null) { - // ensure the json data is an array - if (!jsonObj.get("rolloutRules").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `rolloutRules` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutRules").toString())); - } - - // validate the optional field `rolloutRules` (array) - for (int i = 0; i < jsonArrayrolloutRules.size(); i++) { - RolloutRuleModel.validateJsonElement(jsonArrayrolloutRules.get(i)); - }; - } - } - if (jsonObj.get("rolloutPercentageItems") != null && !jsonObj.get("rolloutPercentageItems").isJsonNull()) { - JsonArray jsonArrayrolloutPercentageItems = jsonObj.getAsJsonArray("rolloutPercentageItems"); - if (jsonArrayrolloutPercentageItems != null) { - // ensure the json data is an array - if (!jsonObj.get("rolloutPercentageItems").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `rolloutPercentageItems` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutPercentageItems").toString())); - } - - // validate the optional field `rolloutPercentageItems` (array) - for (int i = 0; i < jsonArrayrolloutPercentageItems.size(); i++) { - RolloutPercentageItemModel.validateJsonElement(jsonArrayrolloutPercentageItems.get(i)); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateSettingValueModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateSettingValueModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UpdateSettingValueModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateSettingValueModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UpdateSettingValueModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UpdateSettingValueModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateSettingValueModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateSettingValueModel - * @throws IOException if the JSON string is invalid with respect to UpdateSettingValueModel - */ - public static UpdateSettingValueModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateSettingValueModel.class); - } - - /** - * Convert an instance of UpdateSettingValueModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueWithSettingIdModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueWithSettingIdModel.java deleted file mode 100644 index 6a256f9..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueWithSettingIdModel.java +++ /dev/null @@ -1,422 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.RolloutPercentageItemModel; -import com.configcat.publicapi.java.client.model.RolloutRuleModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateSettingValueWithSettingIdModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class UpdateSettingValueWithSettingIdModel { - public static final String SERIALIZED_NAME_ROLLOUT_RULES = "rolloutRules"; - @SerializedName(SERIALIZED_NAME_ROLLOUT_RULES) - private List rolloutRules; - - public static final String SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS = "rolloutPercentageItems"; - @SerializedName(SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS) - private List rolloutPercentageItems; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private Object value = null; - - public static final String SERIALIZED_NAME_SETTING_ID = "settingId"; - @SerializedName(SERIALIZED_NAME_SETTING_ID) - private Integer settingId; - - public UpdateSettingValueWithSettingIdModel() { - } - - public UpdateSettingValueWithSettingIdModel rolloutRules(List rolloutRules) { - this.rolloutRules = rolloutRules; - return this; - } - - public UpdateSettingValueWithSettingIdModel addRolloutRulesItem(RolloutRuleModel rolloutRulesItem) { - if (this.rolloutRules == null) { - this.rolloutRules = new ArrayList<>(); - } - this.rolloutRules.add(rolloutRulesItem); - return this; - } - - /** - * The targeting rule collection. - * @return rolloutRules - */ - @javax.annotation.Nullable - public List getRolloutRules() { - return rolloutRules; - } - - public void setRolloutRules(List rolloutRules) { - this.rolloutRules = rolloutRules; - } - - - public UpdateSettingValueWithSettingIdModel rolloutPercentageItems(List rolloutPercentageItems) { - this.rolloutPercentageItems = rolloutPercentageItems; - return this; - } - - public UpdateSettingValueWithSettingIdModel addRolloutPercentageItemsItem(RolloutPercentageItemModel rolloutPercentageItemsItem) { - if (this.rolloutPercentageItems == null) { - this.rolloutPercentageItems = new ArrayList<>(); - } - this.rolloutPercentageItems.add(rolloutPercentageItemsItem); - return this; - } - - /** - * The percentage rule collection. - * @return rolloutPercentageItems - */ - @javax.annotation.Nullable - public List getRolloutPercentageItems() { - return rolloutPercentageItems; - } - - public void setRolloutPercentageItems(List rolloutPercentageItems) { - this.rolloutPercentageItems = rolloutPercentageItems; - } - - - public UpdateSettingValueWithSettingIdModel value(Object value) { - this.value = value; - return this; - } - - /** - * The value to serve. It must respect the setting type. - * @return value - */ - @javax.annotation.Nullable - public Object getValue() { - return value; - } - - public void setValue(Object value) { - this.value = value; - } - - - public UpdateSettingValueWithSettingIdModel settingId(Integer settingId) { - this.settingId = settingId; - return this; - } - - /** - * The id of the Setting. - * @return settingId - */ - @javax.annotation.Nullable - public Integer getSettingId() { - return settingId; - } - - public void setSettingId(Integer settingId) { - this.settingId = settingId; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the UpdateSettingValueWithSettingIdModel instance itself - */ - public UpdateSettingValueWithSettingIdModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateSettingValueWithSettingIdModel updateSettingValueWithSettingIdModel = (UpdateSettingValueWithSettingIdModel) o; - return Objects.equals(this.rolloutRules, updateSettingValueWithSettingIdModel.rolloutRules) && - Objects.equals(this.rolloutPercentageItems, updateSettingValueWithSettingIdModel.rolloutPercentageItems) && - Objects.equals(this.value, updateSettingValueWithSettingIdModel.value) && - Objects.equals(this.settingId, updateSettingValueWithSettingIdModel.settingId)&& - Objects.equals(this.additionalProperties, updateSettingValueWithSettingIdModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(rolloutRules, rolloutPercentageItems, value, settingId, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateSettingValueWithSettingIdModel {\n"); - sb.append(" rolloutRules: ").append(toIndentedString(rolloutRules)).append("\n"); - sb.append(" rolloutPercentageItems: ").append(toIndentedString(rolloutPercentageItems)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" settingId: ").append(toIndentedString(settingId)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("rolloutRules"); - openapiFields.add("rolloutPercentageItems"); - openapiFields.add("value"); - openapiFields.add("settingId"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdateSettingValueWithSettingIdModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateSettingValueWithSettingIdModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateSettingValueWithSettingIdModel is not found in the empty JSON string", UpdateSettingValueWithSettingIdModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("rolloutRules") != null && !jsonObj.get("rolloutRules").isJsonNull()) { - JsonArray jsonArrayrolloutRules = jsonObj.getAsJsonArray("rolloutRules"); - if (jsonArrayrolloutRules != null) { - // ensure the json data is an array - if (!jsonObj.get("rolloutRules").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `rolloutRules` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutRules").toString())); - } - - // validate the optional field `rolloutRules` (array) - for (int i = 0; i < jsonArrayrolloutRules.size(); i++) { - RolloutRuleModel.validateJsonElement(jsonArrayrolloutRules.get(i)); - }; - } - } - if (jsonObj.get("rolloutPercentageItems") != null && !jsonObj.get("rolloutPercentageItems").isJsonNull()) { - JsonArray jsonArrayrolloutPercentageItems = jsonObj.getAsJsonArray("rolloutPercentageItems"); - if (jsonArrayrolloutPercentageItems != null) { - // ensure the json data is an array - if (!jsonObj.get("rolloutPercentageItems").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `rolloutPercentageItems` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutPercentageItems").toString())); - } - - // validate the optional field `rolloutPercentageItems` (array) - for (int i = 0; i < jsonArrayrolloutPercentageItems.size(); i++) { - RolloutPercentageItemModel.validateJsonElement(jsonArrayrolloutPercentageItems.get(i)); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateSettingValueWithSettingIdModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateSettingValueWithSettingIdModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UpdateSettingValueWithSettingIdModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateSettingValueWithSettingIdModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UpdateSettingValueWithSettingIdModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UpdateSettingValueWithSettingIdModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateSettingValueWithSettingIdModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateSettingValueWithSettingIdModel - * @throws IOException if the JSON string is invalid with respect to UpdateSettingValueWithSettingIdModel - */ - public static UpdateSettingValueWithSettingIdModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateSettingValueWithSettingIdModel.class); - } - - /** - * Convert an instance of UpdateSettingValueWithSettingIdModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValuesWithIdModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValuesWithIdModel.java deleted file mode 100644 index 5ae1294..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValuesWithIdModel.java +++ /dev/null @@ -1,321 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.UpdateSettingValueWithSettingIdModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateSettingValuesWithIdModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class UpdateSettingValuesWithIdModel { - public static final String SERIALIZED_NAME_SETTING_VALUES = "settingValues"; - @SerializedName(SERIALIZED_NAME_SETTING_VALUES) - private List settingValues; - - public UpdateSettingValuesWithIdModel() { - } - - public UpdateSettingValuesWithIdModel settingValues(List settingValues) { - this.settingValues = settingValues; - return this; - } - - public UpdateSettingValuesWithIdModel addSettingValuesItem(UpdateSettingValueWithSettingIdModel settingValuesItem) { - if (this.settingValues == null) { - this.settingValues = new ArrayList<>(); - } - this.settingValues.add(settingValuesItem); - return this; - } - - /** - * The values to update. - * @return settingValues - */ - @javax.annotation.Nullable - public List getSettingValues() { - return settingValues; - } - - public void setSettingValues(List settingValues) { - this.settingValues = settingValues; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the UpdateSettingValuesWithIdModel instance itself - */ - public UpdateSettingValuesWithIdModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateSettingValuesWithIdModel updateSettingValuesWithIdModel = (UpdateSettingValuesWithIdModel) o; - return Objects.equals(this.settingValues, updateSettingValuesWithIdModel.settingValues)&& - Objects.equals(this.additionalProperties, updateSettingValuesWithIdModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(settingValues, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateSettingValuesWithIdModel {\n"); - sb.append(" settingValues: ").append(toIndentedString(settingValues)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("settingValues"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdateSettingValuesWithIdModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateSettingValuesWithIdModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateSettingValuesWithIdModel is not found in the empty JSON string", UpdateSettingValuesWithIdModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("settingValues") != null && !jsonObj.get("settingValues").isJsonNull()) { - JsonArray jsonArraysettingValues = jsonObj.getAsJsonArray("settingValues"); - if (jsonArraysettingValues != null) { - // ensure the json data is an array - if (!jsonObj.get("settingValues").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `settingValues` to be an array in the JSON string but got `%s`", jsonObj.get("settingValues").toString())); - } - - // validate the optional field `settingValues` (array) - for (int i = 0; i < jsonArraysettingValues.size(); i++) { - UpdateSettingValueWithSettingIdModel.validateJsonElement(jsonArraysettingValues.get(i)); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateSettingValuesWithIdModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateSettingValuesWithIdModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UpdateSettingValuesWithIdModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateSettingValuesWithIdModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UpdateSettingValuesWithIdModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UpdateSettingValuesWithIdModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateSettingValuesWithIdModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateSettingValuesWithIdModel - * @throws IOException if the JSON string is invalid with respect to UpdateSettingValuesWithIdModel - */ - public static UpdateSettingValuesWithIdModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateSettingValuesWithIdModel.class); - } - - /** - * Convert an instance of UpdateSettingValuesWithIdModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateTagModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateTagModel.java deleted file mode 100644 index 45d5895..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateTagModel.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateTagModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class UpdateTagModel { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_COLOR = "color"; - @SerializedName(SERIALIZED_NAME_COLOR) - private String color; - - public UpdateTagModel() { - } - - public UpdateTagModel name(String name) { - this.name = name; - return this; - } - - /** - * Name of the Tag. - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public UpdateTagModel color(String color) { - this.color = color; - return this; - } - - /** - * Color of the Tag. Possible values: `panther`, `whale`, `salmon`, `lizard`, `canary`, `koala`, or any HTML color code. - * @return color - */ - @javax.annotation.Nullable - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the UpdateTagModel instance itself - */ - public UpdateTagModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateTagModel updateTagModel = (UpdateTagModel) o; - return Objects.equals(this.name, updateTagModel.name) && - Objects.equals(this.color, updateTagModel.color)&& - Objects.equals(this.additionalProperties, updateTagModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(name, color, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateTagModel {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("color"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdateTagModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateTagModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateTagModel is not found in the empty JSON string", UpdateTagModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("color") != null && !jsonObj.get("color").isJsonNull()) && !jsonObj.get("color").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateTagModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateTagModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UpdateTagModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateTagModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UpdateTagModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UpdateTagModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateTagModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateTagModel - * @throws IOException if the JSON string is invalid with respect to UpdateTagModel - */ - public static UpdateTagModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateTagModel.class); - } - - /** - * Convert an instance of UpdateTagModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UserComparator.java b/src/main/java/com/configcat/publicapi/java/client/model/UserComparator.java deleted file mode 100644 index c8a4362..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/UserComparator.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * The comparison operator which defines the relation between the comparison attribute and the comparison value. - */ -@JsonAdapter(UserComparator.Adapter.class) -public enum UserComparator { - - IS_ONE_OF("isOneOf"), - - IS_NOT_ONE_OF("isNotOneOf"), - - CONTAINS_ANY_OF("containsAnyOf"), - - DOES_NOT_CONTAIN_ANY_OF("doesNotContainAnyOf"), - - SEM_VER_IS_ONE_OF("semVerIsOneOf"), - - SEM_VER_IS_NOT_ONE_OF("semVerIsNotOneOf"), - - SEM_VER_LESS("semVerLess"), - - SEM_VER_LESS_OR_EQUALS("semVerLessOrEquals"), - - SEM_VER_GREATER("semVerGreater"), - - SEM_VER_GREATER_OR_EQUALS("semVerGreaterOrEquals"), - - NUMBER_EQUALS("numberEquals"), - - NUMBER_DOES_NOT_EQUAL("numberDoesNotEqual"), - - NUMBER_LESS("numberLess"), - - NUMBER_LESS_OR_EQUALS("numberLessOrEquals"), - - NUMBER_GREATER("numberGreater"), - - NUMBER_GREATER_OR_EQUALS("numberGreaterOrEquals"), - - SENSITIVE_IS_ONE_OF("sensitiveIsOneOf"), - - SENSITIVE_IS_NOT_ONE_OF("sensitiveIsNotOneOf"), - - DATE_TIME_BEFORE("dateTimeBefore"), - - DATE_TIME_AFTER("dateTimeAfter"), - - SENSITIVE_TEXT_EQUALS("sensitiveTextEquals"), - - SENSITIVE_TEXT_DOES_NOT_EQUAL("sensitiveTextDoesNotEqual"), - - SENSITIVE_TEXT_STARTS_WITH_ANY_OF("sensitiveTextStartsWithAnyOf"), - - SENSITIVE_TEXT_NOT_STARTS_WITH_ANY_OF("sensitiveTextNotStartsWithAnyOf"), - - SENSITIVE_TEXT_ENDS_WITH_ANY_OF("sensitiveTextEndsWithAnyOf"), - - SENSITIVE_TEXT_NOT_ENDS_WITH_ANY_OF("sensitiveTextNotEndsWithAnyOf"), - - SENSITIVE_ARRAY_CONTAINS_ANY_OF("sensitiveArrayContainsAnyOf"), - - SENSITIVE_ARRAY_DOES_NOT_CONTAIN_ANY_OF("sensitiveArrayDoesNotContainAnyOf"), - - TEXT_EQUALS("textEquals"), - - TEXT_DOES_NOT_EQUAL("textDoesNotEqual"), - - TEXT_STARTS_WITH_ANY_OF("textStartsWithAnyOf"), - - TEXT_NOT_STARTS_WITH_ANY_OF("textNotStartsWithAnyOf"), - - TEXT_ENDS_WITH_ANY_OF("textEndsWithAnyOf"), - - TEXT_NOT_ENDS_WITH_ANY_OF("textNotEndsWithAnyOf"), - - ARRAY_CONTAINS_ANY_OF("arrayContainsAnyOf"), - - ARRAY_DOES_NOT_CONTAIN_ANY_OF("arrayDoesNotContainAnyOf"); - - private String value; - - UserComparator(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static UserComparator fromValue(String value) { - for (UserComparator b : UserComparator.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final UserComparator enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public UserComparator read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return UserComparator.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - UserComparator.fromValue(value); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UserConditionModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UserConditionModel.java deleted file mode 100644 index 0ec0140..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/UserConditionModel.java +++ /dev/null @@ -1,355 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.ComparisonValueModel; -import com.configcat.publicapi.java.client.model.UserComparator; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * Describes a condition that is based on user attributes. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class UserConditionModel { - public static final String SERIALIZED_NAME_COMPARISON_ATTRIBUTE = "comparisonAttribute"; - @SerializedName(SERIALIZED_NAME_COMPARISON_ATTRIBUTE) - private String comparisonAttribute; - - public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; - @SerializedName(SERIALIZED_NAME_COMPARATOR) - private UserComparator comparator; - - public static final String SERIALIZED_NAME_COMPARISON_VALUE = "comparisonValue"; - @SerializedName(SERIALIZED_NAME_COMPARISON_VALUE) - private ComparisonValueModel comparisonValue; - - public UserConditionModel() { - } - - public UserConditionModel comparisonAttribute(String comparisonAttribute) { - this.comparisonAttribute = comparisonAttribute; - return this; - } - - /** - * The User Object attribute that the condition is based on. Can be \"User ID\", \"Email\", \"Country\" or any custom attribute. - * @return comparisonAttribute - */ - @javax.annotation.Nonnull - public String getComparisonAttribute() { - return comparisonAttribute; - } - - public void setComparisonAttribute(String comparisonAttribute) { - this.comparisonAttribute = comparisonAttribute; - } - - - public UserConditionModel comparator(UserComparator comparator) { - this.comparator = comparator; - return this; - } - - /** - * Get comparator - * @return comparator - */ - @javax.annotation.Nonnull - public UserComparator getComparator() { - return comparator; - } - - public void setComparator(UserComparator comparator) { - this.comparator = comparator; - } - - - public UserConditionModel comparisonValue(ComparisonValueModel comparisonValue) { - this.comparisonValue = comparisonValue; - return this; - } - - /** - * Get comparisonValue - * @return comparisonValue - */ - @javax.annotation.Nonnull - public ComparisonValueModel getComparisonValue() { - return comparisonValue; - } - - public void setComparisonValue(ComparisonValueModel comparisonValue) { - this.comparisonValue = comparisonValue; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the UserConditionModel instance itself - */ - public UserConditionModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserConditionModel userConditionModel = (UserConditionModel) o; - return Objects.equals(this.comparisonAttribute, userConditionModel.comparisonAttribute) && - Objects.equals(this.comparator, userConditionModel.comparator) && - Objects.equals(this.comparisonValue, userConditionModel.comparisonValue)&& - Objects.equals(this.additionalProperties, userConditionModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(comparisonAttribute, comparator, comparisonValue, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserConditionModel {\n"); - sb.append(" comparisonAttribute: ").append(toIndentedString(comparisonAttribute)).append("\n"); - sb.append(" comparator: ").append(toIndentedString(comparator)).append("\n"); - sb.append(" comparisonValue: ").append(toIndentedString(comparisonValue)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("comparisonAttribute"); - openapiFields.add("comparator"); - openapiFields.add("comparisonValue"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("comparisonAttribute"); - openapiRequiredFields.add("comparator"); - openapiRequiredFields.add("comparisonValue"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserConditionModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserConditionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserConditionModel is not found in the empty JSON string", UserConditionModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserConditionModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("comparisonAttribute").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `comparisonAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonAttribute").toString())); - } - // validate the required field `comparator` - UserComparator.validateJsonElement(jsonObj.get("comparator")); - // validate the required field `comparisonValue` - ComparisonValueModel.validateJsonElement(jsonObj.get("comparisonValue")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserConditionModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserConditionModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserConditionModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserConditionModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UserConditionModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UserConditionModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserConditionModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserConditionModel - * @throws IOException if the JSON string is invalid with respect to UserConditionModel - */ - public static UserConditionModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserConditionModel.class); - } - - /** - * Convert an instance of UserConditionModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UserModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UserModel.java deleted file mode 100644 index 3e7f32d..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/UserModel.java +++ /dev/null @@ -1,383 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * UserModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class UserModel { - public static final String SERIALIZED_NAME_USER_ID = "userId"; - @SerializedName(SERIALIZED_NAME_USER_ID) - private String userId; - - public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; - @SerializedName(SERIALIZED_NAME_FULL_NAME) - private String fullName; - - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; - - public static final String SERIALIZED_NAME_TWO_FACTOR_ENABLED = "twoFactorEnabled"; - @SerializedName(SERIALIZED_NAME_TWO_FACTOR_ENABLED) - private Boolean twoFactorEnabled; - - public UserModel() { - } - - public UserModel userId(String userId) { - this.userId = userId; - return this; - } - - /** - * Identifier of the Member. - * @return userId - */ - @javax.annotation.Nullable - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId; - } - - - public UserModel fullName(String fullName) { - this.fullName = fullName; - return this; - } - - /** - * Name of the Member. - * @return fullName - */ - @javax.annotation.Nullable - public String getFullName() { - return fullName; - } - - public void setFullName(String fullName) { - this.fullName = fullName; - } - - - public UserModel email(String email) { - this.email = email; - return this; - } - - /** - * Email of the Member. - * @return email - */ - @javax.annotation.Nullable - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - - public UserModel twoFactorEnabled(Boolean twoFactorEnabled) { - this.twoFactorEnabled = twoFactorEnabled; - return this; - } - - /** - * Determines whether 2FA is enabled for the Member. - * @return twoFactorEnabled - */ - @javax.annotation.Nullable - public Boolean getTwoFactorEnabled() { - return twoFactorEnabled; - } - - public void setTwoFactorEnabled(Boolean twoFactorEnabled) { - this.twoFactorEnabled = twoFactorEnabled; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the UserModel instance itself - */ - public UserModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserModel userModel = (UserModel) o; - return Objects.equals(this.userId, userModel.userId) && - Objects.equals(this.fullName, userModel.fullName) && - Objects.equals(this.email, userModel.email) && - Objects.equals(this.twoFactorEnabled, userModel.twoFactorEnabled)&& - Objects.equals(this.additionalProperties, userModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(userId, fullName, email, twoFactorEnabled, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserModel {\n"); - sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); - sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" twoFactorEnabled: ").append(toIndentedString(twoFactorEnabled)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("userId"); - openapiFields.add("fullName"); - openapiFields.add("email"); - openapiFields.add("twoFactorEnabled"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserModel is not found in the empty JSON string", UserModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("userId") != null && !jsonObj.get("userId").isJsonNull()) && !jsonObj.get("userId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString())); - } - if ((jsonObj.get("fullName") != null && !jsonObj.get("fullName").isJsonNull()) && !jsonObj.get("fullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); - } - if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public UserModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UserModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserModel - * @throws IOException if the JSON string is invalid with respect to UserModel - */ - public static UserModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserModel.class); - } - - /** - * Convert an instance of UserModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ValueModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ValueModel.java deleted file mode 100644 index d56e917..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/ValueModel.java +++ /dev/null @@ -1,377 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * Represents the value of a Feature Flag or Setting. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class ValueModel { - public static final String SERIALIZED_NAME_BOOL_VALUE = "boolValue"; - @SerializedName(SERIALIZED_NAME_BOOL_VALUE) - private Boolean boolValue; - - public static final String SERIALIZED_NAME_STRING_VALUE = "stringValue"; - @SerializedName(SERIALIZED_NAME_STRING_VALUE) - private String stringValue; - - public static final String SERIALIZED_NAME_INT_VALUE = "intValue"; - @SerializedName(SERIALIZED_NAME_INT_VALUE) - private Integer intValue; - - public static final String SERIALIZED_NAME_DOUBLE_VALUE = "doubleValue"; - @SerializedName(SERIALIZED_NAME_DOUBLE_VALUE) - private Double doubleValue; - - public ValueModel() { - } - - public ValueModel boolValue(Boolean boolValue) { - this.boolValue = boolValue; - return this; - } - - /** - * The served value in case of a boolean Feature Flag. - * @return boolValue - */ - @javax.annotation.Nullable - public Boolean getBoolValue() { - return boolValue; - } - - public void setBoolValue(Boolean boolValue) { - this.boolValue = boolValue; - } - - - public ValueModel stringValue(String stringValue) { - this.stringValue = stringValue; - return this; - } - - /** - * The served value in case of a text Setting. - * @return stringValue - */ - @javax.annotation.Nullable - public String getStringValue() { - return stringValue; - } - - public void setStringValue(String stringValue) { - this.stringValue = stringValue; - } - - - public ValueModel intValue(Integer intValue) { - this.intValue = intValue; - return this; - } - - /** - * The served value in case of a whole number Setting. - * @return intValue - */ - @javax.annotation.Nullable - public Integer getIntValue() { - return intValue; - } - - public void setIntValue(Integer intValue) { - this.intValue = intValue; - } - - - public ValueModel doubleValue(Double doubleValue) { - this.doubleValue = doubleValue; - return this; - } - - /** - * The served value in case of a decimal number Setting. - * @return doubleValue - */ - @javax.annotation.Nullable - public Double getDoubleValue() { - return doubleValue; - } - - public void setDoubleValue(Double doubleValue) { - this.doubleValue = doubleValue; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the ValueModel instance itself - */ - public ValueModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ValueModel valueModel = (ValueModel) o; - return Objects.equals(this.boolValue, valueModel.boolValue) && - Objects.equals(this.stringValue, valueModel.stringValue) && - Objects.equals(this.intValue, valueModel.intValue) && - Objects.equals(this.doubleValue, valueModel.doubleValue)&& - Objects.equals(this.additionalProperties, valueModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(boolValue, stringValue, intValue, doubleValue, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ValueModel {\n"); - sb.append(" boolValue: ").append(toIndentedString(boolValue)).append("\n"); - sb.append(" stringValue: ").append(toIndentedString(stringValue)).append("\n"); - sb.append(" intValue: ").append(toIndentedString(intValue)).append("\n"); - sb.append(" doubleValue: ").append(toIndentedString(doubleValue)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("boolValue"); - openapiFields.add("stringValue"); - openapiFields.add("intValue"); - openapiFields.add("doubleValue"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ValueModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ValueModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ValueModel is not found in the empty JSON string", ValueModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("stringValue") != null && !jsonObj.get("stringValue").isJsonNull()) && !jsonObj.get("stringValue").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `stringValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stringValue").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ValueModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ValueModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ValueModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ValueModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public ValueModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ValueModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ValueModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of ValueModel - * @throws IOException if the JSON string is invalid with respect to ValueModel - */ - public static ValueModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ValueModel.class); - } - - /** - * Convert an instance of ValueModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/WebHookHttpMethod.java b/src/main/java/com/configcat/publicapi/java/client/model/WebHookHttpMethod.java deleted file mode 100644 index 01b30f7..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/WebHookHttpMethod.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets WebHookHttpMethod - */ -@JsonAdapter(WebHookHttpMethod.Adapter.class) -public enum WebHookHttpMethod { - - GET("get"), - - POST("post"); - - private String value; - - WebHookHttpMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static WebHookHttpMethod fromValue(String value) { - for (WebHookHttpMethod b : WebHookHttpMethod.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final WebHookHttpMethod enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public WebHookHttpMethod read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return WebHookHttpMethod.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - WebHookHttpMethod.fromValue(value); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/WebHookRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/WebHookRequest.java deleted file mode 100644 index e5686e0..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/WebHookRequest.java +++ /dev/null @@ -1,418 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.WebHookHttpMethod; -import com.configcat.publicapi.java.client.model.WebhookHeaderModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * WebHookRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class WebHookRequest { - public static final String SERIALIZED_NAME_URL = "url"; - @SerializedName(SERIALIZED_NAME_URL) - private String url; - - public static final String SERIALIZED_NAME_CONTENT = "content"; - @SerializedName(SERIALIZED_NAME_CONTENT) - private String content; - - public static final String SERIALIZED_NAME_HTTP_METHOD = "httpMethod"; - @SerializedName(SERIALIZED_NAME_HTTP_METHOD) - private WebHookHttpMethod httpMethod; - - public static final String SERIALIZED_NAME_WEB_HOOK_HEADERS = "webHookHeaders"; - @SerializedName(SERIALIZED_NAME_WEB_HOOK_HEADERS) - private List webHookHeaders; - - public WebHookRequest() { - } - - public WebHookRequest url(String url) { - this.url = url; - return this; - } - - /** - * The URL of the Webhook. - * @return url - */ - @javax.annotation.Nonnull - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - - public WebHookRequest content(String content) { - this.content = content; - return this; - } - - /** - * The HTTP body content. - * @return content - */ - @javax.annotation.Nullable - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - - public WebHookRequest httpMethod(WebHookHttpMethod httpMethod) { - this.httpMethod = httpMethod; - return this; - } - - /** - * Get httpMethod - * @return httpMethod - */ - @javax.annotation.Nullable - public WebHookHttpMethod getHttpMethod() { - return httpMethod; - } - - public void setHttpMethod(WebHookHttpMethod httpMethod) { - this.httpMethod = httpMethod; - } - - - public WebHookRequest webHookHeaders(List webHookHeaders) { - this.webHookHeaders = webHookHeaders; - return this; - } - - public WebHookRequest addWebHookHeadersItem(WebhookHeaderModel webHookHeadersItem) { - if (this.webHookHeaders == null) { - this.webHookHeaders = new ArrayList<>(); - } - this.webHookHeaders.add(webHookHeadersItem); - return this; - } - - /** - * List of HTTP headers. - * @return webHookHeaders - */ - @javax.annotation.Nullable - public List getWebHookHeaders() { - return webHookHeaders; - } - - public void setWebHookHeaders(List webHookHeaders) { - this.webHookHeaders = webHookHeaders; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the WebHookRequest instance itself - */ - public WebHookRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebHookRequest webHookRequest = (WebHookRequest) o; - return Objects.equals(this.url, webHookRequest.url) && - Objects.equals(this.content, webHookRequest.content) && - Objects.equals(this.httpMethod, webHookRequest.httpMethod) && - Objects.equals(this.webHookHeaders, webHookRequest.webHookHeaders)&& - Objects.equals(this.additionalProperties, webHookRequest.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(url, content, httpMethod, webHookHeaders, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebHookRequest {\n"); - sb.append(" url: ").append(toIndentedString(url)).append("\n"); - sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" httpMethod: ").append(toIndentedString(httpMethod)).append("\n"); - sb.append(" webHookHeaders: ").append(toIndentedString(webHookHeaders)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("url"); - openapiFields.add("content"); - openapiFields.add("httpMethod"); - openapiFields.add("webHookHeaders"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("url"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebHookRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebHookRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebHookRequest is not found in the empty JSON string", WebHookRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebHookRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); - } - if ((jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) && !jsonObj.get("content").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `content` to be a primitive type in the JSON string but got `%s`", jsonObj.get("content").toString())); - } - // validate the optional field `httpMethod` - if (jsonObj.get("httpMethod") != null && !jsonObj.get("httpMethod").isJsonNull()) { - WebHookHttpMethod.validateJsonElement(jsonObj.get("httpMethod")); - } - if (jsonObj.get("webHookHeaders") != null && !jsonObj.get("webHookHeaders").isJsonNull()) { - JsonArray jsonArraywebHookHeaders = jsonObj.getAsJsonArray("webHookHeaders"); - if (jsonArraywebHookHeaders != null) { - // ensure the json data is an array - if (!jsonObj.get("webHookHeaders").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `webHookHeaders` to be an array in the JSON string but got `%s`", jsonObj.get("webHookHeaders").toString())); - } - - // validate the optional field `webHookHeaders` (array) - for (int i = 0; i < jsonArraywebHookHeaders.size(); i++) { - WebhookHeaderModel.validateJsonElement(jsonArraywebHookHeaders.get(i)); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebHookRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebHookRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebHookRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebHookRequest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public WebHookRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - WebHookRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebHookRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebHookRequest - * @throws IOException if the JSON string is invalid with respect to WebHookRequest - */ - public static WebHookRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebHookRequest.class); - } - - /** - * Convert an instance of WebHookRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/WebhookConfig.java b/src/main/java/com/configcat/publicapi/java/client/model/WebhookConfig.java deleted file mode 100644 index ee3eb06..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/WebhookConfig.java +++ /dev/null @@ -1,329 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * The Config where the applied changes will invoke the Webhook. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class WebhookConfig { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_CONFIG_ID = "configId"; - @SerializedName(SERIALIZED_NAME_CONFIG_ID) - private UUID configId; - - public WebhookConfig() { - } - - public WebhookConfig name(String name) { - this.name = name; - return this; - } - - /** - * The Config's name. - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public WebhookConfig configId(UUID configId) { - this.configId = configId; - return this; - } - - /** - * The Config's identifier. - * @return configId - */ - @javax.annotation.Nullable - public UUID getConfigId() { - return configId; - } - - public void setConfigId(UUID configId) { - this.configId = configId; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the WebhookConfig instance itself - */ - public WebhookConfig putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebhookConfig webhookConfig = (WebhookConfig) o; - return Objects.equals(this.name, webhookConfig.name) && - Objects.equals(this.configId, webhookConfig.configId)&& - Objects.equals(this.additionalProperties, webhookConfig.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(name, configId, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebhookConfig {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" configId: ").append(toIndentedString(configId)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("configId"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebhookConfig - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebhookConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookConfig is not found in the empty JSON string", WebhookConfig.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("configId") != null && !jsonObj.get("configId").isJsonNull()) && !jsonObj.get("configId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `configId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("configId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebhookConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebhookConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebhookConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebhookConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public WebhookConfig read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - WebhookConfig instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebhookConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebhookConfig - * @throws IOException if the JSON string is invalid with respect to WebhookConfig - */ - public static WebhookConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebhookConfig.class); - } - - /** - * Convert an instance of WebhookConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/WebhookEnvironment.java b/src/main/java/com/configcat/publicapi/java/client/model/WebhookEnvironment.java deleted file mode 100644 index 5cc1abc..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/WebhookEnvironment.java +++ /dev/null @@ -1,329 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * The Environment where the applied changes will invoke the Webhook. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class WebhookEnvironment { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_ENVIRONMENT_ID = "environmentId"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) - private UUID environmentId; - - public WebhookEnvironment() { - } - - public WebhookEnvironment name(String name) { - this.name = name; - return this; - } - - /** - * The Environment's name. - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public WebhookEnvironment environmentId(UUID environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * The Environment's identifier. - * @return environmentId - */ - @javax.annotation.Nullable - public UUID getEnvironmentId() { - return environmentId; - } - - public void setEnvironmentId(UUID environmentId) { - this.environmentId = environmentId; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the WebhookEnvironment instance itself - */ - public WebhookEnvironment putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebhookEnvironment webhookEnvironment = (WebhookEnvironment) o; - return Objects.equals(this.name, webhookEnvironment.name) && - Objects.equals(this.environmentId, webhookEnvironment.environmentId)&& - Objects.equals(this.additionalProperties, webhookEnvironment.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(name, environmentId, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebhookEnvironment {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" environmentId: ").append(toIndentedString(environmentId)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("environmentId"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebhookEnvironment - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebhookEnvironment.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookEnvironment is not found in the empty JSON string", WebhookEnvironment.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("environmentId") != null && !jsonObj.get("environmentId").isJsonNull()) && !jsonObj.get("environmentId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `environmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebhookEnvironment.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebhookEnvironment' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebhookEnvironment.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebhookEnvironment value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public WebhookEnvironment read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - WebhookEnvironment instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebhookEnvironment given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebhookEnvironment - * @throws IOException if the JSON string is invalid with respect to WebhookEnvironment - */ - public static WebhookEnvironment fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebhookEnvironment.class); - } - - /** - * Convert an instance of WebhookEnvironment to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/WebhookHeaderModel.java b/src/main/java/com/configcat/publicapi/java/client/model/WebhookHeaderModel.java deleted file mode 100644 index 37236cb..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/WebhookHeaderModel.java +++ /dev/null @@ -1,351 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * WebhookHeaderModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class WebhookHeaderModel { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private String value; - - public static final String SERIALIZED_NAME_IS_SECURE = "isSecure"; - @SerializedName(SERIALIZED_NAME_IS_SECURE) - private Boolean isSecure; - - public WebhookHeaderModel() { - } - - public WebhookHeaderModel key(String key) { - this.key = key; - return this; - } - - /** - * The HTTP header key. - * @return key - */ - @javax.annotation.Nonnull - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - - public WebhookHeaderModel value(String value) { - this.value = value; - return this; - } - - /** - * The HTTP header value. - * @return value - */ - @javax.annotation.Nonnull - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - - public WebhookHeaderModel isSecure(Boolean isSecure) { - this.isSecure = isSecure; - return this; - } - - /** - * Indicates whether the header value is sensitive. - * @return isSecure - */ - @javax.annotation.Nullable - public Boolean getIsSecure() { - return isSecure; - } - - public void setIsSecure(Boolean isSecure) { - this.isSecure = isSecure; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the WebhookHeaderModel instance itself - */ - public WebhookHeaderModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebhookHeaderModel webhookHeaderModel = (WebhookHeaderModel) o; - return Objects.equals(this.key, webhookHeaderModel.key) && - Objects.equals(this.value, webhookHeaderModel.value) && - Objects.equals(this.isSecure, webhookHeaderModel.isSecure)&& - Objects.equals(this.additionalProperties, webhookHeaderModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(key, value, isSecure, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebhookHeaderModel {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" isSecure: ").append(toIndentedString(isSecure)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("value"); - openapiFields.add("isSecure"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - openapiRequiredFields.add("value"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebhookHeaderModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebhookHeaderModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookHeaderModel is not found in the empty JSON string", WebhookHeaderModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebhookHeaderModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if (!jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebhookHeaderModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebhookHeaderModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebhookHeaderModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebhookHeaderModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public WebhookHeaderModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - WebhookHeaderModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebhookHeaderModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebhookHeaderModel - * @throws IOException if the JSON string is invalid with respect to WebhookHeaderModel - */ - public static WebhookHeaderModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebhookHeaderModel.class); - } - - /** - * Convert an instance of WebhookHeaderModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/WebhookModel.java b/src/main/java/com/configcat/publicapi/java/client/model/WebhookModel.java deleted file mode 100644 index 148c655..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/WebhookModel.java +++ /dev/null @@ -1,498 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.configcat.publicapi.java.client.model.WebHookHttpMethod; -import com.configcat.publicapi.java.client.model.WebhookConfig; -import com.configcat.publicapi.java.client.model.WebhookEnvironment; -import com.configcat.publicapi.java.client.model.WebhookHeaderModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * WebhookModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class WebhookModel { - public static final String SERIALIZED_NAME_WEBHOOK_ID = "webhookId"; - @SerializedName(SERIALIZED_NAME_WEBHOOK_ID) - private Integer webhookId; - - public static final String SERIALIZED_NAME_URL = "url"; - @SerializedName(SERIALIZED_NAME_URL) - private String url; - - public static final String SERIALIZED_NAME_HTTP_METHOD = "httpMethod"; - @SerializedName(SERIALIZED_NAME_HTTP_METHOD) - private WebHookHttpMethod httpMethod; - - public static final String SERIALIZED_NAME_CONTENT = "content"; - @SerializedName(SERIALIZED_NAME_CONTENT) - private String content; - - public static final String SERIALIZED_NAME_WEB_HOOK_HEADERS = "webHookHeaders"; - @SerializedName(SERIALIZED_NAME_WEB_HOOK_HEADERS) - private List webHookHeaders; - - public static final String SERIALIZED_NAME_CONFIG = "config"; - @SerializedName(SERIALIZED_NAME_CONFIG) - private WebhookConfig config; - - public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT) - private WebhookEnvironment environment; - - public WebhookModel() { - } - - public WebhookModel webhookId(Integer webhookId) { - this.webhookId = webhookId; - return this; - } - - /** - * The identifier of the Webhook. - * @return webhookId - */ - @javax.annotation.Nullable - public Integer getWebhookId() { - return webhookId; - } - - public void setWebhookId(Integer webhookId) { - this.webhookId = webhookId; - } - - - public WebhookModel url(String url) { - this.url = url; - return this; - } - - /** - * The URL of the Webhook. - * @return url - */ - @javax.annotation.Nullable - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - - public WebhookModel httpMethod(WebHookHttpMethod httpMethod) { - this.httpMethod = httpMethod; - return this; - } - - /** - * Get httpMethod - * @return httpMethod - */ - @javax.annotation.Nullable - public WebHookHttpMethod getHttpMethod() { - return httpMethod; - } - - public void setHttpMethod(WebHookHttpMethod httpMethod) { - this.httpMethod = httpMethod; - } - - - public WebhookModel content(String content) { - this.content = content; - return this; - } - - /** - * The HTTP body content. - * @return content - */ - @javax.annotation.Nullable - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - - public WebhookModel webHookHeaders(List webHookHeaders) { - this.webHookHeaders = webHookHeaders; - return this; - } - - public WebhookModel addWebHookHeadersItem(WebhookHeaderModel webHookHeadersItem) { - if (this.webHookHeaders == null) { - this.webHookHeaders = new ArrayList<>(); - } - this.webHookHeaders.add(webHookHeadersItem); - return this; - } - - /** - * List of HTTP headers that the Webhook must send. - * @return webHookHeaders - */ - @javax.annotation.Nullable - public List getWebHookHeaders() { - return webHookHeaders; - } - - public void setWebHookHeaders(List webHookHeaders) { - this.webHookHeaders = webHookHeaders; - } - - - public WebhookModel config(WebhookConfig config) { - this.config = config; - return this; - } - - /** - * Get config - * @return config - */ - @javax.annotation.Nullable - public WebhookConfig getConfig() { - return config; - } - - public void setConfig(WebhookConfig config) { - this.config = config; - } - - - public WebhookModel environment(WebhookEnvironment environment) { - this.environment = environment; - return this; - } - - /** - * Get environment - * @return environment - */ - @javax.annotation.Nullable - public WebhookEnvironment getEnvironment() { - return environment; - } - - public void setEnvironment(WebhookEnvironment environment) { - this.environment = environment; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the WebhookModel instance itself - */ - public WebhookModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebhookModel webhookModel = (WebhookModel) o; - return Objects.equals(this.webhookId, webhookModel.webhookId) && - Objects.equals(this.url, webhookModel.url) && - Objects.equals(this.httpMethod, webhookModel.httpMethod) && - Objects.equals(this.content, webhookModel.content) && - Objects.equals(this.webHookHeaders, webhookModel.webHookHeaders) && - Objects.equals(this.config, webhookModel.config) && - Objects.equals(this.environment, webhookModel.environment)&& - Objects.equals(this.additionalProperties, webhookModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(webhookId, url, httpMethod, content, webHookHeaders, config, environment, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebhookModel {\n"); - sb.append(" webhookId: ").append(toIndentedString(webhookId)).append("\n"); - sb.append(" url: ").append(toIndentedString(url)).append("\n"); - sb.append(" httpMethod: ").append(toIndentedString(httpMethod)).append("\n"); - sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" webHookHeaders: ").append(toIndentedString(webHookHeaders)).append("\n"); - sb.append(" config: ").append(toIndentedString(config)).append("\n"); - sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("webhookId"); - openapiFields.add("url"); - openapiFields.add("httpMethod"); - openapiFields.add("content"); - openapiFields.add("webHookHeaders"); - openapiFields.add("config"); - openapiFields.add("environment"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebhookModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebhookModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookModel is not found in the empty JSON string", WebhookModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("url") != null && !jsonObj.get("url").isJsonNull()) && !jsonObj.get("url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); - } - // validate the optional field `httpMethod` - if (jsonObj.get("httpMethod") != null && !jsonObj.get("httpMethod").isJsonNull()) { - WebHookHttpMethod.validateJsonElement(jsonObj.get("httpMethod")); - } - if ((jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) && !jsonObj.get("content").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `content` to be a primitive type in the JSON string but got `%s`", jsonObj.get("content").toString())); - } - if (jsonObj.get("webHookHeaders") != null && !jsonObj.get("webHookHeaders").isJsonNull()) { - JsonArray jsonArraywebHookHeaders = jsonObj.getAsJsonArray("webHookHeaders"); - if (jsonArraywebHookHeaders != null) { - // ensure the json data is an array - if (!jsonObj.get("webHookHeaders").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `webHookHeaders` to be an array in the JSON string but got `%s`", jsonObj.get("webHookHeaders").toString())); - } - - // validate the optional field `webHookHeaders` (array) - for (int i = 0; i < jsonArraywebHookHeaders.size(); i++) { - WebhookHeaderModel.validateJsonElement(jsonArraywebHookHeaders.get(i)); - }; - } - } - // validate the optional field `config` - if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { - WebhookConfig.validateJsonElement(jsonObj.get("config")); - } - // validate the optional field `environment` - if (jsonObj.get("environment") != null && !jsonObj.get("environment").isJsonNull()) { - WebhookEnvironment.validateJsonElement(jsonObj.get("environment")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebhookModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebhookModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebhookModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebhookModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public WebhookModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - WebhookModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebhookModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebhookModel - * @throws IOException if the JSON string is invalid with respect to WebhookModel - */ - public static WebhookModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebhookModel.class); - } - - /** - * Convert an instance of WebhookModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/configcat/publicapi/java/client/model/WebhookSigningKeysModel.java b/src/main/java/com/configcat/publicapi/java/client/model/WebhookSigningKeysModel.java deleted file mode 100644 index 191d09c..0000000 --- a/src/main/java/com/configcat/publicapi/java/client/model/WebhookSigningKeysModel.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.configcat.publicapi.java.client.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.configcat.publicapi.java.client.JSON; - -/** - * WebhookSigningKeysModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-20T16:55:24.304297906Z[Etc/UTC]", comments = "Generator version: 7.7.0") -public class WebhookSigningKeysModel { - public static final String SERIALIZED_NAME_KEY1 = "key1"; - @SerializedName(SERIALIZED_NAME_KEY1) - private String key1; - - public static final String SERIALIZED_NAME_KEY2 = "key2"; - @SerializedName(SERIALIZED_NAME_KEY2) - private String key2; - - public WebhookSigningKeysModel() { - } - - public WebhookSigningKeysModel key1(String key1) { - this.key1 = key1; - return this; - } - - /** - * The first signing key. - * @return key1 - */ - @javax.annotation.Nullable - public String getKey1() { - return key1; - } - - public void setKey1(String key1) { - this.key1 = key1; - } - - - public WebhookSigningKeysModel key2(String key2) { - this.key2 = key2; - return this; - } - - /** - * The second signing key. - * @return key2 - */ - @javax.annotation.Nullable - public String getKey2() { - return key2; - } - - public void setKey2(String key2) { - this.key2 = key2; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the WebhookSigningKeysModel instance itself - */ - public WebhookSigningKeysModel putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebhookSigningKeysModel webhookSigningKeysModel = (WebhookSigningKeysModel) o; - return Objects.equals(this.key1, webhookSigningKeysModel.key1) && - Objects.equals(this.key2, webhookSigningKeysModel.key2)&& - Objects.equals(this.additionalProperties, webhookSigningKeysModel.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(key1, key2, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebhookSigningKeysModel {\n"); - sb.append(" key1: ").append(toIndentedString(key1)).append("\n"); - sb.append(" key2: ").append(toIndentedString(key2)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key1"); - openapiFields.add("key2"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebhookSigningKeysModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebhookSigningKeysModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookSigningKeysModel is not found in the empty JSON string", WebhookSigningKeysModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("key1") != null && !jsonObj.get("key1").isJsonNull()) && !jsonObj.get("key1").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key1").toString())); - } - if ((jsonObj.get("key2") != null && !jsonObj.get("key2").isJsonNull()) && !jsonObj.get("key2").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key2").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebhookSigningKeysModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebhookSigningKeysModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebhookSigningKeysModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebhookSigningKeysModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public WebhookSigningKeysModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - WebhookSigningKeysModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebhookSigningKeysModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebhookSigningKeysModel - * @throws IOException if the JSON string is invalid with respect to WebhookSigningKeysModel - */ - public static WebhookSigningKeysModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebhookSigningKeysModel.class); - } - - /** - * Convert an instance of WebhookSigningKeysModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - From 76921e8e72962d4b07ab80043491ef2c0fea590b Mon Sep 17 00:00:00 2001 From: novalisdenahi Date: Tue, 10 Jun 2025 23:29:11 +0200 Subject: [PATCH 2/2] Regenerate --- api/openapi.yaml | 11566 ++++++++++++++++ docs/AccessType.md | 15 + docs/AddOrUpdateIntegrationLinkModel.md | 14 + docs/AddOrUpdateJiraIntegrationLinkModel.md | 16 + docs/AuditLogItemModel.md | 24 + docs/AuditLogType.md | 193 + docs/AuditLogsApi.md | 246 + docs/CodeReferenceModel.md | 20 + docs/CodeReferenceRequest.md | 20 + docs/CodeReferencesApi.md | 222 + docs/ComparisonValueListModel.md | 14 + docs/ComparisonValueModel.md | 16 + docs/ConditionModel.md | 15 + docs/ConfigModel.md | 20 + docs/ConfigSettingFormulaModel.md | 23 + docs/ConfigSettingFormulasModel.md | 17 + docs/ConfigSettingValueModel.md | 21 + docs/ConfigSettingValuesModel.md | 17 + docs/ConfigsApi.md | 371 + docs/ConnectRequest.md | 14 + docs/CreateConfigRequest.md | 16 + docs/CreateEnvironmentModel.md | 16 + docs/CreateIntegrationModel.md | 17 + docs/CreateOrUpdateEnvironmentAccessModel.md | 14 + docs/CreatePermissionGroupRequest.md | 37 + docs/CreateProductRequest.md | 15 + docs/CreateSegmentModel.md | 17 + docs/CreateSettingInitialValues.md | 20 + docs/CreateTagModel.md | 14 + docs/DeleteIntegrationLinkModel.md | 13 + docs/DeleteRepositoryReportsRequest.md | 16 + docs/DeletedSettingModel.md | 16 + docs/EnvironmentAccessModel.md | 19 + docs/EnvironmentAccessType.md | 15 + docs/EnvironmentModel.md | 20 + docs/EnvironmentsApi.md | 373 + docs/EvaluationVersion.md | 13 + docs/FeatureFlagLimitations.md | 20 + docs/FeatureFlagSettingValuesApi.md | 391 + .../FeatureFlagSettingValuesUsingSdkKeyApi.md | 239 + ...eatureFlagSettingValuesUsingSdkKeyV2Api.md | 239 + docs/FeatureFlagSettingValuesV2Api.md | 391 + docs/FeatureFlagsSettingsApi.md | 445 + docs/FlagReference.md | 14 + docs/InitialValue.md | 14 + docs/IntegrationLinkDetail.md | 18 + docs/IntegrationLinkDetailsModel.md | 14 + docs/IntegrationLinkModel.md | 16 + docs/IntegrationLinkType.md | 15 + docs/IntegrationLinksApi.md | 383 + docs/IntegrationModel.md | 20 + docs/IntegrationType.md | 21 + docs/IntegrationsApi.md | 371 + docs/IntegrationsModel.md | 13 + docs/InvitationModel.md | 17 + docs/InviteMembersRequest.md | 14 + docs/JsonPatchOperation.md | 16 + docs/KeyGenerationMode.md | 19 + docs/MeApi.md | 74 + docs/MeModel.md | 14 + docs/MemberModel.md | 17 + docs/MembersApi.md | 733 + docs/ModifyIntegrationRequest.md | 16 + docs/OperationType.md | 23 + docs/OrganizationAdminModel.md | 17 + docs/OrganizationInvitationModel.md | 20 + docs/OrganizationMemberModel.md | 18 + docs/OrganizationMembersModel.md | 15 + docs/OrganizationModel.md | 15 + docs/OrganizationPermissionGroupModel.md | 15 + docs/OrganizationPermissionModel.md | 15 + docs/OrganizationProductModel.md | 15 + docs/OrganizationsApi.md | 74 + docs/PercentageOptionModel.md | 14 + docs/PermissionGroupModel.md | 39 + docs/PermissionGroupsApi.md | 371 + docs/PreferencesModel.md | 17 + docs/PrerequisiteComparator.md | 13 + docs/PrerequisiteFlagConditionModel.md | 16 + docs/ProductModel.md | 19 + docs/ProductsApi.md | 511 + docs/ReasonRequiredEnvironmentModel.md | 15 + docs/ReferenceLineModel.md | 15 + docs/ReferenceLineRequest.md | 15 + docs/ReferenceLinesModel.md | 17 + docs/ReferenceLinesRequest.md | 17 + docs/ReplaceSettingModel.md | 16 + docs/RolloutPercentageItemModel.md | 14 + docs/RolloutRuleComparator.md | 45 + docs/RolloutRuleModel.md | 18 + docs/SdkKeysApi.md | 82 + docs/SdkKeysModel.md | 14 + docs/SegmentComparator.md | 13 + docs/SegmentConditionModel.md | 15 + docs/SegmentListModel.md | 23 + docs/SegmentModel.md | 25 + docs/SegmentsApi.md | 371 + docs/SettingDataModel.md | 23 + docs/SettingFormulaModel.md | 27 + docs/SettingModel.md | 23 + docs/SettingTagModel.md | 16 + docs/SettingType.md | 17 + docs/SettingValueModel.md | 25 + docs/SettingValueType.md | 12 + docs/StaleFlagConfigModel.md | 17 + docs/StaleFlagEnvironmentModel.md | 14 + docs/StaleFlagProductModel.md | 16 + docs/StaleFlagReminderScope.md | 13 + docs/StaleFlagSettingModel.md | 19 + docs/StaleFlagSettingTagModel.md | 14 + docs/StaleFlagSettingValueModel.md | 15 + docs/StaleFlagStaleInEnvironmentsType.md | 13 + docs/TagModel.md | 16 + docs/TagsApi.md | 441 + docs/TargetingRuleModel.md | 15 + docs/UpdateComparisonValueListModel.md | 14 + docs/UpdateComparisonValueModel.md | 16 + docs/UpdateConditionModel.md | 15 + docs/UpdateConfigRequest.md | 15 + docs/UpdateEnvironmentModel.md | 16 + docs/UpdateEvaluationFormulaModel.md | 15 + docs/UpdateEvaluationFormulaWithIdModel.md | 16 + docs/UpdateEvaluationFormulasModel.md | 13 + docs/UpdateMemberPermissionsRequest.md | 16 + docs/UpdatePercentageOptionModel.md | 14 + docs/UpdatePermissionGroupRequest.md | 37 + docs/UpdatePreferencesRequest.md | 17 + docs/UpdatePrerequisiteFlagConditionModel.md | 16 + docs/UpdateProductRequest.md | 15 + docs/UpdateReasonRequiredEnvironmentModel.md | 14 + docs/UpdateRolloutPercentageItemModel.md | 14 + docs/UpdateRolloutRuleModel.md | 18 + docs/UpdateSegmentConditionModel.md | 15 + docs/UpdateSegmentModel.md | 17 + docs/UpdateSettingValueModel.md | 15 + docs/UpdateSettingValueWithSettingIdModel.md | 16 + docs/UpdateSettingValuesWithIdModel.md | 13 + docs/UpdateTagModel.md | 14 + docs/UpdateTargetingRuleModel.md | 15 + docs/UpdateUserConditionModel.md | 16 + docs/UpdateValueModel.md | 17 + docs/UserComparator.md | 81 + docs/UserConditionModel.md | 16 + docs/UserModel.md | 16 + docs/ValueModel.md | 17 + docs/WebHookHttpMethod.md | 13 + docs/WebHookRequestModel.md | 16 + docs/WebhookConfig.md | 15 + docs/WebhookEnvironment.md | 15 + docs/WebhookHeaderModel.md | 15 + docs/WebhookHeaderResponseModel.md | 15 + docs/WebhookResponseModel.md | 19 + docs/WebhookSigningKeysModel.md | 14 + docs/WebhooksApi.md | 517 + docs/ZombieStaleFlagsApi.md | 90 + src/main/AndroidManifest.xml | 3 + .../publicapi/java/client/ApiCallback.java | 62 + .../publicapi/java/client/ApiClient.java | 1566 +++ .../publicapi/java/client/ApiException.java | 167 + .../publicapi/java/client/ApiResponse.java | 76 + .../publicapi/java/client/Configuration.java | 41 + .../java/client/GzipRequestInterceptor.java | 85 + .../configcat/publicapi/java/client/JSON.java | 517 + .../configcat/publicapi/java/client/Pair.java | 57 + .../java/client/ProgressRequestBody.java | 73 + .../java/client/ProgressResponseBody.java | 70 + .../java/client/ServerConfiguration.java | 59 + .../publicapi/java/client/ServerVariable.java | 24 + .../publicapi/java/client/StringUtil.java | 83 + .../java/client/api/AuditLogsApi.java | 572 + .../java/client/api/CodeReferencesApi.java | 476 + .../publicapi/java/client/api/ConfigsApi.java | 772 ++ .../java/client/api/EnvironmentsApi.java | 780 ++ .../api/FeatureFlagSettingValuesApi.java | 869 ++ ...eatureFlagSettingValuesUsingSdkKeyApi.java | 550 + ...tureFlagSettingValuesUsingSdkKeyV2Api.java | 550 + .../api/FeatureFlagSettingValuesV2Api.java | 869 ++ .../client/api/FeatureFlagsSettingsApi.java | 920 ++ .../java/client/api/IntegrationLinksApi.java | 845 ++ .../java/client/api/IntegrationsApi.java | 773 ++ .../publicapi/java/client/api/MeApi.java | 192 + .../publicapi/java/client/api/MembersApi.java | 1470 ++ .../java/client/api/OrganizationsApi.java | 192 + .../java/client/api/PermissionGroupsApi.java | 772 ++ .../java/client/api/ProductsApi.java | 1038 ++ .../publicapi/java/client/api/SdkKeysApi.java | 221 + .../java/client/api/SegmentsApi.java | 773 ++ .../publicapi/java/client/api/TagsApi.java | 900 ++ .../java/client/api/WebhooksApi.java | 1057 ++ .../java/client/api/ZombieStaleFlagsApi.java | 253 + .../java/client/auth/ApiKeyAuth.java | 80 + .../java/client/auth/Authentication.java | 36 + .../java/client/auth/HttpBasicAuth.java | 55 + .../java/client/auth/HttpBearerAuth.java | 75 + .../client/model/AbstractOpenApiSchema.java | 146 + .../java/client/model/AccessType.java | 80 + .../AddOrUpdateIntegrationLinkModel.java | 328 + .../AddOrUpdateJiraIntegrationLinkModel.java | 395 + .../java/client/model/AuditLogItemModel.java | 618 + .../java/client/model/AuditLogType.java | 258 + .../java/client/model/CodeReferenceModel.java | 522 + .../client/model/CodeReferenceRequest.java | 544 + .../model/ComparisonValueListModel.java | 336 + .../client/model/ComparisonValueModel.java | 376 + .../java/client/model/ConditionModel.java | 355 + .../java/client/model/ConfigModel.java | 473 + .../model/ConfigSettingFormulaModel.java | 655 + .../model/ConfigSettingFormulasModel.java | 430 + .../client/model/ConfigSettingValueModel.java | 599 + .../model/ConfigSettingValuesModel.java | 430 + .../java/client/model/ConnectRequest.java | 325 + .../client/model/CreateConfigRequest.java | 393 + .../client/model/CreateEnvironmentModel.java | 391 + .../client/model/CreateIntegrationModel.java | 447 + .../CreateOrUpdateEnvironmentAccessModel.java | 319 + .../model/CreatePermissionGroupRequest.java | 966 ++ .../client/model/CreateProductRequest.java | 362 + .../java/client/model/CreateSegmentModel.java | 426 + .../model/CreateSettingInitialValues.java | 537 + .../java/client/model/CreateTagModel.java | 336 + .../model/DeleteIntegrationLinkModel.java | 292 + .../model/DeleteRepositoryReportsRequest.java | 393 + .../client/model/DeletedSettingModel.java | 372 + .../client/model/EnvironmentAccessModel.java | 470 + .../client/model/EnvironmentAccessType.java | 80 + .../java/client/model/EnvironmentModel.java | 470 + .../java/client/model/EvaluationVersion.java | 78 + .../client/model/FeatureFlagLimitations.java | 454 + .../java/client/model/FlagReference.java | 340 + .../java/client/model/InitialValue.java | 325 + .../client/model/IntegrationLinkDetail.java | 442 + .../model/IntegrationLinkDetailsModel.java | 331 + .../client/model/IntegrationLinkModel.java | 385 + .../client/model/IntegrationLinkType.java | 80 + .../java/client/model/IntegrationModel.java | 507 + .../java/client/model/IntegrationType.java | 86 + .../java/client/model/IntegrationsModel.java | 313 + .../java/client/model/InvitationModel.java | 408 + .../client/model/InviteMembersRequest.java | 335 + .../java/client/model/JsonPatchOperation.java | 392 + .../java/client/model/KeyGenerationMode.java | 84 + .../publicapi/java/client/model/MeModel.java | 318 + .../java/client/model/MemberModel.java | 413 + .../model/ModifyIntegrationRequest.java | 417 + .../java/client/model/OperationType.java | 88 + .../client/model/OrganizationAdminModel.java | 382 + .../model/OrganizationInvitationModel.java | 495 + .../client/model/OrganizationMemberModel.java | 430 + .../model/OrganizationMembersModel.java | 404 + .../java/client/model/OrganizationModel.java | 326 + .../OrganizationPermissionGroupModel.java | 322 + .../model/OrganizationPermissionModel.java | 325 + .../model/OrganizationProductModel.java | 326 + .../client/model/PercentageOptionModel.java | 322 + .../client/model/PermissionGroupModel.java | 1027 ++ .../java/client/model/PreferencesModel.java | 424 + .../client/model/PrerequisiteComparator.java | 78 + .../model/PrerequisiteFlagConditionModel.java | 352 + .../java/client/model/ProductModel.java | 440 + .../model/ReasonRequiredEnvironmentModel.java | 353 + .../java/client/model/ReferenceLineModel.java | 322 + .../client/model/ReferenceLineRequest.java | 333 + .../client/model/ReferenceLinesModel.java | 447 + .../client/model/ReferenceLinesRequest.java | 464 + .../client/model/ReplaceSettingModel.java | 394 + .../model/RolloutPercentageItemModel.java | 322 + .../client/model/RolloutRuleComparator.java | 110 + .../java/client/model/RolloutRuleModel.java | 446 + .../java/client/model/SdkKeysModel.java | 325 + .../java/client/model/SegmentComparator.java | 78 + .../client/model/SegmentConditionModel.java | 326 + .../java/client/model/SegmentListModel.java | 588 + .../java/client/model/SegmentModel.java | 651 + .../java/client/model/SettingDataModel.java | 554 + .../client/model/SettingFormulaModel.java | 772 ++ .../java/client/model/SettingModel.java | 576 + .../java/client/model/SettingTagModel.java | 379 + .../java/client/model/SettingType.java | 82 + .../java/client/model/SettingValueModel.java | 716 + .../java/client/model/SettingValueType.java | 320 + .../client/model/StaleFlagConfigModel.java | 431 + .../model/StaleFlagEnvironmentModel.java | 326 + .../client/model/StaleFlagProductModel.java | 420 + .../client/model/StaleFlagReminderScope.java | 78 + .../client/model/StaleFlagSettingModel.java | 503 + .../model/StaleFlagSettingTagModel.java | 319 + .../model/StaleFlagSettingValueModel.java | 351 + .../StaleFlagStaleInEnvironmentsType.java | 78 + .../publicapi/java/client/model/TagModel.java | 382 + .../java/client/model/TargetingRuleModel.java | 389 + .../model/UpdateComparisonValueListModel.java | 336 + .../model/UpdateComparisonValueModel.java | 376 + .../client/model/UpdateConditionModel.java | 363 + .../client/model/UpdateConfigRequest.java | 354 + .../client/model/UpdateEnvironmentModel.java | 383 + .../model/UpdateEvaluationFormulaModel.java | 387 + .../UpdateEvaluationFormulaWithIdModel.java | 413 + .../model/UpdateEvaluationFormulasModel.java | 309 + .../model/UpdateMemberPermissionsRequest.java | 388 + .../model/UpdatePercentageOptionModel.java | 322 + .../model/UpdatePermissionGroupRequest.java | 958 ++ .../model/UpdatePreferencesRequest.java | 430 + .../UpdatePrerequisiteFlagConditionModel.java | 352 + .../client/model/UpdateProductRequest.java | 354 + .../UpdateReasonRequiredEnvironmentModel.java | 314 + .../UpdateRolloutPercentageItemModel.java | 322 + .../client/model/UpdateRolloutRuleModel.java | 457 + .../model/UpdateSegmentConditionModel.java | 326 + .../java/client/model/UpdateSegmentModel.java | 417 + .../client/model/UpdateSettingValueModel.java | 395 + .../UpdateSettingValueWithSettingIdModel.java | 421 + .../model/UpdateSettingValuesWithIdModel.java | 309 + .../java/client/model/UpdateTagModel.java | 328 + .../model/UpdateTargetingRuleModel.java | 401 + .../model/UpdateUserConditionModel.java | 355 + .../java/client/model/UpdateValueModel.java | 377 + .../java/client/model/UserComparator.java | 146 + .../java/client/model/UserConditionModel.java | 355 + .../java/client/model/UserModel.java | 382 + .../java/client/model/ValueModel.java | 376 + .../java/client/model/WebHookHttpMethod.java | 78 + .../client/model/WebHookRequestModel.java | 418 + .../java/client/model/WebhookConfig.java | 326 + .../java/client/model/WebhookEnvironment.java | 326 + .../java/client/model/WebhookHeaderModel.java | 351 + .../model/WebhookHeaderResponseModel.java | 352 + .../client/model/WebhookResponseModel.java | 490 + .../client/model/WebhookSigningKeysModel.java | 325 + 328 files changed, 89468 insertions(+) create mode 100644 api/openapi.yaml create mode 100644 docs/AccessType.md create mode 100644 docs/AddOrUpdateIntegrationLinkModel.md create mode 100644 docs/AddOrUpdateJiraIntegrationLinkModel.md create mode 100644 docs/AuditLogItemModel.md create mode 100644 docs/AuditLogType.md create mode 100644 docs/AuditLogsApi.md create mode 100644 docs/CodeReferenceModel.md create mode 100644 docs/CodeReferenceRequest.md create mode 100644 docs/CodeReferencesApi.md create mode 100644 docs/ComparisonValueListModel.md create mode 100644 docs/ComparisonValueModel.md create mode 100644 docs/ConditionModel.md create mode 100644 docs/ConfigModel.md create mode 100644 docs/ConfigSettingFormulaModel.md create mode 100644 docs/ConfigSettingFormulasModel.md create mode 100644 docs/ConfigSettingValueModel.md create mode 100644 docs/ConfigSettingValuesModel.md create mode 100644 docs/ConfigsApi.md create mode 100644 docs/ConnectRequest.md create mode 100644 docs/CreateConfigRequest.md create mode 100644 docs/CreateEnvironmentModel.md create mode 100644 docs/CreateIntegrationModel.md create mode 100644 docs/CreateOrUpdateEnvironmentAccessModel.md create mode 100644 docs/CreatePermissionGroupRequest.md create mode 100644 docs/CreateProductRequest.md create mode 100644 docs/CreateSegmentModel.md create mode 100644 docs/CreateSettingInitialValues.md create mode 100644 docs/CreateTagModel.md create mode 100644 docs/DeleteIntegrationLinkModel.md create mode 100644 docs/DeleteRepositoryReportsRequest.md create mode 100644 docs/DeletedSettingModel.md create mode 100644 docs/EnvironmentAccessModel.md create mode 100644 docs/EnvironmentAccessType.md create mode 100644 docs/EnvironmentModel.md create mode 100644 docs/EnvironmentsApi.md create mode 100644 docs/EvaluationVersion.md create mode 100644 docs/FeatureFlagLimitations.md create mode 100644 docs/FeatureFlagSettingValuesApi.md create mode 100644 docs/FeatureFlagSettingValuesUsingSdkKeyApi.md create mode 100644 docs/FeatureFlagSettingValuesUsingSdkKeyV2Api.md create mode 100644 docs/FeatureFlagSettingValuesV2Api.md create mode 100644 docs/FeatureFlagsSettingsApi.md create mode 100644 docs/FlagReference.md create mode 100644 docs/InitialValue.md create mode 100644 docs/IntegrationLinkDetail.md create mode 100644 docs/IntegrationLinkDetailsModel.md create mode 100644 docs/IntegrationLinkModel.md create mode 100644 docs/IntegrationLinkType.md create mode 100644 docs/IntegrationLinksApi.md create mode 100644 docs/IntegrationModel.md create mode 100644 docs/IntegrationType.md create mode 100644 docs/IntegrationsApi.md create mode 100644 docs/IntegrationsModel.md create mode 100644 docs/InvitationModel.md create mode 100644 docs/InviteMembersRequest.md create mode 100644 docs/JsonPatchOperation.md create mode 100644 docs/KeyGenerationMode.md create mode 100644 docs/MeApi.md create mode 100644 docs/MeModel.md create mode 100644 docs/MemberModel.md create mode 100644 docs/MembersApi.md create mode 100644 docs/ModifyIntegrationRequest.md create mode 100644 docs/OperationType.md create mode 100644 docs/OrganizationAdminModel.md create mode 100644 docs/OrganizationInvitationModel.md create mode 100644 docs/OrganizationMemberModel.md create mode 100644 docs/OrganizationMembersModel.md create mode 100644 docs/OrganizationModel.md create mode 100644 docs/OrganizationPermissionGroupModel.md create mode 100644 docs/OrganizationPermissionModel.md create mode 100644 docs/OrganizationProductModel.md create mode 100644 docs/OrganizationsApi.md create mode 100644 docs/PercentageOptionModel.md create mode 100644 docs/PermissionGroupModel.md create mode 100644 docs/PermissionGroupsApi.md create mode 100644 docs/PreferencesModel.md create mode 100644 docs/PrerequisiteComparator.md create mode 100644 docs/PrerequisiteFlagConditionModel.md create mode 100644 docs/ProductModel.md create mode 100644 docs/ProductsApi.md create mode 100644 docs/ReasonRequiredEnvironmentModel.md create mode 100644 docs/ReferenceLineModel.md create mode 100644 docs/ReferenceLineRequest.md create mode 100644 docs/ReferenceLinesModel.md create mode 100644 docs/ReferenceLinesRequest.md create mode 100644 docs/ReplaceSettingModel.md create mode 100644 docs/RolloutPercentageItemModel.md create mode 100644 docs/RolloutRuleComparator.md create mode 100644 docs/RolloutRuleModel.md create mode 100644 docs/SdkKeysApi.md create mode 100644 docs/SdkKeysModel.md create mode 100644 docs/SegmentComparator.md create mode 100644 docs/SegmentConditionModel.md create mode 100644 docs/SegmentListModel.md create mode 100644 docs/SegmentModel.md create mode 100644 docs/SegmentsApi.md create mode 100644 docs/SettingDataModel.md create mode 100644 docs/SettingFormulaModel.md create mode 100644 docs/SettingModel.md create mode 100644 docs/SettingTagModel.md create mode 100644 docs/SettingType.md create mode 100644 docs/SettingValueModel.md create mode 100644 docs/SettingValueType.md create mode 100644 docs/StaleFlagConfigModel.md create mode 100644 docs/StaleFlagEnvironmentModel.md create mode 100644 docs/StaleFlagProductModel.md create mode 100644 docs/StaleFlagReminderScope.md create mode 100644 docs/StaleFlagSettingModel.md create mode 100644 docs/StaleFlagSettingTagModel.md create mode 100644 docs/StaleFlagSettingValueModel.md create mode 100644 docs/StaleFlagStaleInEnvironmentsType.md create mode 100644 docs/TagModel.md create mode 100644 docs/TagsApi.md create mode 100644 docs/TargetingRuleModel.md create mode 100644 docs/UpdateComparisonValueListModel.md create mode 100644 docs/UpdateComparisonValueModel.md create mode 100644 docs/UpdateConditionModel.md create mode 100644 docs/UpdateConfigRequest.md create mode 100644 docs/UpdateEnvironmentModel.md create mode 100644 docs/UpdateEvaluationFormulaModel.md create mode 100644 docs/UpdateEvaluationFormulaWithIdModel.md create mode 100644 docs/UpdateEvaluationFormulasModel.md create mode 100644 docs/UpdateMemberPermissionsRequest.md create mode 100644 docs/UpdatePercentageOptionModel.md create mode 100644 docs/UpdatePermissionGroupRequest.md create mode 100644 docs/UpdatePreferencesRequest.md create mode 100644 docs/UpdatePrerequisiteFlagConditionModel.md create mode 100644 docs/UpdateProductRequest.md create mode 100644 docs/UpdateReasonRequiredEnvironmentModel.md create mode 100644 docs/UpdateRolloutPercentageItemModel.md create mode 100644 docs/UpdateRolloutRuleModel.md create mode 100644 docs/UpdateSegmentConditionModel.md create mode 100644 docs/UpdateSegmentModel.md create mode 100644 docs/UpdateSettingValueModel.md create mode 100644 docs/UpdateSettingValueWithSettingIdModel.md create mode 100644 docs/UpdateSettingValuesWithIdModel.md create mode 100644 docs/UpdateTagModel.md create mode 100644 docs/UpdateTargetingRuleModel.md create mode 100644 docs/UpdateUserConditionModel.md create mode 100644 docs/UpdateValueModel.md create mode 100644 docs/UserComparator.md create mode 100644 docs/UserConditionModel.md create mode 100644 docs/UserModel.md create mode 100644 docs/ValueModel.md create mode 100644 docs/WebHookHttpMethod.md create mode 100644 docs/WebHookRequestModel.md create mode 100644 docs/WebhookConfig.md create mode 100644 docs/WebhookEnvironment.md create mode 100644 docs/WebhookHeaderModel.md create mode 100644 docs/WebhookHeaderResponseModel.md create mode 100644 docs/WebhookResponseModel.md create mode 100644 docs/WebhookSigningKeysModel.md create mode 100644 docs/WebhooksApi.md create mode 100644 docs/ZombieStaleFlagsApi.md create mode 100644 src/main/AndroidManifest.xml create mode 100644 src/main/java/com/configcat/publicapi/java/client/ApiCallback.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/ApiClient.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/ApiException.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/ApiResponse.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/Configuration.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/GzipRequestInterceptor.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/JSON.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/Pair.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/ProgressRequestBody.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/ProgressResponseBody.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/ServerConfiguration.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/ServerVariable.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/StringUtil.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/api/AuditLogsApi.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/api/CodeReferencesApi.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/api/ConfigsApi.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/api/EnvironmentsApi.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesApi.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyApi.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyV2Api.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesV2Api.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagsSettingsApi.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/api/IntegrationLinksApi.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/api/IntegrationsApi.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/api/MeApi.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/api/MembersApi.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/api/OrganizationsApi.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/api/PermissionGroupsApi.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/api/ProductsApi.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/api/SdkKeysApi.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/api/SegmentsApi.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/api/TagsApi.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/api/WebhooksApi.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/api/ZombieStaleFlagsApi.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/auth/ApiKeyAuth.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/auth/Authentication.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/auth/HttpBasicAuth.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/auth/HttpBearerAuth.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/AbstractOpenApiSchema.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/AccessType.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/AddOrUpdateIntegrationLinkModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/AddOrUpdateJiraIntegrationLinkModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/AuditLogItemModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/AuditLogType.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/CodeReferenceModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/CodeReferenceRequest.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ComparisonValueListModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ComparisonValueModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ConditionModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ConfigModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulaModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulasModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingValueModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingValuesModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ConnectRequest.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/CreateConfigRequest.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/CreateEnvironmentModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/CreateIntegrationModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/CreateOrUpdateEnvironmentAccessModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/CreatePermissionGroupRequest.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/CreateProductRequest.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/CreateSegmentModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/CreateSettingInitialValues.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/CreateTagModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/DeleteIntegrationLinkModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/DeleteRepositoryReportsRequest.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/DeletedSettingModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessType.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/EnvironmentModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/EvaluationVersion.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/FeatureFlagLimitations.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/FlagReference.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/InitialValue.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetail.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetailsModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkType.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/IntegrationModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/IntegrationType.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/IntegrationsModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/InvitationModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/InviteMembersRequest.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/JsonPatchOperation.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/KeyGenerationMode.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/MeModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/MemberModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ModifyIntegrationRequest.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/OperationType.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/OrganizationAdminModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/OrganizationInvitationModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/OrganizationMemberModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/OrganizationMembersModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/OrganizationModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/OrganizationPermissionGroupModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/OrganizationPermissionModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/OrganizationProductModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/PercentageOptionModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/PermissionGroupModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/PreferencesModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteComparator.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteFlagConditionModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ProductModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ReasonRequiredEnvironmentModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ReferenceLineModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ReferenceLineRequest.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ReferenceLinesModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ReferenceLinesRequest.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ReplaceSettingModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/RolloutPercentageItemModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/RolloutRuleComparator.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/RolloutRuleModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/SdkKeysModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/SegmentComparator.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/SegmentConditionModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/SegmentListModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/SegmentModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/SettingDataModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/SettingFormulaModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/SettingModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/SettingTagModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/SettingType.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/SettingValueModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/SettingValueType.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/StaleFlagConfigModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/StaleFlagEnvironmentModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/StaleFlagProductModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/StaleFlagReminderScope.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingTagModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingValueModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/StaleFlagStaleInEnvironmentsType.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/TagModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/TargetingRuleModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateComparisonValueListModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateComparisonValueModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateConditionModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateConfigRequest.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateEnvironmentModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaWithIdModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulasModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateMemberPermissionsRequest.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdatePercentageOptionModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdatePermissionGroupRequest.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdatePreferencesRequest.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdatePrerequisiteFlagConditionModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateProductRequest.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateReasonRequiredEnvironmentModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateRolloutPercentageItemModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateRolloutRuleModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateSegmentConditionModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateSegmentModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueWithSettingIdModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValuesWithIdModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateTagModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateTargetingRuleModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateUserConditionModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UpdateValueModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UserComparator.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UserConditionModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/UserModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/ValueModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/WebHookHttpMethod.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/WebHookRequestModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/WebhookConfig.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/WebhookEnvironment.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/WebhookHeaderModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/WebhookHeaderResponseModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/WebhookResponseModel.java create mode 100644 src/main/java/com/configcat/publicapi/java/client/model/WebhookSigningKeysModel.java diff --git a/api/openapi.yaml b/api/openapi.yaml new file mode 100644 index 0000000..10044c9 --- /dev/null +++ b/api/openapi.yaml @@ -0,0 +1,11566 @@ +openapi: 3.0.4 +info: + contact: + email: support@configcat.com + name: ConfigCat + url: https://configcat.com + description: "The purpose of this API is to access the ConfigCat platform programmatically.\n\ + You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature\ + \ Flags, Configs, Environments** or **Products** within ConfigCat.\n\n**Base API\ + \ URL**: https://api.configcat.com\n\nIf you prefer the swagger documentation,\ + \ you can find it here: [Swagger UI](https://api.configcat.com/swagger).\n\nThe\ + \ API is based on HTTP REST, uses resource-oriented URLs, status codes and supports\ + \ JSON \nformat. \n\n**Important:** Do not use this API for accessing and evaluating\ + \ feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview)\ + \ or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/)\ + \ instead.\n\n# OpenAPI Specification\n\nThe complete specification is publicly\ + \ available in the following formats: \n- [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json)\n\ + - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json)\n\nYou can use\ + \ it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator)\ + \ or\n[Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact\ + \ with this API.\n\n# Authentication\nThis API uses the [Basic HTTP Authentication\ + \ Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). \n\n\n\n# Throttling and rate limits\nAll\ + \ the rate limited API calls are returning information about the current rate\ + \ limit period in the following HTTP headers:\n\n| Header | Description |\n| :-\ + \ | :- |\n| X-Rate-Limit-Remaining | The maximum number of requests remaining\ + \ in the current rate limit period. |\n| X-Rate-Limit-Reset | The time\twhen\ + \ the current rate limit period resets.\t\t\t\t\t\t |\n\nWhen the rate limit\ + \ is exceeded by a request, the API returns with a `HTTP 429 - Too many requests`\ + \ status along with a `Retry-After` HTTP header.\n" + termsOfService: https://configcat.com/policies + title: ConfigCat Public Management API + version: v1 + x-logo: + url: https://api.configcat.com/resources/configcat-logo-horiz.svg +servers: +- url: https://api.configcat.com +security: +- Basic: [] +tags: +- description: |- + These endpoints are exclusive for Config V2 Feature Flags. +
They can only be used on a Config that has `evaluationVersion` set to `v2`.

+ With these endpoints you can control how your existing Feature Flags and Settings should serve their values. + You can turn Feature Flags on or off, update Setting values and change Targeting Rules. + + These endpoints are determining the Environment and Config by the SDK key passed in + the `X-CONFIGCAT-SDKKEY` request header. To identify the desired Feature Flag or Setting to change, + you can use either its `settingId` or `key` attribute. You can get those attributes + from the [Feature Flag & Setting](#tag/Feature-Flags-and-Settings) endpoints. + name: Feature Flag & Setting values using SDK Key V2 +- description: |- + These endpoints are exclusive for Config V2 Feature Flags. +
They can only be used on a Config that has `evaluationVersion` set to `v2`.

+ With these endpoints you can control how your existing Feature Flags and Settings should serve their values. + You can turn Feature Flags on or off, update Setting values and change Targeting Rules. + + To determine which Feature Flag or Setting you want to work with you have to pass its `settingId`. It can be + obtained from the [Feature Flag & Setting](#tag/Feature-Flags-and-Settings) endpoints. + + You also have to specify in which Environment you want to change the served value configuration by its + `environmentId` which can be obtained from the [List Environments](#operation/get-environments) endpoint. + name: Feature Flag & Setting values V2 +- description: "With these endpoints you can control how your existing Feature Flags\ + \ and Settings should serve their values. \nYou can turn Feature Flags on or off,\ + \ update Setting values and also add, remove or change the order of Percentage\ + \ and Targeting Rules.\n\nThese endpoints are determining the Environment and\ + \ Config by the SDK key passed in\nthe `X-CONFIGCAT-SDKKEY` request header. To identify the\ + \ desired Feature Flag or Setting to change, \nyou can use either its `settingId`\ + \ or `key` attribute. You can get those attributes \nfrom the [Feature Flag &\ + \ Setting](#tag/Feature-Flags-and-Settings) endpoints." + name: Feature Flag & Setting values using SDK Key +- description: "With these endpoints you can control how your existing Feature Flags\ + \ and Settings should serve their values. \nYou can turn Feature Flags on or off,\ + \ update Setting values and also add, remove or reorder Percentage and Targeting\ + \ Rules.\n\nTo determine which Feature Flag or Setting you want to work with you\ + \ have to pass its `settingId`. It can be\nobtained from the [Feature Flag & Setting](#tag/Feature-Flags-and-Settings)\ + \ endpoints.\n\nYou also have to specify in which Environment you want to change\ + \ the served value configuration by its\n`environmentId` which can be obtained\ + \ from the [List Environments](#operation/get-environments) endpoint." + name: Feature Flag & Setting values +- description: "With these endpoints you can manage your Feature Flags or Settings\ + \ within a Config. \nHowever you can't use them for manipulating the values of\ + \ your Feature Flags and Settings,\nto do that please visit the [Feature Flag\ + \ & Setting values using SDK Key](#tag/Feature-Flag-and-Setting-values-using-SDK-Key)\n\ + and [Feature Flag & Setting values](#tag/Feature-Flag-and-Setting-values) sections\ + \ of the API.\n\nFor using these endpoints, first you have to select which Config\ + \ you want to work with by its `configId` \nwhich can be obtained from the [List\ + \ Configs](#operation/get-configs) endpoint. \nThen you can use it to create new\ + \ Feature Flags or to get information about existing ones.\n\nThen you can obtain\ + \ the `settingId` or `key` of your desired Feature Flag or Setting \nto use them\ + \ for further operations in this API. \n\nHere you can read more about\ + \ the concept of Settings." + name: Feature Flags & Settings +- description: |- + With these endpoints you can get useful information about your Organizations. + This also can be used to manage your [Products](#tag/Products). + + Here you can read more about the Organizations. + name: Organizations +- description: |- + With these endpoints you can manage your Members. + + Here you can read more about Team Management. + name: Members +- description: |- + With these endpoints you can manage your Permission Groups. + + Here you can read more about Permissions. + name: Permission Groups +- description: |- + With these endpoints you can manage your Products. + By gathering the right `productId`, you can also manage [Environments](#tag/Environments), [Configs](#tag/Configs), [Tags](#tag/Tags), [Webhooks](#tag/Webhooks), and [Permission Groups](#tag/Permission-Groups) through the API. + + Here you can read more about the concept of Products. + name: Products +- description: |- + With these endpoints you can manage Webhooks. + + Here you can read more about the concept of Webhooks. + name: Webhooks +- description: "With these endpoints you can manage your Configs.\nThis also can be\ + \ used to manage [Feature Flags and Settings](#tag/Feature-Flags-and-Settings)\ + \ and their \n[served values](#tag/Feature-Flag-and-Setting-values) through this\ + \ API.\n\nHere you can read more about the concept\ + \ of Configs." + name: Configs +- description: "With these endpoints you can update existing Environments or add new\ + \ ones into your selected [Product](#tag/Products). \n\nHere you can read more about\ + \ the concept of Environments." + name: Environments +- description: |- + With these endpoints you can manage your Segments. + Segments allow you to group your users based on any of their properties. Define user segments and add them to multiple feature flags. + name: Segments +- description: With these endpoints you can manage your SDK Keys. + name: SDK Keys +- description: "With these endpoints you can manage Tags. Tags are stored under a\ + \ Product. You can and add a Tag to a Feature Flag or Setting using the [Update\ + \ Flag](#operation/update-setting) endpoint." + name: Tags +- description: |- + With these endpoints you can manage your Integrations. + + - Datadog + - Slack + - Amplitude + - MixPanel + - Segment + - PubNub (work in progress) + name: Integrations +- description: With these endpoints you can manage your integration links. + name: Integration links +- description: Access audit log entries. + name: Audit logs +- description: List Zombie (stale) flags + name: Zombie (stale) flags +- description: Information about the current user. + name: Me +- description: |- + With this endpoint you can upload Feature Flag and Setting usage references that will be shown on the ConfigCat Dashboard. + + Here you can read more about the concept of Code References. + name: Code References +paths: + /v1/organizations: + get: + description: This endpoint returns the list of the Organizations that belongs + to the user. + operationId: get-organizations + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/OrganizationModel' + type: array + description: "" + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: List Organizations + tags: + - Organizations + x-accepts: + - application/json + /v1/products: + get: + description: This endpoint returns the list of the Products that belongs to + the user. + operationId: get-products + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/ProductModel' + type: array + description: "" + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: List Products + tags: + - Products + x-accepts: + - application/json + /v1/products/{productId}/tags: + get: + description: "This endpoint returns the list of the Tags in a \nspecified Product,\ + \ identified by the `productId` parameter." + operationId: get-tags + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/TagModel' + type: array + description: "" + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: List Tags + tags: + - Tags + x-accepts: + - application/json + post: + description: "This endpoint creates a new Tag in a specified Product \nidentified\ + \ by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products)\ + \ endpoint." + operationId: create-tag + parameters: + - description: The identifier of the Organization. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateTagModel' + text/json: + schema: + $ref: '#/components/schemas/CreateTagModel' + application/*+json: + schema: + $ref: '#/components/schemas/CreateTagModel' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/TagModel' + description: When the creation was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Create Tag + tags: + - Tags + x-content-type: application/json + x-accepts: + - application/json + /v1/products/{productId}/webhooks: + get: + description: |- + This endpoint returns the list of the Webhooks that belongs to the given Product identified by the + `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + operationId: get-webhooks + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/WebhookResponseModel' + type: array + description: "" + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: List Webhooks + tags: + - Webhooks + x-accepts: + - application/json + /v1/products/{productId}/configs: + get: + description: |- + This endpoint returns the list of the Configs that belongs to the given Product identified by the + `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + operationId: get-configs + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/ConfigModel' + type: array + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: List Configs + tags: + - Configs + x-accepts: + - application/json + post: + description: "This endpoint creates a new Config in a specified Product \nidentified\ + \ by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products)\ + \ endpoint." + operationId: create-config + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateConfigRequest' + text/json: + schema: + $ref: '#/components/schemas/CreateConfigRequest' + application/*+json: + schema: + $ref: '#/components/schemas/CreateConfigRequest' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigModel' + description: When the creation was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Create Config + tags: + - Configs + x-content-type: application/json + x-accepts: + - application/json + /v1/products/{productId}/environments: + get: + description: |- + This endpoint returns the list of the Environments that belongs to the given Product identified by the + `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + operationId: get-environments + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/EnvironmentModel' + type: array + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: List Environments + tags: + - Environments + x-accepts: + - application/json + post: + description: "This endpoint creates a new Environment in a specified Product\ + \ \nidentified by the `productId` parameter, which can be obtained from the\ + \ [List Products](#operation/get-products) endpoint." + operationId: create-environment + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateEnvironmentModel' + text/json: + schema: + $ref: '#/components/schemas/CreateEnvironmentModel' + application/*+json: + schema: + $ref: '#/components/schemas/CreateEnvironmentModel' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/EnvironmentModel' + description: When the creation was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Create Environment + tags: + - Environments + x-content-type: application/json + x-accepts: + - application/json + /v1/products/{productId}/permissions: + get: + description: |- + This endpoint returns the list of the Permission Groups that belongs to the given Product identified by the + `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + operationId: get-permission-groups + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/PermissionGroupModel' + type: array + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: List Permission Groups + tags: + - Permission Groups + x-accepts: + - application/json + post: + description: "This endpoint creates a new Permission Group in a specified Product\ + \ \nidentified by the `productId` parameter, which can be obtained from the\ + \ [List Products](#operation/get-products) endpoint." + operationId: create-permission-group + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreatePermissionGroupRequest' + text/json: + schema: + $ref: '#/components/schemas/CreatePermissionGroupRequest' + application/*+json: + schema: + $ref: '#/components/schemas/CreatePermissionGroupRequest' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionGroupModel' + description: When the creation was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Create Permission Group + tags: + - Permission Groups + x-content-type: application/json + x-accepts: + - application/json + /v1/products/{productId}/integrations: + get: + description: |- + This endpoint returns the list of the Integrations that belongs to the given Product identified by the + `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + operationId: get-integrations + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/IntegrationsModel' + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: List Integrations + tags: + - Integrations + x-accepts: + - application/json + post: + description: "This endpoint creates a new Integration in a specified Product\ + \ \nidentified by the `productId` parameter, which can be obtained from the\ + \ [List Products](#operation/get-products) endpoint.\n\nThe Parameters dictionary\ + \ differs for each IntegrationType:\n- Datadog\n\t- `apikey`: Required. Datadog\ + \ API key.\n\t- `site`: Datadog site. Available values: `Us`, `Eu`, `Us1Fed`,\ + \ `Us3`, `Us5`. Default: `Us`.\n- Slack \n\tConnecting the Slack integration\ + \ through the Public Management API will not post messages with the ConfigCat\ + \ Feature Flags Slack app but with an incoming webhook.\n\t- `incoming_webhook.url`:\ + \ Required. The [incoming webhook URL](https://api.slack.com/messaging/webhooks)\ + \ where the integration should post messages.\n- Amplitude\n\t- `apiKey`:\ + \ Required. Amplitude API Key.\n\t- `secretKey`: Required. Amplitude Secret\ + \ Key.\n- Mixpanel\n\t- `serviceAccountUserName`: Required. Mixpanel Service\ + \ Account Username.\n\t- `serviceAccountSecret`: Required. Mixpanel Service\ + \ Account Secret.\n\t- `projectId`: Required. Mixpanel Project ID.\n\t- `server`:\ + \ Mixpanel Server. Available values: `StandardServer`, `EUResidencyServer`.\ + \ Default: `StandardServer`.\n- Twilio Segment\n\t- `writeKey`: Required.\ + \ Twilio Segment Write Key.\n\t- `server`: Twilio Segment Server. Available\ + \ values: `Us`, `Eu`. Default: `Us`.\n- PubNub (work in progress)" + operationId: create-integration + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateIntegrationModel' + text/json: + schema: + $ref: '#/components/schemas/CreateIntegrationModel' + application/*+json: + schema: + $ref: '#/components/schemas/CreateIntegrationModel' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/IntegrationModel' + description: When the creation was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Create Integration + tags: + - Integrations + x-content-type: application/json + x-accepts: + - application/json + /v1/products/{productId}/segments: + get: + description: |- + This endpoint returns the list of the Segments that belongs to the given Product identified by the + `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + operationId: get-segments + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/SegmentListModel' + type: array + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: List Segments + tags: + - Segments + x-accepts: + - application/json + post: + description: "This endpoint creates a new Segment in a specified Product \n\ + identified by the `productId` parameter, which can be obtained from the [List\ + \ Products](#operation/get-products) endpoint." + operationId: create-segment + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateSegmentModel' + text/json: + schema: + $ref: '#/components/schemas/CreateSegmentModel' + application/*+json: + schema: + $ref: '#/components/schemas/CreateSegmentModel' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/SegmentModel' + description: When the creation was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Create Segment + tags: + - Segments + x-content-type: application/json + x-accepts: + - application/json + /v1/configs/{configId}/settings: + get: + description: "This endpoint returns the list of the Feature Flags and Settings\ + \ defined in a \nspecified Config, identified by the `configId` parameter." + operationId: get-settings + parameters: + - description: The identifier of the Config. + explode: false + in: path + name: configId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/SettingModel' + type: array + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: List Flags + tags: + - Feature Flags & Settings + x-accepts: + - application/json + post: + description: |- + This endpoint creates a new Feature Flag or Setting in a specified Config + identified by the `configId` parameter. + + **Important:** The `key` attribute must be unique within the given Config. + operationId: create-setting + parameters: + - description: The identifier of the Config. + explode: false + in: path + name: configId + required: true + schema: + format: uuid + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateSettingInitialValues' + text/json: + schema: + $ref: '#/components/schemas/CreateSettingInitialValues' + application/*+json: + schema: + $ref: '#/components/schemas/CreateSettingInitialValues' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/SettingModel' + description: When the creation was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Create Flag + tags: + - Feature Flags & Settings + x-content-type: application/json + x-accepts: + - application/json + /v1/products/{productId}/auditlogs: + get: + description: "This endpoint returns the list of Audit log items for a given\ + \ Product \nand the result can be optionally filtered by Config and/or Environment.\n\ + \nIf neither `fromUtcDateTime` nor `toUtcDateTime` is set, the audit logs\ + \ for the **last 7 days** will be returned.\n\nThe distance between `fromUtcDateTime`\ + \ and `toUtcDateTime` cannot exceed **30 days**." + operationId: get-auditlogs + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + - description: The identifier of the Config. + explode: true + in: query + name: configId + required: false + schema: + format: uuid + type: string + style: form + - description: The identifier of the Environment. + explode: true + in: query + name: environmentId + required: false + schema: + format: uuid + type: string + style: form + - description: Filter Audit logs by Audit log type. + explode: true + in: query + name: auditLogType + required: false + schema: + allOf: + - $ref: '#/components/schemas/AuditLogType' + nullable: true + style: form + - description: Filter Audit logs by starting UTC date. + explode: true + in: query + name: fromUtcDateTime + required: false + schema: + format: date-time + type: string + style: form + - description: Filter Audit logs by ending UTC date. + explode: true + in: query + name: toUtcDateTime + required: false + schema: + format: date-time + type: string + style: form + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/AuditLogItemModel' + type: array + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: List Audit log items for Product + tags: + - Audit logs + x-accepts: + - application/json + /v1/products/{productId}/staleflags: + get: + description: "This endpoint returns the list of Zombie (stale) flags for a given\ + \ Product \nand the result can be optionally filtered by various parameters." + operationId: get-staleflags + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + - description: The scope of the report. + explode: true + in: query + name: scope + required: false + schema: + $ref: '#/components/schemas/StaleFlagReminderScope' + style: form + - description: The inactivity in days after a feature flag should be considered + stale. + explode: true + in: query + name: staleFlagAgeDays + required: false + schema: + format: int32 + maximum: 90 + minimum: 7 + type: integer + style: form + - description: Consider a feature flag as stale if the feature flag is stale + in all/any of the environments. + explode: true + in: query + name: staleFlagStaleInEnvironmentsType + required: false + schema: + $ref: '#/components/schemas/StaleFlagStaleInEnvironmentsType' + style: form + - description: Ignore environment identifiers from the report. + explode: true + in: query + name: ignoredEnvironmentIds + required: false + schema: + items: + format: uuid + type: string + type: array + style: form + - description: Ignore feature flags from the report based on their tag identifiers. + explode: true + in: query + name: ignoredTagIds + required: false + schema: + items: + format: int64 + type: integer + type: array + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/StaleFlagProductModel' + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: List Zombie (stale) flags for Product + tags: + - Zombie (stale) flags + x-accepts: + - application/json + /v1/settings/{settingId}/code-references: + get: + description: "" + parameters: + - description: The identifier of the Feature Flag or Setting. + explode: false + in: path + name: settingId + required: true + schema: + format: int32 + type: integer + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/CodeReferenceModel' + type: array + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Get References for Feature Flag or Setting + tags: + - Code References + x-accepts: + - application/json + /v1/configs/{configId}: + delete: + description: This endpoint removes a Config identified by the `configId` parameter. + operationId: delete-config + parameters: + - description: The identifier of the Config. + explode: false + in: path + name: configId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "204": + description: When the delete was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Delete Config + tags: + - Configs + x-accepts: + - application/json + get: + description: |- + This endpoint returns the metadata of a Config + identified by the `configId`. + operationId: get-config + parameters: + - description: The identifier of the Config. + explode: false + in: path + name: configId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigModel' + description: "When everything is ok, the config data returned." + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Get Config + tags: + - Configs + x-accepts: + - application/json + put: + description: This endpoint updates a Config identified by the `configId` parameter. + operationId: update-config + parameters: + - description: The identifier of the Config. + explode: false + in: path + name: configId + required: true + schema: + format: uuid + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateConfigRequest' + text/json: + schema: + $ref: '#/components/schemas/UpdateConfigRequest' + application/*+json: + schema: + $ref: '#/components/schemas/UpdateConfigRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigModel' + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Update Config + tags: + - Configs + x-content-type: application/json + x-accepts: + - application/json + /v1/configs/{configId}/deleted-settings: + get: + description: This endpoint returns the list of Feature Flags and Settings that + were deleted from the given Config. + operationId: get-deleted-settings + parameters: + - description: The identifier of the Config. + explode: false + in: path + name: configId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/DeletedSettingModel' + type: array + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: List Deleted Settings + tags: + - Audit logs + x-accepts: + - application/json + /v1/environments/{environmentId}: + delete: + description: |- + This endpoint removes an Environment identified by the `environmentId` parameter. + If the `cleanupAuditLogs` flag is set to true, it also deletes the audit log records related to the environment + (except for the `Created a new environment` and `Deleted an environment` records). + operationId: delete-environment + parameters: + - description: The identifier of the Environment. + explode: false + in: path + name: environmentId + required: true + schema: + format: uuid + type: string + style: simple + - description: An optional flag which indicates whether the audit log records + related to the environment should be deleted or not. + explode: true + in: query + name: cleanupAuditLogs + required: false + schema: + type: boolean + style: form + responses: + "204": + description: When the delete was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Delete Environment + tags: + - Environments + x-accepts: + - application/json + get: + description: "This endpoint returns the metadata of an Environment \nidentified\ + \ by the `environmentId`." + operationId: get-environment + parameters: + - description: The identifier of the Environment. + explode: false + in: path + name: environmentId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/EnvironmentModel' + description: "When everything is ok, the environment data returned." + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Get Environment + tags: + - Environments + x-accepts: + - application/json + put: + description: This endpoint updates an Environment identified by the `environmentId` + parameter. + operationId: update-environment + parameters: + - description: The identifier of the Environment. + explode: false + in: path + name: environmentId + required: true + schema: + format: uuid + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateEnvironmentModel' + text/json: + schema: + $ref: '#/components/schemas/UpdateEnvironmentModel' + application/*+json: + schema: + $ref: '#/components/schemas/UpdateEnvironmentModel' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/EnvironmentModel' + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Update Environment + tags: + - Environments + x-content-type: application/json + x-accepts: + - application/json + /v1/permissions/{permissionGroupId}: + delete: + description: This endpoint removes a Permission Group identified by the `permissionGroupId` + parameter. + operationId: delete-permission-group + parameters: + - description: The identifier of the Permission Group. + explode: false + in: path + name: permissionGroupId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "204": + description: When the delete was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Delete Permission Group + tags: + - Permission Groups + x-accepts: + - application/json + get: + description: "This endpoint returns the metadata of a Permission Group \nidentified\ + \ by the `permissionGroupId`." + operationId: get-permission-group + parameters: + - description: The identifier of the Permission Group. + explode: false + in: path + name: permissionGroupId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionGroupModel' + description: "When everything is ok, the permission group data returned." + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Get Permission Group + tags: + - Permission Groups + x-accepts: + - application/json + put: + description: This endpoint updates a Permission Group identified by the `permissionGroupId` + parameter. + operationId: update-permission-group + parameters: + - description: The identifier of the Permission Group. + explode: false + in: path + name: permissionGroupId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdatePermissionGroupRequest' + text/json: + schema: + $ref: '#/components/schemas/UpdatePermissionGroupRequest' + application/*+json: + schema: + $ref: '#/components/schemas/UpdatePermissionGroupRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionGroupModel' + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Update Permission Group + tags: + - Permission Groups + x-content-type: application/json + x-accepts: + - application/json + /v1/integrations/{integrationId}: + delete: + description: This endpoint removes a Integration identified by the `integrationId` + parameter. + operationId: delete-integration + parameters: + - description: The identifier of the Integration. + explode: false + in: path + name: integrationId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "204": + description: When the delete was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Delete Integration + tags: + - Integrations + x-accepts: + - application/json + get: + description: |- + This endpoint returns the metadata of an Integration + identified by the `integrationId`. + operationId: get-integration + parameters: + - description: The identifier of the Integration. + explode: false + in: path + name: integrationId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/IntegrationModel' + description: "When everything is ok, the integration data returned." + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Get Integration + tags: + - Integrations + x-accepts: + - application/json + put: + description: "This endpoint updates a Config identified by the `integrationId`\ + \ parameter.\n\nThe Parameters dictionary differs for each IntegrationType:\n\ + - Datadog\n\t- `apikey`: Required. Datadog API key.\n\t- `site`: Datadog site.\ + \ Available values: `Us`, `Eu`, `Us1Fed`, `Us3`, `Us5`. Default: `Us`.\n-\ + \ Slack \n\tConnecting the Slack integration through the Public Management\ + \ API will not post messages with the ConfigCat Feature Flags Slack app but\ + \ with an incoming webhook.\n\t- `incoming_webhook.url`: Required. The [incoming\ + \ webhook URL](https://api.slack.com/messaging/webhooks) where the integration\ + \ should post messages.\n- Amplitude\n\t- `apiKey`: Required. Amplitude API\ + \ Key.\n\t- `secretKey`: Required. Amplitude Secret Key.\n- Mixpanel\n\t-\ + \ `serviceAccountUserName`: Required. Mixpanel Service Account Username.\n\ + \t- `serviceAccountSecret`: Required. Mixpanel Service Account Secret.\n\t\ + - `projectId`: Required. Mixpanel Project ID.\n\t- `server`: Mixpanel Server.\ + \ Available values: `StandardServer`, `EUResidencyServer`. Default: `StandardServer`.\n\ + - Twilio Segment\n\t- `writeKey`: Required. Twilio Segment Write Key.\n\t\ + - `server`: Twilio Segment Server. Available values: `Us`, `Eu`. Default:\ + \ `Us`.\n- PubNub (work in progress)" + operationId: update-integration + parameters: + - description: The identifier of the Integration. + explode: false + in: path + name: integrationId + required: true + schema: + format: uuid + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ModifyIntegrationRequest' + text/json: + schema: + $ref: '#/components/schemas/ModifyIntegrationRequest' + application/*+json: + schema: + $ref: '#/components/schemas/ModifyIntegrationRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/IntegrationModel' + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Update Integration + tags: + - Integrations + x-content-type: application/json + x-accepts: + - application/json + /v1/integrationLink/{integrationLinkType}/{key}/details: + get: + description: "" + operationId: get-integration-link-details + parameters: + - description: The integration link's type. + explode: false + in: path + name: integrationLinkType + required: true + schema: + $ref: '#/components/schemas/IntegrationLinkType' + style: simple + - description: The key of the integration link. + explode: false + in: path + name: key + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/IntegrationLinkDetailsModel' + description: "When everything is ok, the details for the integration link\ + \ returned." + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Get Integration link + tags: + - Integration links + x-accepts: + - application/json + /v1/configs/{configId}/environments/{environmentId}: + get: + description: This endpoint returns the SDK Key for your Config in a specified + Environment. + operationId: get-sdk-keys + parameters: + - description: The identifier of the Config. + explode: false + in: path + name: configId + required: true + schema: + format: uuid + type: string + style: simple + - description: The identifier of the Environment. + explode: false + in: path + name: environmentId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SdkKeysModel' + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Get SDK Key + tags: + - SDK Keys + x-accepts: + - application/json + /v1/me: + get: + description: "" + operationId: get-me + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MeModel' + description: "" + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Get authenticated user details + tags: + - Me + x-accepts: + - application/json + /v1/organizations/{organizationId}/auditlogs: + get: + description: "This endpoint returns the list of Audit log items for a given\ + \ Organization \nand the result can be optionally filtered by Product and/or\ + \ Config and/or Environment.\n\nIf neither `fromUtcDateTime` nor `toUtcDateTime`\ + \ is set, the audit logs for the **last 7 days** will be returned.\n\nThe\ + \ distance between `fromUtcDateTime` and `toUtcDateTime` cannot exceed **30\ + \ days**." + operationId: get-organization-auditlogs + parameters: + - description: The identifier of the Organization. + explode: false + in: path + name: organizationId + required: true + schema: + format: uuid + type: string + style: simple + - description: The identifier of the Product. + explode: true + in: query + name: productId + required: false + schema: + format: uuid + type: string + style: form + - description: The identifier of the Config. + explode: true + in: query + name: configId + required: false + schema: + format: uuid + type: string + style: form + - description: The identifier of the Environment. + explode: true + in: query + name: environmentId + required: false + schema: + format: uuid + type: string + style: form + - description: Filter Audit logs by Audit log type. + explode: true + in: query + name: auditLogType + required: false + schema: + allOf: + - $ref: '#/components/schemas/AuditLogType' + nullable: true + style: form + - description: Filter Audit logs by starting UTC date. + explode: true + in: query + name: fromUtcDateTime + required: false + schema: + format: date-time + type: string + style: form + - description: Filter Audit logs by ending UTC date. + explode: true + in: query + name: toUtcDateTime + required: false + schema: + format: date-time + type: string + style: form + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/AuditLogItemModel' + type: array + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: List Audit log items for Organization + tags: + - Audit logs + x-accepts: + - application/json + /v1/organizations/{organizationId}/members: + get: + deprecated: true + description: "This endpoint returns the list of Members that belongs \nto the\ + \ given Organization, identified by the `organizationId` parameter.\n\nThe\ + \ results may vary based on the access level of the user who calls the endpoint:\ + \ \n- When it's called with Organization Admin privileges, the result will\ + \ contain each member in the Organization.\n- When it's called without Organization\ + \ Admin privileges, the result will contain each Organization Admin along\ + \ with members \n of those products where the caller has `Team members and\ + \ permission groups` (`canManageMembers`) permission." + operationId: get-organization-members + parameters: + - description: The identifier of the Organization. + explode: false + in: path + name: organizationId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/UserModel' + type: array + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: List Organization Members + tags: + - Members + x-accepts: + - application/json + /v2/organizations/{organizationId}/members: + get: + description: "This endpoint returns the list of Members that belongs \nto the\ + \ given Organization, identified by the `organizationId` parameter.\n\nThe\ + \ results may vary based on the access level of the user who calls the endpoint:\ + \ \n- When it's called with Organization Admin privileges, the result will\ + \ contain each member in the Organization.\n- When it's called without Organization\ + \ Admin privileges, the result will contain each Organization Admin along\ + \ with members \n of those products where the caller has `Team members and\ + \ permission groups` (`canManageMembers`) permission." + operationId: get-organization-members-v2 + parameters: + - description: The identifier of the Organization. + explode: false + in: path + name: organizationId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationMembersModel' + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: List Organization Members + tags: + - Members + x-accepts: + - application/json + /v1/organizations/{organizationId}/invitations: + get: + description: |- + This endpoint returns the list of pending invitations within the + given Organization identified by the `organizationId` parameter. + operationId: get-pending-invitations-org + parameters: + - description: The identifier of the Organization. + explode: false + in: path + name: organizationId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/OrganizationInvitationModel' + type: array + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: List Pending Invitations in Organization + tags: + - Members + x-accepts: + - application/json + /v1/products/{productId}/invitations: + get: + description: |- + This endpoint returns the list of pending invitations within the + given Product identified by the `productId` parameter. + operationId: get-pending-invitations + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/InvitationModel' + type: array + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: List Pending Invitations in Product + tags: + - Members + x-accepts: + - application/json + /v1/products/{productId}: + delete: + description: This endpoint removes a Product identified by the `productId` parameter. + operationId: delete-product + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "204": + description: When the delete was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Delete Product + tags: + - Products + x-accepts: + - application/json + get: + description: "This endpoint returns the metadata of a Product \nidentified by\ + \ the `productId`." + operationId: get-product + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ProductModel' + description: "When everything is ok, the product data is returned." + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Get Product + tags: + - Products + x-accepts: + - application/json + put: + description: This endpoint updates a Product identified by the `productId` parameter. + operationId: update-product + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateProductRequest' + text/json: + schema: + $ref: '#/components/schemas/UpdateProductRequest' + application/*+json: + schema: + $ref: '#/components/schemas/UpdateProductRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ProductModel' + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Update Product + tags: + - Products + x-content-type: application/json + x-accepts: + - application/json + /v1/products/{productId}/members: + get: + description: "This endpoint returns the list of Members that belongs \nto the\ + \ given Product, identified by the `productId` parameter." + operationId: get-product-members + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/MemberModel' + type: array + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: List Product Members + tags: + - Members + x-accepts: + - application/json + /v1/products/{productId}/preferences: + get: + description: "This endpoint returns the preferences of a Product \nidentified\ + \ by the `productId`." + operationId: get-product-preferences + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PreferencesModel' + description: "When everything is ok, the product preferences data is returned." + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Get Product Preferences + tags: + - Products + x-accepts: + - application/json + post: + description: This endpoint updates the preferences of a Product identified by + the `productId` parameter. + operationId: update-product-preferences + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdatePreferencesRequest' + text/json: + schema: + $ref: '#/components/schemas/UpdatePreferencesRequest' + application/*+json: + schema: + $ref: '#/components/schemas/UpdatePreferencesRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PreferencesModel' + description: When the update was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Update Product Preferences + tags: + - Products + x-content-type: application/json + x-accepts: + - application/json + /v1/segments/{segmentId}: + delete: + description: This endpoint removes a Segment identified by the `segmentId` parameter. + operationId: delete-segment + parameters: + - description: The identifier of the Segment. + explode: false + in: path + name: segmentId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "204": + description: When the delete was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Delete Segment + tags: + - Segments + x-accepts: + - application/json + get: + description: |- + This endpoint returns the metadata of a Segment + identified by the `segmentId`. + operationId: get-segment + parameters: + - description: The identifier of the Segment. + explode: false + in: path + name: segmentId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SegmentModel' + description: "When everything is ok, the config data returned." + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Get Segment + tags: + - Segments + x-accepts: + - application/json + put: + description: This endpoint updates a Segment identified by the `segmentId` parameter. + operationId: update-segment + parameters: + - description: The identifier of the Segment. + explode: false + in: path + name: segmentId + required: true + schema: + format: uuid + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateSegmentModel' + text/json: + schema: + $ref: '#/components/schemas/UpdateSegmentModel' + application/*+json: + schema: + $ref: '#/components/schemas/UpdateSegmentModel' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SegmentModel' + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Update Segment + tags: + - Segments + x-content-type: application/json + x-accepts: + - application/json + /v1/settings/{settingId}: + delete: + description: "This endpoint removes a Feature Flag or Setting from a specified\ + \ Config, \nidentified by the `configId` parameter." + operationId: delete-setting + parameters: + - description: The identifier of the Setting. + explode: false + in: path + name: settingId + required: true + schema: + format: int32 + type: integer + style: simple + responses: + "204": + description: When the delete was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Delete Flag + tags: + - Feature Flags & Settings + x-accepts: + - application/json + get: + description: "This endpoint returns the metadata attributes of a Feature Flag\ + \ or Setting \nidentified by the `settingId` parameter." + operationId: get-setting + parameters: + - description: The identifier of the Setting. + explode: false + in: path + name: settingId + required: true + schema: + format: int32 + type: integer + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SettingModel' + description: "When everything is ok, the setting data returned." + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Get Flag + tags: + - Feature Flags & Settings + x-accepts: + - application/json + patch: + description: "This endpoint updates the metadata of a Feature Flag or Setting\ + \ \nwith a collection of [JSON Patch](https://jsonpatch.com) operations in\ + \ a specified Config.\n\nOnly the `name`, `hint` and `tags` attributes are\ + \ modifiable by this endpoint.\nThe `tags` attribute is a simple collection\ + \ of the [tag IDs](#operation/get-tags) attached to the given setting.\n\n\ + The advantage of using JSON Patch is that you can describe individual update\ + \ operations on a resource\nwithout touching attributes that you don't want\ + \ to change.\n\nFor example: We have the following resource.\n```json\n{\n\ + \ \"settingId\": 5345,\n \"key\": \"myGrandFeature\",\n \"name\": \"Tihs\ + \ is a naem with soem typos.\",\n \"hint\": \"This flag controls my grandioso\ + \ feature.\",\n \"settingType\": \"boolean\",\n \"tags\": [\n {\n \ + \ \"tagId\": 0, \n \"name\": \"sample tag\", \n \"color\": \"\ + whale\"\n }\n ]\n}\n```\nIf we send an update request body as below (it\ + \ changes the `name` and adds the already existing tag with the id `2`):\n\ + ```json\n[\n {\n \"op\": \"replace\", \n \"path\": \"/name\", \n \ + \ \"value\": \"This is the name without typos.\"\n }, \n {\n \"op\"\ + : \"add\", \n \"path\": \"/tags/-\", \n \"value\": 2\n }\n]\n```\n\ + Only the `name` and `tags` are updated and all the other attributes remain\ + \ unchanged.\nSo we get a response like this:\n```json\n{\n \"settingId\"\ + : 5345, \n \"key\": \"myGrandFeature\", \n \"name\": \"This is the name\ + \ without typos.\", \n \"hint\": \"This flag controls my grandioso feature.\"\ + , \n \"settingType\": \"boolean\", \n \"tags\": [\n {\n \"tagId\"\ + : 0, \n \"name\": \"sample tag\", \n \"color\": \"whale\"\n },\ + \ \n {\n \"tagId\": 2, \n \"name\": \"another tag\", \n \ + \ \"color\": \"koala\"\n }\n ]\n}\n```" + operationId: update-setting + parameters: + - description: The identifier of the Setting. + explode: false + in: path + name: settingId + required: true + schema: + format: int32 + type: integer + style: simple + requestBody: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/JsonPatchOperation' + type: array + text/json: + schema: + items: + $ref: '#/components/schemas/JsonPatchOperation' + type: array + application/*+json: + schema: + items: + $ref: '#/components/schemas/JsonPatchOperation' + type: array + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SettingModel' + description: When the update was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Update Flag + tags: + - Feature Flags & Settings + x-content-type: application/json + x-accepts: + - application/json + put: + description: "This endpoint replaces the whole value of a Feature Flag or Setting\n\ + identified by the `settingId` parameter.\n\n**Important:** As this endpoint\ + \ is doing a complete replace, it's important to set every other attribute\ + \ that you don't \nwant to change in its original state. Not listing one means\ + \ it will reset." + operationId: replace-setting + parameters: + - description: The identifier of the Setting. + explode: false + in: path + name: settingId + required: true + schema: + format: int32 + type: integer + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ReplaceSettingModel' + text/json: + schema: + $ref: '#/components/schemas/ReplaceSettingModel' + application/*+json: + schema: + $ref: '#/components/schemas/ReplaceSettingModel' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SettingModel' + description: When the replace was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Replace Flag + tags: + - Feature Flags & Settings + x-content-type: application/json + x-accepts: + - application/json + /v1/tags/{tagId}/settings: + get: + description: "This endpoint returns the list of the Settings that \nhas the\ + \ specified Tag, identified by the `tagId` parameter." + operationId: get-settings-by-tag + parameters: + - description: The identifier of the Tag. + explode: false + in: path + name: tagId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/SettingModel' + type: array + description: "When everything is ok, the settings data returned." + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: List Settings by Tag + tags: + - Tags + x-accepts: + - application/json + /v1/settings/{settingKeyOrId}/value: + get: + description: "This endpoint returns the value of a Feature Flag or Setting \n\ + in a specified Environment identified by the SDK key passed\ + \ in the `X-CONFIGCAT-SDKKEY` header.\n\nThe most important attributes in\ + \ the response are the `value`, `rolloutRules` and `percentageRules`.\nThe\ + \ `value` represents what the clients will get when the evaluation requests\ + \ of our SDKs \nare not matching to any of the defined Targeting or Percentage\ + \ Rules, or when there are no additional rules to evaluate.\n\nThe `rolloutRules`\ + \ and `percentageRules` attributes are representing the current \nTargeting\ + \ and Percentage Rules configuration of the actual Feature Flag or Setting\ + \ \nin an **ordered** collection, which means the order of the returned rules\ + \ is matching to the\nevaluation order. You can read more about these rules\ + \ [here](https://configcat.com/docs/targeting/targeting-overview/)." + operationId: get-setting-value-by-sdkkey + parameters: + - description: The key or id of the Setting. + explode: false + in: path + name: settingKeyOrId + required: true + schema: + type: string + style: simple + - description: The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) + explode: false + in: header + name: X-CONFIGCAT-SDKKEY + required: false + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SettingValueModel' + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Get value + tags: + - Feature Flag & Setting values using SDK Key + x-accepts: + - application/json + patch: + description: "This endpoint updates the value of a Feature Flag or Setting \n\ + with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified\ + \ Environment\nidentified by the SDK key passed in the `X-CONFIGCAT-SDKKEY`\ + \ header.\n\nOnly the `value`, `rolloutRules` and `percentageRules` attributes\ + \ are modifiable by this endpoint.\n\nThe advantage of using JSON Patch is\ + \ that you can describe individual update operations on a resource\nwithout\ + \ touching attributes that you don't want to change. It supports collection\ + \ reordering, so it also \ncan be used for reordering the targeting rules\ + \ of a Feature Flag or Setting.\n\nFor example: We have the following resource.\n\ + ```json\n{\n \"rolloutPercentageItems\": [\n {\n \"percentage\":\ + \ 30,\n \"value\": true\n },\n {\n \"percentage\": 70,\n \ + \ \"value\": false\n }\n ],\n \"rolloutRules\": [],\n \"value\"\ + : false\n}\n```\nIf we send an update request body as below:\n```json\n[\n\ + \ {\n \"op\": \"replace\",\n \"path\": \"/value\",\n \"value\":\ + \ true\n }\n]\n```\nOnly the default served value is going to be set to `true`\ + \ and all the Percentage Rules are remaining unchanged.\nSo we get a response\ + \ like this:\n```json\n{\n \"rolloutPercentageItems\": [\n {\n \"\ + percentage\": 30,\n \"value\": true\n },\n {\n \"percentage\"\ + : 70,\n \"value\": false\n }\n ],\n \"rolloutRules\": [],\n \"\ + value\": true\n}\n```" + operationId: update-setting-value-by-sdkkey + parameters: + - description: The key or id of the Setting. + explode: false + in: path + name: settingKeyOrId + required: true + schema: + type: string + style: simple + - description: The reason note for the Audit Log if the Product's "Config changes + require a reason" preference is turned on. + explode: true + in: query + name: reason + required: false + schema: + type: string + style: form + - description: The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) + explode: false + in: header + name: X-CONFIGCAT-SDKKEY + required: false + schema: + type: string + style: simple + requestBody: + content: + application/json: + examples: + turn on a feature flag: + description: This example turns on a feature flag. + value: + - op: replace + path: /value + value: true + add percentage rules: + description: This example adds two items to the percentage evaluation + rules. + value: + - op: add + path: /rolloutPercentageItems/- + value: + percentage: 30 + value: true + - op: add + path: /rolloutPercentageItems/- + value: + percentage: 70 + value: false + add targeting rules: + description: This example adds two items to the targeting evaluation + rules. + value: + - op: add + path: /rolloutRules/- + value: + comparisonAttribute: Identifier + comparator: contains + comparisonValue: '@example.com' + value: true + - op: add + path: /rolloutRules/- + value: + comparisonAttribute: Identifier + comparator: isOneOf + comparisonValue: '@blacklist.com' + value: false + modify targeting rule: + description: This example modifies the first targeting rule's comparison + value and the second's value. + value: + - op: replace + path: /rolloutRules/0/comparisonValue + value: '@example2.com' + - op: replace + path: /rolloutRules/1/value + value: true + add segment rules: + description: This example adds a segment to the evaluation rules. + value: + - op: add + path: /rolloutRules/- + value: + segmentComparator: isIn + segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff + reorder targeting rules: + description: This example swaps the first and the second targeting + evaluation rule. + value: + - op: move + path: /rolloutRules/1 + from: /rolloutRules/0 + schema: + items: + $ref: '#/components/schemas/JsonPatchOperation' + type: array + text/json: + examples: + turn on a feature flag: + description: This example turns on a feature flag. + value: + - op: replace + path: /value + value: true + add percentage rules: + description: This example adds two items to the percentage evaluation + rules. + value: + - op: add + path: /rolloutPercentageItems/- + value: + percentage: 30 + value: true + - op: add + path: /rolloutPercentageItems/- + value: + percentage: 70 + value: false + add targeting rules: + description: This example adds two items to the targeting evaluation + rules. + value: + - op: add + path: /rolloutRules/- + value: + comparisonAttribute: Identifier + comparator: contains + comparisonValue: '@example.com' + value: true + - op: add + path: /rolloutRules/- + value: + comparisonAttribute: Identifier + comparator: isOneOf + comparisonValue: '@blacklist.com' + value: false + modify targeting rule: + description: This example modifies the first targeting rule's comparison + value and the second's value. + value: + - op: replace + path: /rolloutRules/0/comparisonValue + value: '@example2.com' + - op: replace + path: /rolloutRules/1/value + value: true + add segment rules: + description: This example adds a segment to the evaluation rules. + value: + - op: add + path: /rolloutRules/- + value: + segmentComparator: isIn + segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff + reorder targeting rules: + description: This example swaps the first and the second targeting + evaluation rule. + value: + - op: move + path: /rolloutRules/1 + from: /rolloutRules/0 + schema: + items: + $ref: '#/components/schemas/JsonPatchOperation' + type: array + application/*+json: + examples: + turn on a feature flag: + description: This example turns on a feature flag. + value: + - op: replace + path: /value + value: true + add percentage rules: + description: This example adds two items to the percentage evaluation + rules. + value: + - op: add + path: /rolloutPercentageItems/- + value: + percentage: 30 + value: true + - op: add + path: /rolloutPercentageItems/- + value: + percentage: 70 + value: false + add targeting rules: + description: This example adds two items to the targeting evaluation + rules. + value: + - op: add + path: /rolloutRules/- + value: + comparisonAttribute: Identifier + comparator: contains + comparisonValue: '@example.com' + value: true + - op: add + path: /rolloutRules/- + value: + comparisonAttribute: Identifier + comparator: isOneOf + comparisonValue: '@blacklist.com' + value: false + modify targeting rule: + description: This example modifies the first targeting rule's comparison + value and the second's value. + value: + - op: replace + path: /rolloutRules/0/comparisonValue + value: '@example2.com' + - op: replace + path: /rolloutRules/1/value + value: true + add segment rules: + description: This example adds a segment to the evaluation rules. + value: + - op: add + path: /rolloutRules/- + value: + segmentComparator: isIn + segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff + reorder targeting rules: + description: This example swaps the first and the second targeting + evaluation rule. + value: + - op: move + path: /rolloutRules/1 + from: /rolloutRules/0 + schema: + items: + $ref: '#/components/schemas/JsonPatchOperation' + type: array + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SettingValueModel' + description: "" + "204": + description: When no change applied on the resource. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Update value + tags: + - Feature Flag & Setting values using SDK Key + x-content-type: application/json + x-accepts: + - application/json + put: + description: "This endpoint replaces the value of a Feature Flag or Setting\ + \ \nin a specified Environment identified by the SDK key\ + \ passed in the `X-CONFIGCAT-SDKKEY` header.\n\nOnly the `value`, `rolloutRules`\ + \ and `percentageRules` attributes are modifiable by this endpoint.\n\n**Important:**\ + \ As this endpoint is doing a complete replace, it's important to set every\ + \ other attribute that you don't \nwant to change to its original state. Not\ + \ listing one means it will reset.\n\nFor example: We have the following resource.\n\ + ```json\n{\n \"rolloutPercentageItems\": [\n {\n \"percentage\":\ + \ 30,\n \"value\": true\n },\n {\n \"percentage\": 70,\n \ + \ \"value\": false\n }\n ],\n \"rolloutRules\": [],\n \"value\"\ + : false\n}\n```\nIf we send a replace request body as below:\n```json\n{\n\ + \ \"value\": true\n}\n```\nThen besides that the default served value is\ + \ set to `true`, all the Percentage Rules are deleted. \nSo we get a response\ + \ like this:\n```json\n{\n \"rolloutPercentageItems\": [],\n \"rolloutRules\"\ + : [],\n \"value\": true\n}\n```" + operationId: replace-setting-value-by-sdkkey + parameters: + - description: The key or id of the Setting. + explode: false + in: path + name: settingKeyOrId + required: true + schema: + type: string + style: simple + - description: The reason note for the Audit Log if the Product's "Config changes + require a reason" preference is turned on. + explode: true + in: query + name: reason + required: false + schema: + type: string + style: form + - description: The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) + explode: false + in: header + name: X-CONFIGCAT-SDKKEY + required: false + schema: + type: string + style: simple + requestBody: + content: + application/json: + examples: + simple: + description: This example turns on a feature flag. + value: + value: true + advanced: + description: This example turns on a feature flag and adds two items + to its percentage evaluation rules. + value: + value: true + rolloutPercentageItems: + - percentage: 30 + value: true + - percentage: 70 + value: false + schema: + $ref: '#/components/schemas/UpdateSettingValueModel' + text/json: + examples: + simple: + description: This example turns on a feature flag. + value: + value: true + advanced: + description: This example turns on a feature flag and adds two items + to its percentage evaluation rules. + value: + value: true + rolloutPercentageItems: + - percentage: 30 + value: true + - percentage: 70 + value: false + schema: + $ref: '#/components/schemas/UpdateSettingValueModel' + application/*+json: + examples: + simple: + description: This example turns on a feature flag. + value: + value: true + advanced: + description: This example turns on a feature flag and adds two items + to its percentage evaluation rules. + value: + value: true + rolloutPercentageItems: + - percentage: 30 + value: true + - percentage: 70 + value: false + schema: + $ref: '#/components/schemas/UpdateSettingValueModel' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SettingValueModel' + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Replace value + tags: + - Feature Flag & Setting values using SDK Key + x-content-type: application/json + x-accepts: + - application/json + /v1/environments/{environmentId}/settings/{settingId}/value: + get: + description: "This endpoint returns the value of a Feature Flag or Setting \n\ + in a specified Environment identified by the `environmentId` parameter.\n\n\ + The most important attributes in the response are the `value`, `rolloutRules`\ + \ and `percentageRules`.\nThe `value` represents what the clients will get\ + \ when the evaluation requests of our SDKs \nare not matching to any of the\ + \ defined Targeting or Percentage Rules, or when there are no additional rules\ + \ to evaluate.\n\nThe `rolloutRules` and `percentageRules` attributes are\ + \ representing the current \nTargeting and Percentage Rules configuration\ + \ of the actual Feature Flag or Setting \nin an **ordered** collection, which\ + \ means the order of the returned rules is matching to the\nevaluation order.\ + \ You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview)." + operationId: get-setting-value + parameters: + - description: The identifier of the Environment. + explode: false + in: path + name: environmentId + required: true + schema: + format: uuid + type: string + style: simple + - description: The id of the Setting. + explode: false + in: path + name: settingId + required: true + schema: + format: int32 + type: integer + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SettingValueModel' + description: "When everything is ok, the setting value data returned." + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Get value + tags: + - Feature Flag & Setting values + x-accepts: + - application/json + patch: + description: "This endpoint updates the value of a Feature Flag or Setting \n\ + with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified\ + \ Environment.\n\nOnly the `value`, `rolloutRules` and `percentageRules` attributes\ + \ are modifiable by this endpoint.\n\nThe advantage of using JSON Patch is\ + \ that you can describe individual update operations on a resource\nwithout\ + \ touching attributes that you don't want to change. It supports collection\ + \ reordering, so it also \ncan be used for reordering the targeting rules\ + \ of a Feature Flag or Setting.\n\nFor example: We have the following resource.\n\ + ```json\n{\n \"rolloutPercentageItems\": [\n {\n \"percentage\":\ + \ 30,\n \"value\": true\n },\n {\n \"percentage\": 70,\n \ + \ \"value\": false\n }\n ],\n \"rolloutRules\": [],\n \"value\"\ + : false\n}\n```\nIf we send an update request body as below:\n```json\n[\n\ + \ {\n \"op\": \"replace\",\n \"path\": \"/value\",\n \"value\":\ + \ true\n }\n]\n```\nOnly the default value is going to be set to `true` and\ + \ all the Percentage Rules are remaining unchanged.\nSo we get a response\ + \ like this:\n```json\n{\n \"rolloutPercentageItems\": [\n {\n \"\ + percentage\": 30,\n \"value\": true\n },\n {\n \"percentage\"\ + : 70,\n \"value\": false\n }\n ],\n \"rolloutRules\": [],\n \"\ + value\": true\n}\n```\n\nThe `rolloutRules` property describes two types of\ + \ rules:\n\n- **Targeting rules**: When you want to add or update a targeting\ + \ rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members\ + \ are required.\n- **Segment rules**: When you want to add add or update a\ + \ segment rule, the `segmentId` which identifies the desired segment and the\ + \ `segmentComparator` members are required." + operationId: update-setting-value + parameters: + - description: The identifier of the Environment. + explode: false + in: path + name: environmentId + required: true + schema: + format: uuid + type: string + style: simple + - description: The id of the Setting. + explode: false + in: path + name: settingId + required: true + schema: + format: int32 + type: integer + style: simple + - description: The reason note for the Audit Log if the Product's "Config changes + require a reason" preference is turned on. + explode: true + in: query + name: reason + required: false + schema: + type: string + style: form + requestBody: + content: + application/json: + examples: + turn on a feature flag: + description: This example turns on a feature flag. + value: + - op: replace + path: /value + value: true + add percentage rules: + description: This example adds two items to the percentage evaluation + rules. + value: + - op: add + path: /rolloutPercentageItems/- + value: + percentage: 30 + value: true + - op: add + path: /rolloutPercentageItems/- + value: + percentage: 70 + value: false + add targeting rules: + description: This example adds two items to the targeting evaluation + rules. + value: + - op: add + path: /rolloutRules/- + value: + comparisonAttribute: Identifier + comparator: contains + comparisonValue: '@example.com' + value: true + - op: add + path: /rolloutRules/- + value: + comparisonAttribute: Identifier + comparator: isOneOf + comparisonValue: '@blacklist.com' + value: false + modify targeting rule: + description: This example modifies the first targeting rule's comparison + value and the second's value. + value: + - op: replace + path: /rolloutRules/0/comparisonValue + value: '@example2.com' + - op: replace + path: /rolloutRules/1/value + value: true + add segment rules: + description: This example adds a segment to the evaluation rules. + value: + - op: add + path: /rolloutRules/- + value: + segmentComparator: isIn + segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff + reorder targeting rules: + description: This example swaps the first and the second targeting + evaluation rule. + value: + - op: move + path: /rolloutRules/1 + from: /rolloutRules/0 + schema: + items: + $ref: '#/components/schemas/JsonPatchOperation' + type: array + text/json: + examples: + turn on a feature flag: + description: This example turns on a feature flag. + value: + - op: replace + path: /value + value: true + add percentage rules: + description: This example adds two items to the percentage evaluation + rules. + value: + - op: add + path: /rolloutPercentageItems/- + value: + percentage: 30 + value: true + - op: add + path: /rolloutPercentageItems/- + value: + percentage: 70 + value: false + add targeting rules: + description: This example adds two items to the targeting evaluation + rules. + value: + - op: add + path: /rolloutRules/- + value: + comparisonAttribute: Identifier + comparator: contains + comparisonValue: '@example.com' + value: true + - op: add + path: /rolloutRules/- + value: + comparisonAttribute: Identifier + comparator: isOneOf + comparisonValue: '@blacklist.com' + value: false + modify targeting rule: + description: This example modifies the first targeting rule's comparison + value and the second's value. + value: + - op: replace + path: /rolloutRules/0/comparisonValue + value: '@example2.com' + - op: replace + path: /rolloutRules/1/value + value: true + add segment rules: + description: This example adds a segment to the evaluation rules. + value: + - op: add + path: /rolloutRules/- + value: + segmentComparator: isIn + segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff + reorder targeting rules: + description: This example swaps the first and the second targeting + evaluation rule. + value: + - op: move + path: /rolloutRules/1 + from: /rolloutRules/0 + schema: + items: + $ref: '#/components/schemas/JsonPatchOperation' + type: array + application/*+json: + examples: + turn on a feature flag: + description: This example turns on a feature flag. + value: + - op: replace + path: /value + value: true + add percentage rules: + description: This example adds two items to the percentage evaluation + rules. + value: + - op: add + path: /rolloutPercentageItems/- + value: + percentage: 30 + value: true + - op: add + path: /rolloutPercentageItems/- + value: + percentage: 70 + value: false + add targeting rules: + description: This example adds two items to the targeting evaluation + rules. + value: + - op: add + path: /rolloutRules/- + value: + comparisonAttribute: Identifier + comparator: contains + comparisonValue: '@example.com' + value: true + - op: add + path: /rolloutRules/- + value: + comparisonAttribute: Identifier + comparator: isOneOf + comparisonValue: '@blacklist.com' + value: false + modify targeting rule: + description: This example modifies the first targeting rule's comparison + value and the second's value. + value: + - op: replace + path: /rolloutRules/0/comparisonValue + value: '@example2.com' + - op: replace + path: /rolloutRules/1/value + value: true + add segment rules: + description: This example adds a segment to the evaluation rules. + value: + - op: add + path: /rolloutRules/- + value: + segmentComparator: isIn + segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff + reorder targeting rules: + description: This example swaps the first and the second targeting + evaluation rule. + value: + - op: move + path: /rolloutRules/1 + from: /rolloutRules/0 + schema: + items: + $ref: '#/components/schemas/JsonPatchOperation' + type: array + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SettingValueModel' + description: When the patch was successful. + "204": + description: When no change applied on the resource. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Update value + tags: + - Feature Flag & Setting values + x-content-type: application/json + x-accepts: + - application/json + put: + description: "This endpoint replaces the whole value of a Feature Flag or Setting\ + \ in a specified Environment.\n\nOnly the `value`, `rolloutRules` and `percentageRules`\ + \ attributes are modifiable by this endpoint.\n\n**Important:** As this endpoint\ + \ is doing a complete replace, it's important to set every other attribute\ + \ that you don't \nwant to change in its original state. Not listing one means\ + \ it will reset.\n\nFor example: We have the following resource.\n```json\n\ + {\n \"rolloutPercentageItems\": [\n {\n \"percentage\": 30,\n \ + \ \"value\": true\n },\n {\n \"percentage\": 70,\n \"value\"\ + : false\n }\n ],\n \"rolloutRules\": [],\n \"value\": false\n}\n```\n\ + If we send a replace request body as below:\n```json\n{\n \"value\": true\n\ + }\n```\nThen besides that the default value is set to `true`, all the Percentage\ + \ Rules are deleted. \nSo we get a response like this:\n```json\n{\n \"rolloutPercentageItems\"\ + : [],\n \"rolloutRules\": [],\n \"value\": true\n}\n```\n\nThe `rolloutRules`\ + \ property describes two types of rules:\n\n- **Targeting rules**: When you\ + \ want to add or update a targeting rule, the `comparator`, `comparisonAttribute`,\ + \ and `comparisonValue` members are required.\n- **Segment rules**: When you\ + \ want to add add or update a segment rule, the `segmentId` which identifies\ + \ the desired segment and the `segmentComparator` members are required." + operationId: replace-setting-value + parameters: + - description: The identifier of the Environment. + explode: false + in: path + name: environmentId + required: true + schema: + format: uuid + type: string + style: simple + - description: The id of the Setting. + explode: false + in: path + name: settingId + required: true + schema: + format: int32 + type: integer + style: simple + - description: The reason note for the Audit Log if the Product's "Config changes + require a reason" preference is turned on. + explode: true + in: query + name: reason + required: false + schema: + type: string + style: form + requestBody: + content: + application/json: + examples: + simple: + description: This example turns on a feature flag. + value: + value: true + advanced: + description: This example turns on a feature flag and adds two items + to its percentage evaluation rules. + value: + value: true + rolloutPercentageItems: + - percentage: 30 + value: true + - percentage: 70 + value: false + schema: + $ref: '#/components/schemas/UpdateSettingValueModel' + text/json: + examples: + simple: + description: This example turns on a feature flag. + value: + value: true + advanced: + description: This example turns on a feature flag and adds two items + to its percentage evaluation rules. + value: + value: true + rolloutPercentageItems: + - percentage: 30 + value: true + - percentage: 70 + value: false + schema: + $ref: '#/components/schemas/UpdateSettingValueModel' + application/*+json: + examples: + simple: + description: This example turns on a feature flag. + value: + value: true + advanced: + description: This example turns on a feature flag and adds two items + to its percentage evaluation rules. + value: + value: true + rolloutPercentageItems: + - percentage: 30 + value: true + - percentage: 70 + value: false + schema: + $ref: '#/components/schemas/UpdateSettingValueModel' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SettingValueModel' + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Replace value + tags: + - Feature Flag & Setting values + x-content-type: application/json + x-accepts: + - application/json + /v2/settings/{settingKeyOrId}/value: + get: + description: |- + This endpoint returns the value of a Feature Flag or Setting + in a specified Environment identified by the SDK key passed in the `X-CONFIGCAT-SDKKEY` header. + + The most important fields in the response are the `defaultValue`, `targetingRules`. + The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs + are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. + + The `targetingRules` represents the current + Targeting Rule configuration of the actual Feature Flag or Setting + in an **ordered** collection, which means the order of the returned rules is matching to the + evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). + + The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used at the [percentage evaluation](https://configcat.com/docs/advanced/targeting/#anatomy-of-the-percentage-based-targeting) of the Feature Flag or Setting. + operationId: get-setting-value-by-sdkkey-v2 + parameters: + - description: The key or id of the Setting. + explode: false + in: path + name: settingKeyOrId + required: true + schema: + type: string + style: simple + - description: The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) + explode: false + in: header + name: X-CONFIGCAT-SDKKEY + required: false + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SettingFormulaModel' + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Get value + tags: + - Feature Flag & Setting values using SDK Key V2 + x-accepts: + - application/json + patch: + description: |- + This endpoint updates the value of a Feature Flag or Setting + with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. + + Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. + + The advantage of using JSON Patch is that you can describe individual update operations on a resource + without touching attributes that you don't want to change. It supports collection reordering, so it also + can be used for reordering the targeting rules of a Feature Flag or Setting. + + For example: We have the following resource of a Feature Flag. + ```json + { + "defaultValue": { + "boolValue": false + }, + "targetingRules": [ + { + "conditions": [ + { + "userCondition": { + "comparisonAttribute": "Email", + "comparator": "sensitiveTextEquals", + "comparisonValue": { + "stringValue": "test@example.com" + } + } + } + ], + "percentageOptions": [], + "value": { + "boolValue": true + } + } + ] + } + ``` + If we send an update request body as below: + ```json + [ + { + "op": "replace", + "path": "/targetingRules/0/value/boolValue", + "value": true + } + ] + ``` + Only the first Targeting Rule's `value` is going to be set to `false` and all the other fields are remaining unchanged. + + So we get a response like this: + ```json + { + "defaultValue": { + "boolValue": false + }, + "targetingRules": [ + { + "conditions": [ + { + "userCondition": { + "comparisonAttribute": "Email", + "comparator": "sensitiveTextEquals", + "comparisonValue": { + "stringValue": "test@example.com" + } + } + } + ], + "percentageOptions": [], + "value": { + "boolValue": false + } + } + ] + } + ``` + operationId: update-setting-value-by-sdkkey-v2 + parameters: + - description: The key or id of the Setting. + explode: false + in: path + name: settingKeyOrId + required: true + schema: + type: string + style: simple + - description: The reason note for the Audit Log if the Product's "Config changes + require a reason" preference is turned on. + explode: true + in: query + name: reason + required: false + schema: + type: string + style: form + - description: The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) + explode: false + in: header + name: X-CONFIGCAT-SDKKEY + required: false + schema: + type: string + style: simple + requestBody: + content: + application/json: + examples: + turn on a feature flag: + description: This example turns on a feature flag. + value: + - op: replace + path: /defaultValue/boolValue + value: true + add targeting rules: + description: This example adds an evaluation rule with two conditions + to the Flag's targeting rules. + value: + - op: add + path: /targetingRules/- + value: + conditions: + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Email + comparisonValue: + stringValue: example@test.com + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Role + comparisonValue: + stringValue: Developer + value: + boolValue: false + modify targeting rule: + description: This example modifies a targeting rule's value. + value: + - op: replace + path: /targetingRules/0/value/boolValue + value: "true" + modify targeting rule's condition: + description: This example modifies a condition's comparison attribute + within a targeting rule. + value: + - op: replace + path: /targetingRules/0/conditions/0/userCondition/comparisonAttribute + value: Role + add segment condition: + description: This example adds a segment condition to a targeting + rule. + value: + - op: add + path: /targetingRules/0/conditions/- + value: + segmentCondition: + segmentComparator: isIn + segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff + add prerequisite flag condition: + description: This example adds a prerequisite flag condition to a + targeting rule. + value: + - op: add + path: /targetingRules/0/conditions/- + value: + prerequisiteFlagCondition: + prerequisiteSettingId: isIn + comparator: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff + prerequisiteComparisonValue: + boolValue: true + reorder targeting rules: + description: This example swaps the first and the second targeting + rule. + value: + - op: move + path: /targetingRules/1 + from: /targetingRules/0 + reorder targeting rule conditions: + description: This example swaps the first and the second condition + of a targeting rule. + value: + - op: move + path: /targetingRules/0/conditions/1 + from: /targetingRules/0/conditions/0 + schema: + items: + $ref: '#/components/schemas/JsonPatchOperation' + type: array + text/json: + examples: + turn on a feature flag: + description: This example turns on a feature flag. + value: + - op: replace + path: /defaultValue/boolValue + value: true + add targeting rules: + description: This example adds an evaluation rule with two conditions + to the Flag's targeting rules. + value: + - op: add + path: /targetingRules/- + value: + conditions: + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Email + comparisonValue: + stringValue: example@test.com + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Role + comparisonValue: + stringValue: Developer + value: + boolValue: false + modify targeting rule: + description: This example modifies a targeting rule's value. + value: + - op: replace + path: /targetingRules/0/value/boolValue + value: "true" + modify targeting rule's condition: + description: This example modifies a condition's comparison attribute + within a targeting rule. + value: + - op: replace + path: /targetingRules/0/conditions/0/userCondition/comparisonAttribute + value: Role + add segment condition: + description: This example adds a segment condition to a targeting + rule. + value: + - op: add + path: /targetingRules/0/conditions/- + value: + segmentCondition: + segmentComparator: isIn + segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff + add prerequisite flag condition: + description: This example adds a prerequisite flag condition to a + targeting rule. + value: + - op: add + path: /targetingRules/0/conditions/- + value: + prerequisiteFlagCondition: + prerequisiteSettingId: isIn + comparator: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff + prerequisiteComparisonValue: + boolValue: true + reorder targeting rules: + description: This example swaps the first and the second targeting + rule. + value: + - op: move + path: /targetingRules/1 + from: /targetingRules/0 + reorder targeting rule conditions: + description: This example swaps the first and the second condition + of a targeting rule. + value: + - op: move + path: /targetingRules/0/conditions/1 + from: /targetingRules/0/conditions/0 + schema: + items: + $ref: '#/components/schemas/JsonPatchOperation' + type: array + application/*+json: + examples: + turn on a feature flag: + description: This example turns on a feature flag. + value: + - op: replace + path: /defaultValue/boolValue + value: true + add targeting rules: + description: This example adds an evaluation rule with two conditions + to the Flag's targeting rules. + value: + - op: add + path: /targetingRules/- + value: + conditions: + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Email + comparisonValue: + stringValue: example@test.com + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Role + comparisonValue: + stringValue: Developer + value: + boolValue: false + modify targeting rule: + description: This example modifies a targeting rule's value. + value: + - op: replace + path: /targetingRules/0/value/boolValue + value: "true" + modify targeting rule's condition: + description: This example modifies a condition's comparison attribute + within a targeting rule. + value: + - op: replace + path: /targetingRules/0/conditions/0/userCondition/comparisonAttribute + value: Role + add segment condition: + description: This example adds a segment condition to a targeting + rule. + value: + - op: add + path: /targetingRules/0/conditions/- + value: + segmentCondition: + segmentComparator: isIn + segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff + add prerequisite flag condition: + description: This example adds a prerequisite flag condition to a + targeting rule. + value: + - op: add + path: /targetingRules/0/conditions/- + value: + prerequisiteFlagCondition: + prerequisiteSettingId: isIn + comparator: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff + prerequisiteComparisonValue: + boolValue: true + reorder targeting rules: + description: This example swaps the first and the second targeting + rule. + value: + - op: move + path: /targetingRules/1 + from: /targetingRules/0 + reorder targeting rule conditions: + description: This example swaps the first and the second condition + of a targeting rule. + value: + - op: move + path: /targetingRules/0/conditions/1 + from: /targetingRules/0/conditions/0 + schema: + items: + $ref: '#/components/schemas/JsonPatchOperation' + type: array + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SettingFormulaModel' + description: "" + "204": + description: When no change applied on the resource. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Update value + tags: + - Feature Flag & Setting values using SDK Key V2 + x-content-type: application/json + x-accepts: + - application/json + put: + description: |- + This endpoint replaces the value and the Targeting Rules of a Feature Flag or Setting + in a specified Environment identified by the SDK key passed in the `X-CONFIGCAT-SDKKEY` header. + + Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. + + **Important:** As this endpoint is doing a complete replace, it's important to set every other field that you don't + want to change to its original state. Not listing one means it will reset. + + For example: We have the following resource of a Feature Flag. + ```json + { + "defaultValue": { + "boolValue": false + }, + "targetingRules": [ + { + "conditions": [ + { + "userCondition": { + "comparisonAttribute": "Email", + "comparator": "sensitiveTextEquals", + "comparisonValue": { + "stringValue": "test@example.com" + } + } + } + ], + "percentageOptions": [], + "value": { + "boolValue": true + } + } + ] + } + ``` + If we send a replace request body as below: + ```json + { + "defaultValue": { + "boolValue": true + } + } + ``` + Then besides that the default served value is set to `true`, all the Targeting Rules are deleted. + So we get a response like this: + ```json + { + "defaultValue": { + "boolValue": true + }, + "targetingRules": [] + } + ``` + operationId: replace-setting-value-by-sdkkey-v2 + parameters: + - description: The key or id of the Setting. + explode: false + in: path + name: settingKeyOrId + required: true + schema: + type: string + style: simple + - description: The reason note for the Audit Log if the Product's "Config changes + require a reason" preference is turned on. + explode: true + in: query + name: reason + required: false + schema: + type: string + style: form + - description: The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) + explode: false + in: header + name: X-CONFIGCAT-SDKKEY + required: false + schema: + type: string + style: simple + requestBody: + content: + application/json: + examples: + simple: + description: This example turns on a feature flag. + value: + defaultValue: + boolValue: true + advanced: + description: This example turns on a feature flag and adds an evaluation + rule with two conditions to its targeting rules. + value: + defaultValue: + boolValue: true + targetingRules: + - conditions: + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Email + comparisonValue: + stringValue: example@test.com + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Role + comparisonValue: + stringValue: Developer + value: + boolValue: false + schema: + $ref: '#/components/schemas/UpdateEvaluationFormulaModel' + text/json: + examples: + simple: + description: This example turns on a feature flag. + value: + defaultValue: + boolValue: true + advanced: + description: This example turns on a feature flag and adds an evaluation + rule with two conditions to its targeting rules. + value: + defaultValue: + boolValue: true + targetingRules: + - conditions: + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Email + comparisonValue: + stringValue: example@test.com + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Role + comparisonValue: + stringValue: Developer + value: + boolValue: false + schema: + $ref: '#/components/schemas/UpdateEvaluationFormulaModel' + application/*+json: + examples: + simple: + description: This example turns on a feature flag. + value: + defaultValue: + boolValue: true + advanced: + description: This example turns on a feature flag and adds an evaluation + rule with two conditions to its targeting rules. + value: + defaultValue: + boolValue: true + targetingRules: + - conditions: + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Email + comparisonValue: + stringValue: example@test.com + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Role + comparisonValue: + stringValue: Developer + value: + boolValue: false + schema: + $ref: '#/components/schemas/UpdateEvaluationFormulaModel' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SettingFormulaModel' + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Replace value + tags: + - Feature Flag & Setting values using SDK Key V2 + x-content-type: application/json + x-accepts: + - application/json + /v2/environments/{environmentId}/settings/{settingId}/value: + get: + description: |- + This endpoint returns the value of a Feature Flag or Setting + in a specified Environment identified by the `environmentId` parameter. + + The most important fields in the response are the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute`. + The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs + are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. + + The `targetingRules` represents the current + Targeting Rule configuration of the actual Feature Flag or Setting + in an **ordered** collection, which means the order of the returned rules is matching to the + evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). + + The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used for [percentage evaluation](https://configcat.com/docs/targeting/percentage-options/) of the Feature Flag or Setting. + operationId: get-setting-value-v2 + parameters: + - description: The identifier of the Environment. + explode: false + in: path + name: environmentId + required: true + schema: + format: uuid + type: string + style: simple + - description: The id of the Setting. + explode: false + in: path + name: settingId + required: true + schema: + format: int32 + type: integer + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SettingFormulaModel' + description: "When everything is ok, the setting value data returned." + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Get value + tags: + - Feature Flag & Setting values V2 + x-accepts: + - application/json + patch: + description: |- + This endpoint updates the value of a Feature Flag or Setting + with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. + + Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. + + The advantage of using JSON Patch is that you can describe individual update operations on a resource + without touching attributes that you don't want to change. It supports collection reordering, so it also + can be used for reordering the targeting rules of a Feature Flag or Setting. + + For example: We have the following resource of a Feature Flag. + ```json + { + "defaultValue": { + "boolValue": false + }, + "targetingRules": [ + { + "conditions": [ + { + "userCondition": { + "comparisonAttribute": "Email", + "comparator": "sensitiveTextEquals", + "comparisonValue": { + "stringValue": "test@example.com" + } + } + } + ], + "percentageOptions": [], + "value": { + "boolValue": true + } + } + ] + } + ``` + If we send an update request body as below: + ```json + [ + { + "op": "replace", + "path": "/targetingRules/0/value/boolValue", + "value": true + } + ] + ``` + Only the first Targeting Rule's `value` is going to be set to `false` and all the other fields are remaining unchanged. + + So we get a response like this: + ```json + { + "defaultValue": { + "boolValue": false + }, + "targetingRules": [ + { + "conditions": [ + { + "userCondition": { + "comparisonAttribute": "Email", + "comparator": "sensitiveTextEquals", + "comparisonValue": { + "stringValue": "test@example.com" + } + } + } + ], + "percentageOptions": [], + "value": { + "boolValue": false + } + } + ] + } + ``` + operationId: update-setting-value-v2 + parameters: + - description: The identifier of the Environment. + explode: false + in: path + name: environmentId + required: true + schema: + format: uuid + type: string + style: simple + - description: The id of the Setting. + explode: false + in: path + name: settingId + required: true + schema: + format: int32 + type: integer + style: simple + - description: The reason note for the Audit Log if the Product's "Config changes + require a reason" preference is turned on. + explode: true + in: query + name: reason + required: false + schema: + type: string + style: form + requestBody: + content: + application/json: + examples: + turn on a feature flag: + description: This example turns on a feature flag. + value: + - op: replace + path: /defaultValue/boolValue + value: true + add targeting rules: + description: This example adds an evaluation rule with two conditions + to the Flag's targeting rules. + value: + - op: add + path: /targetingRules/- + value: + conditions: + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Email + comparisonValue: + stringValue: example@test.com + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Role + comparisonValue: + stringValue: Developer + value: + boolValue: false + modify targeting rule: + description: This example modifies a targeting rule's value. + value: + - op: replace + path: /targetingRules/0/value/boolValue + value: "true" + modify targeting rule's condition: + description: This example modifies a condition's comparison attribute + within a targeting rule. + value: + - op: replace + path: /targetingRules/0/conditions/0/userCondition/comparisonAttribute + value: Role + add segment condition: + description: This example adds a segment condition to a targeting + rule. + value: + - op: add + path: /targetingRules/0/conditions/- + value: + segmentCondition: + segmentComparator: isIn + segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff + add prerequisite flag condition: + description: This example adds a prerequisite flag condition to a + targeting rule. + value: + - op: add + path: /targetingRules/0/conditions/- + value: + prerequisiteFlagCondition: + prerequisiteSettingId: isIn + comparator: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff + prerequisiteComparisonValue: + boolValue: true + reorder targeting rules: + description: This example swaps the first and the second targeting + rule. + value: + - op: move + path: /targetingRules/1 + from: /targetingRules/0 + reorder targeting rule conditions: + description: This example swaps the first and the second condition + of a targeting rule. + value: + - op: move + path: /targetingRules/0/conditions/1 + from: /targetingRules/0/conditions/0 + schema: + items: + $ref: '#/components/schemas/JsonPatchOperation' + type: array + text/json: + examples: + turn on a feature flag: + description: This example turns on a feature flag. + value: + - op: replace + path: /defaultValue/boolValue + value: true + add targeting rules: + description: This example adds an evaluation rule with two conditions + to the Flag's targeting rules. + value: + - op: add + path: /targetingRules/- + value: + conditions: + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Email + comparisonValue: + stringValue: example@test.com + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Role + comparisonValue: + stringValue: Developer + value: + boolValue: false + modify targeting rule: + description: This example modifies a targeting rule's value. + value: + - op: replace + path: /targetingRules/0/value/boolValue + value: "true" + modify targeting rule's condition: + description: This example modifies a condition's comparison attribute + within a targeting rule. + value: + - op: replace + path: /targetingRules/0/conditions/0/userCondition/comparisonAttribute + value: Role + add segment condition: + description: This example adds a segment condition to a targeting + rule. + value: + - op: add + path: /targetingRules/0/conditions/- + value: + segmentCondition: + segmentComparator: isIn + segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff + add prerequisite flag condition: + description: This example adds a prerequisite flag condition to a + targeting rule. + value: + - op: add + path: /targetingRules/0/conditions/- + value: + prerequisiteFlagCondition: + prerequisiteSettingId: isIn + comparator: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff + prerequisiteComparisonValue: + boolValue: true + reorder targeting rules: + description: This example swaps the first and the second targeting + rule. + value: + - op: move + path: /targetingRules/1 + from: /targetingRules/0 + reorder targeting rule conditions: + description: This example swaps the first and the second condition + of a targeting rule. + value: + - op: move + path: /targetingRules/0/conditions/1 + from: /targetingRules/0/conditions/0 + schema: + items: + $ref: '#/components/schemas/JsonPatchOperation' + type: array + application/*+json: + examples: + turn on a feature flag: + description: This example turns on a feature flag. + value: + - op: replace + path: /defaultValue/boolValue + value: true + add targeting rules: + description: This example adds an evaluation rule with two conditions + to the Flag's targeting rules. + value: + - op: add + path: /targetingRules/- + value: + conditions: + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Email + comparisonValue: + stringValue: example@test.com + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Role + comparisonValue: + stringValue: Developer + value: + boolValue: false + modify targeting rule: + description: This example modifies a targeting rule's value. + value: + - op: replace + path: /targetingRules/0/value/boolValue + value: "true" + modify targeting rule's condition: + description: This example modifies a condition's comparison attribute + within a targeting rule. + value: + - op: replace + path: /targetingRules/0/conditions/0/userCondition/comparisonAttribute + value: Role + add segment condition: + description: This example adds a segment condition to a targeting + rule. + value: + - op: add + path: /targetingRules/0/conditions/- + value: + segmentCondition: + segmentComparator: isIn + segmentId: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff + add prerequisite flag condition: + description: This example adds a prerequisite flag condition to a + targeting rule. + value: + - op: add + path: /targetingRules/0/conditions/- + value: + prerequisiteFlagCondition: + prerequisiteSettingId: isIn + comparator: 008a1fd6-8245-4ea8-90dc-a1dc36c1b4ff + prerequisiteComparisonValue: + boolValue: true + reorder targeting rules: + description: This example swaps the first and the second targeting + rule. + value: + - op: move + path: /targetingRules/1 + from: /targetingRules/0 + reorder targeting rule conditions: + description: This example swaps the first and the second condition + of a targeting rule. + value: + - op: move + path: /targetingRules/0/conditions/1 + from: /targetingRules/0/conditions/0 + schema: + items: + $ref: '#/components/schemas/JsonPatchOperation' + type: array + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SettingFormulaModel' + description: When the patch was successful. + "204": + description: When no change applied on the resource. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Update value + tags: + - Feature Flag & Setting values V2 + x-content-type: application/json + x-accepts: + - application/json + put: + description: |- + This endpoint replaces the value and the Targeting Rules of a Feature Flag or Setting + in a specified Environment identified by the SDK key passed in the `X-CONFIGCAT-SDKKEY` header. + + Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. + + **Important:** As this endpoint is doing a complete replace, it's important to set every other field that you don't + want to change to its original state. Not listing one means it will reset. + + For example: We have the following resource of a Feature Flag. + ```json + { + "defaultValue": { + "boolValue": false + }, + "targetingRules": [ + { + "conditions": [ + { + "userCondition": { + "comparisonAttribute": "Email", + "comparator": "sensitiveTextEquals", + "comparisonValue": { + "stringValue": "test@example.com" + } + } + } + ], + "percentageOptions": [], + "value": { + "boolValue": true + } + } + ] + } + ``` + If we send a replace request body as below: + ```json + { + "defaultValue": { + "boolValue": true + } + } + ``` + Then besides that the default served value is set to `true`, all the Targeting Rules are deleted. + So we get a response like this: + ```json + { + "defaultValue": { + "boolValue": true + }, + "targetingRules": [] + } + ``` + operationId: replace-setting-value-v2 + parameters: + - description: The identifier of the Environment. + explode: false + in: path + name: environmentId + required: true + schema: + format: uuid + type: string + style: simple + - description: The id of the Setting. + explode: false + in: path + name: settingId + required: true + schema: + format: int32 + type: integer + style: simple + - description: The reason note for the Audit Log if the Product's "Config changes + require a reason" preference is turned on. + explode: true + in: query + name: reason + required: false + schema: + type: string + style: form + requestBody: + content: + application/json: + examples: + simple: + description: This example turns on a feature flag. + value: + defaultValue: + boolValue: true + advanced: + description: This example turns on a feature flag and adds an evaluation + rule with two conditions to its targeting rules. + value: + defaultValue: + boolValue: true + targetingRules: + - conditions: + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Email + comparisonValue: + stringValue: example@test.com + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Role + comparisonValue: + stringValue: Developer + value: + boolValue: false + schema: + $ref: '#/components/schemas/UpdateEvaluationFormulaModel' + text/json: + examples: + simple: + description: This example turns on a feature flag. + value: + defaultValue: + boolValue: true + advanced: + description: This example turns on a feature flag and adds an evaluation + rule with two conditions to its targeting rules. + value: + defaultValue: + boolValue: true + targetingRules: + - conditions: + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Email + comparisonValue: + stringValue: example@test.com + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Role + comparisonValue: + stringValue: Developer + value: + boolValue: false + schema: + $ref: '#/components/schemas/UpdateEvaluationFormulaModel' + application/*+json: + examples: + simple: + description: This example turns on a feature flag. + value: + defaultValue: + boolValue: true + advanced: + description: This example turns on a feature flag and adds an evaluation + rule with two conditions to its targeting rules. + value: + defaultValue: + boolValue: true + targetingRules: + - conditions: + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Email + comparisonValue: + stringValue: example@test.com + - userCondition: + comparator: sensitiveTextEquals + comparisonAttribute: Role + comparisonValue: + stringValue: Developer + value: + boolValue: false + schema: + $ref: '#/components/schemas/UpdateEvaluationFormulaModel' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SettingFormulaModel' + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Replace value + tags: + - Feature Flag & Setting values V2 + x-content-type: application/json + x-accepts: + - application/json + /v1/configs/{configId}/environments/{environmentId}/values: + get: + description: "This endpoint returns the value of a specified Config's Feature\ + \ Flags or Settings identified by the `configId` parameter\nin a specified\ + \ Environment identified by the `environmentId` parameter.\n\nThe most important\ + \ attributes in the response are the `value`, `rolloutRules` and `percentageRules`.\n\ + The `value` represents what the clients will get when the evaluation requests\ + \ of our SDKs \nare not matching to any of the defined Targeting or Percentage\ + \ Rules, or when there are no additional rules to evaluate.\n\nThe `rolloutRules`\ + \ and `percentageRules` attributes are representing the current \nTargeting\ + \ and Percentage Rules configuration of the actual Feature Flag or Setting\ + \ \nin an **ordered** collection, which means the order of the returned rules\ + \ is matching to the\nevaluation order. You can read more about these rules\ + \ [here](https://configcat.com/docs/targeting/targeting-overview/)." + operationId: get-setting-values + parameters: + - description: The identifier of the Config. + explode: false + in: path + name: configId + required: true + schema: + format: uuid + type: string + style: simple + - description: The identifier of the Environment. + explode: false + in: path + name: environmentId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigSettingValuesModel' + description: "When everything is ok, the setting values returned." + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Get values + tags: + - Feature Flag & Setting values + x-accepts: + - application/json + post: + description: "This endpoint replaces the values of a specified Config's Feature\ + \ Flags or Settings identified by the `configId` parameter\nin a specified\ + \ Environment identified by the `environmentId` parameter.\n\nOnly the `value`,\ + \ `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint.\n\ + \n**Important:** As this endpoint is doing a complete replace, it's important\ + \ to set every other attribute that you don't \nwant to change in its original\ + \ state. Not listing one means it will reset.\n\nFor example: We have the\ + \ following resource.\n```json\n{\n \"settingValues\": [\n {\n \"\ + rolloutPercentageItems\": [\n {\n \"percentage\": 30,\n \ + \ \"value\": true\n },\n {\n \"percentage\"\ + : 70,\n \"value\": false\n }\n ],\n \"rolloutRules\"\ + : [],\n \"value\": false,\n \"settingId\": 1\n }\n ]\n}\n```\n\ + If we send a replace request body as below:\n```json\n{ \n \"settingValues\"\ + : [\n {\n \"value\": true,\n \"settingId\": 1\n }\n ]\n}\n\ + ```\nThen besides that the default value is set to `true`, all the Percentage\ + \ Rules are deleted. \nSo we get a response like this:\n```json\n{\n \"settingValues\"\ + : [\n {\n \"rolloutPercentageItems\": [],\n \"rolloutRules\"\ + : [],\n \"value\": true,\n \"setting\": \n {\n \"settingId\"\ + : 1\n }\n }\n ]\n}\n```\n\nThe `rolloutRules` property describes\ + \ two types of rules:\n\n- **Targeting rules**: When you want to add or update\ + \ a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue`\ + \ members are required.\n- **Segment rules**: When you want to add add or\ + \ update a segment rule, the `segmentId` which identifies the desired segment\ + \ and the `segmentComparator` members are required." + operationId: post-setting-values + parameters: + - description: The identifier of the Config. + explode: false + in: path + name: configId + required: true + schema: + format: uuid + type: string + style: simple + - description: The identifier of the Environment. + explode: false + in: path + name: environmentId + required: true + schema: + format: uuid + type: string + style: simple + - description: The reason note for the Audit Log if the Product's "Config changes + require a reason" preference is turned on. + explode: true + in: query + name: reason + required: false + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateSettingValuesWithIdModel' + text/json: + schema: + $ref: '#/components/schemas/UpdateSettingValuesWithIdModel' + application/*+json: + schema: + $ref: '#/components/schemas/UpdateSettingValuesWithIdModel' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigSettingValuesModel' + description: "When everything is ok, the updated setting values returned." + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Post values + tags: + - Feature Flag & Setting values + x-content-type: application/json + x-accepts: + - application/json + /v2/configs/{configId}/environments/{environmentId}/values: + get: + description: |- + This endpoint returns all Feature Flag and Setting values of a Config identified by the `configId` parameter + in a specified Environment identified by the `environmentId` parameter. + + The most important fields in the response are the `defaultValue`, `targetingRules`. + The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs + are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. + + The `targetingRules` represents the current + Targeting Rule configuration of the actual Feature Flag or Setting + in an **ordered** collection, which means the order of the returned rules is matching to the + evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). + + The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used for [percentage evaluation](https://configcat.com/docs/targeting/percentage-options/) of the Feature Flag or Setting. + operationId: get-setting-values-v2 + parameters: + - description: The identifier of the Config. + explode: false + in: path + name: configId + required: true + schema: + format: uuid + type: string + style: simple + - description: The identifier of the Environment. + explode: false + in: path + name: environmentId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigSettingFormulasModel' + description: "When everything is ok, the setting values returned." + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Get values + tags: + - Feature Flag & Setting values V2 + x-accepts: + - application/json + post: + description: "This endpoint batch updates the Feature Flags and Settings of\ + \ a Config identified by the `configId` parameter\nin a specified Environment\ + \ identified by the `environmentId` parameter.\n\nOnly those Feature Flags\ + \ and Settings are updated which are part of the request, all the others are\ + \ left untouched.\n\n**Important:** As this endpoint is doing a complete replace\ + \ on those Feature Flags and Settings, which are set in the request. \nIt's\ + \ important to set every other field that you don't want to change in its\ + \ original state. Not listing a field means that it will reset.\n\nFor example:\ + \ We have the following resource of a Feature Flag.\n```json\n{\n \"settingFormulas\"\ + : [\n {\n \"defaultValue\": {\n \"boolValue\": false\n \ + \ },\n \"targetingRules\": [\n {\n \"conditions\": [\n\ + \ {\n \"userCondition\": {\n \"comparisonAttribute\"\ + : \"Email\",\n \"comparator\": \"sensitiveTextEquals\",\n \ + \ \"comparisonValue\": {\n \"stringValue\"\ + : \"test@example.com\"\n }\n }\n }\n\ + \ ],\n \"percentageOptions\": [],\n \"value\":\ + \ {\n \"boolValue\": true\n }\n }\n ],\n \ + \ \"settingId\": 1\n }\n ]\n}\n```\nIf we send a batch replace request\ + \ body as below:\n```json\n{ \n \"updateFormulas\": [\n {\n \"defaultValue\"\ + : {\n \"boolValue\": false\n },\n \"settingId\": 1\n }\n\ + \ ]\n}\n```\nThen besides that the default value is set to `true`, all Targeting\ + \ Rules of the related Feature Flag are deleted.\nSo we get a response like\ + \ this:\n```json\n{\n \"settingFormulas\": [\n {\n \"defaultValue\"\ + : {\n \"boolValue\": false\n },\n \"targetingRules\": [],\n\ + \ \"setting\": \n {\n \"settingId\": 1\n }\n }\n\ + \ ]\n}\n```" + operationId: post-setting-values-v2 + parameters: + - description: The identifier of the Config. + explode: false + in: path + name: configId + required: true + schema: + format: uuid + type: string + style: simple + - description: The identifier of the Environment. + explode: false + in: path + name: environmentId + required: true + schema: + format: uuid + type: string + style: simple + - description: The reason note for the Audit Log if the Product's "Config changes + require a reason" preference is turned on. + explode: true + in: query + name: reason + required: false + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateEvaluationFormulasModel' + text/json: + schema: + $ref: '#/components/schemas/UpdateEvaluationFormulasModel' + application/*+json: + schema: + $ref: '#/components/schemas/UpdateEvaluationFormulasModel' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigSettingFormulasModel' + description: "When everything is ok, the updated setting values returned." + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Post values + tags: + - Feature Flag & Setting values V2 + x-content-type: application/json + x-accepts: + - application/json + /v1/tags/{tagId}: + delete: + description: "This endpoint deletes a Tag identified by the `tagId` parameter.\ + \ To remove a Tag from a Feature Flag or Setting use the [Update Flag](#operation/update-setting)\ + \ endpoint." + operationId: delete-tag + parameters: + - description: The identifier of the Tag. + explode: false + in: path + name: tagId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "204": + description: When the delete was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Delete Tag + tags: + - Tags + x-accepts: + - application/json + get: + description: "This endpoint returns the metadata of a Tag \nidentified by the\ + \ `tagId`." + operationId: get-tag + parameters: + - description: The identifier of the Tag. + explode: false + in: path + name: tagId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/TagModel' + description: "When everything is ok, the tag data returned." + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Get Tag + tags: + - Tags + x-accepts: + - application/json + put: + description: This endpoint updates a Tag identified by the `tagId` parameter. + operationId: update-tag + parameters: + - description: The identifier of the Tag. + explode: false + in: path + name: tagId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateTagModel' + text/json: + schema: + $ref: '#/components/schemas/UpdateTagModel' + application/*+json: + schema: + $ref: '#/components/schemas/UpdateTagModel' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/TagModel' + description: "" + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Update Tag + tags: + - Tags + x-content-type: application/json + x-accepts: + - application/json + /v1/webhooks/{webhookId}: + delete: + description: This endpoint removes a Webhook identified by the `webhookId` parameter. + operationId: delete-webhook + parameters: + - description: The identifier of the Webhook. + explode: false + in: path + name: webhookId + required: true + schema: + format: int32 + type: integer + style: simple + responses: + "204": + description: When the delete was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Delete Webhook + tags: + - Webhooks + x-accepts: + - application/json + get: + description: "This endpoint returns the metadata of a Webhook \nidentified by\ + \ the `webhookId`." + operationId: get-webhook + parameters: + - description: The identifier of the Webhook. + explode: false + in: path + name: webhookId + required: true + schema: + format: int32 + type: integer + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/WebhookResponseModel' + description: "When everything is ok, the webhook data is returned." + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Get Webhook + tags: + - Webhooks + x-accepts: + - application/json + patch: + description: "This endpoint updates a Webhook identified by the `webhookId`\ + \ parameter with a collection of [JSON Patch](https://jsonpatch.com) operations.\n\ + \nThe advantage of using JSON Patch is that you can describe individual update\ + \ operations on a resource without touching attributes that you don't want\ + \ to change.\n\nFor example: We have the following resource.\n```json\n{\n\ + \ \"webhookId\": 6,\n \"url\": \"https://example.com/hook\",\n \"httpMethod\"\ + : \"post\",\n \"content\": \"null\",\n \"webHookHeaders\": []\n}\n```\n\ + If we send an update request body as below (it changes the `content` field\ + \ and adds a new HTTP header):\n```json\n[\n {\n \"op\": \"replace\",\ + \ \n \"path\": \"/content\", \n \"value\": \"Some webhook content.\"\ + \n }, \n {\n \"op\": \"add\", \n \"path\": \"/webHookHeaders/-\",\ + \ \n \"value\": {\n \"key\": \"X-Custom-Header\", \n \"value\"\ + : \"Custom header value\"\n }\n }\n]\n```\nOnly the `content` and `webHookHeaders`\ + \ are updated and all the other attributes remain unchanged.\nSo we get a\ + \ response like this:\n```json\n{\n \"webhookId\": 6,\n \"url\": \"https://example.com/hook\"\ + ,\n \"httpMethod\": \"post\", \n \"content\": \"Some webhook content.\"\ + , \n \"webHookHeaders\": [\n {\n \"key\": \"X-Custom-Header\", \n\ + \ \"value\": \"Custom header value\", \n \"isSecure\": false\n \ + \ }\n ]\n}\n```" + operationId: update-webhook + parameters: + - description: The identifier of the Webhook. + explode: false + in: path + name: webhookId + required: true + schema: + format: int32 + type: integer + style: simple + requestBody: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/JsonPatchOperation' + type: array + text/json: + schema: + items: + $ref: '#/components/schemas/JsonPatchOperation' + type: array + application/*+json: + schema: + items: + $ref: '#/components/schemas/JsonPatchOperation' + type: array + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/WebhookResponseModel' + description: When the update was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Update Webhook + tags: + - Webhooks + x-content-type: application/json + x-accepts: + - application/json + put: + description: |- + This endpoint replaces the whole value of a Webhook identified by the `webhookId` parameter. + + **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't + want to change in its original state. Not listing one means it will reset. + operationId: replace-webhook + parameters: + - description: The identifier of the Webhook. + explode: false + in: path + name: webhookId + required: true + schema: + format: int32 + type: integer + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WebHookRequestModel' + text/json: + schema: + $ref: '#/components/schemas/WebHookRequestModel' + application/*+json: + schema: + $ref: '#/components/schemas/WebHookRequestModel' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/WebhookResponseModel' + description: When the replace was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Replace Webhook + tags: + - Webhooks + x-content-type: application/json + x-accepts: + - application/json + /v1/webhooks/{webhookId}/keys: + get: + description: "This endpoint returns the signing keys of a Webhook \nidentified\ + \ by the `webhookId`.\n\nSigning keys are used for ensuring the Webhook requests\ + \ you receive are actually sent by ConfigCat.\n\nHere you can read more\ + \ about Webhook request verification." + operationId: get-webhook-signing-keys + parameters: + - description: The identifier of the Webhook. + explode: false + in: path + name: webhookId + required: true + schema: + format: int32 + type: integer + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/WebhookSigningKeysModel' + description: "When everything is ok, the webhook signing keys are returned." + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Get Webhook Signing Keys + tags: + - Webhooks + x-accepts: + - application/json + /v1/environments/{environmentId}/settings/{settingId}/integrationLinks/{integrationLinkType}/{key}: + delete: + description: "" + operationId: delete-integration-link + parameters: + - description: The identifier of the Environment. + explode: false + in: path + name: environmentId + required: true + schema: + format: uuid + type: string + style: simple + - description: The id of the Setting. + explode: false + in: path + name: settingId + required: true + schema: + format: int32 + type: integer + style: simple + - description: The integration's type. + explode: false + in: path + name: integrationLinkType + required: true + schema: + $ref: '#/components/schemas/IntegrationLinkType' + style: simple + - description: The key of the integration link. + explode: false + in: path + name: key + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteIntegrationLinkModel' + description: When everything is ok. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Delete Integration link + tags: + - Integration links + x-accepts: + - application/json + post: + description: "" + operationId: add-or-update-integration-link + parameters: + - description: The identifier of the Environment. + explode: false + in: path + name: environmentId + required: true + schema: + format: uuid + type: string + style: simple + - description: The id of the Setting. + explode: false + in: path + name: settingId + required: true + schema: + format: int32 + type: integer + style: simple + - description: The integration link's type. + explode: false + in: path + name: integrationLinkType + required: true + schema: + $ref: '#/components/schemas/IntegrationLinkType' + style: simple + - description: The key of the integration link. + explode: false + in: path + name: key + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AddOrUpdateIntegrationLinkModel' + text/json: + schema: + $ref: '#/components/schemas/AddOrUpdateIntegrationLinkModel' + application/*+json: + schema: + $ref: '#/components/schemas/AddOrUpdateIntegrationLinkModel' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/IntegrationLinkModel' + description: "When everything is ok, the integration link data returned." + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Add or update Integration link + tags: + - Integration links + x-content-type: application/json + x-accepts: + - application/json + /v1/jira/environments/{environmentId}/settings/{settingId}/integrationLinks/{key}: + post: + operationId: jira-add-or-update-integration-link + parameters: + - description: The identifier of the Environment. + explode: false + in: path + name: environmentId + required: true + schema: + format: uuid + type: string + style: simple + - description: The id of the Setting. + explode: false + in: path + name: settingId + required: true + schema: + format: int32 + type: integer + style: simple + - description: The key of the integration link. + explode: false + in: path + name: key + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AddOrUpdateJiraIntegrationLinkModel' + text/json: + schema: + $ref: '#/components/schemas/AddOrUpdateJiraIntegrationLinkModel' + application/*+json: + schema: + $ref: '#/components/schemas/AddOrUpdateJiraIntegrationLinkModel' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/IntegrationLinkModel' + description: "When everything is ok, the integration link data returned." + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + tags: + - Integration links + x-content-type: application/json + x-accepts: + - application/json + /v1/jira/connect: + post: + operationId: jira-connect + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectRequest' + text/json: + schema: + $ref: '#/components/schemas/ConnectRequest' + application/*+json: + schema: + $ref: '#/components/schemas/ConnectRequest' + responses: + "200": + description: OK + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + tags: + - Integration links + x-content-type: application/json + x-accepts: + - application/json + /v1/organizations/{organizationId}/products: + post: + description: "This endpoint creates a new Product in a specified Organization\ + \ \nidentified by the `organizationId` parameter, which can be obtained from\ + \ the [List Organizations](#operation/get-organizations) endpoint." + operationId: create-product + parameters: + - description: The identifier of the Organization. + explode: false + in: path + name: organizationId + required: true + schema: + format: uuid + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateProductRequest' + text/json: + schema: + $ref: '#/components/schemas/CreateProductRequest' + application/*+json: + schema: + $ref: '#/components/schemas/CreateProductRequest' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/ProductModel' + description: When the creation was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Create Product + tags: + - Products + x-content-type: application/json + x-accepts: + - application/json + /v1/configs/{configId}/environments/{environmentId}/webhooks: + post: + description: |- + This endpoint creates a new Webhook in a specified Product + identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + operationId: create-webhook + parameters: + - description: The identifier of the Config. + explode: false + in: path + name: configId + required: true + schema: + format: uuid + type: string + style: simple + - description: The identifier of the Environment. + explode: false + in: path + name: environmentId + required: true + schema: + format: uuid + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WebHookRequestModel' + text/json: + schema: + $ref: '#/components/schemas/WebHookRequestModel' + application/*+json: + schema: + $ref: '#/components/schemas/WebHookRequestModel' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/WebhookResponseModel' + description: When the creation was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Create Webhook + tags: + - Webhooks + x-content-type: application/json + x-accepts: + - application/json + /v1/code-references/delete-reports: + post: + description: "" + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteRepositoryReportsRequest' + text/json: + schema: + $ref: '#/components/schemas/DeleteRepositoryReportsRequest' + application/*+json: + schema: + $ref: '#/components/schemas/DeleteRepositoryReportsRequest' + required: true + responses: + "200": + description: OK + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Delete Reference reports + tags: + - Code References + x-content-type: application/json + x-accepts: + - application/json + /v1/products/{productId}/members/invite: + post: + description: This endpoint invites a Member into the given Product identified + by the `productId` parameter. + operationId: invite-member + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InviteMembersRequest' + text/json: + schema: + $ref: '#/components/schemas/InviteMembersRequest' + application/*+json: + schema: + $ref: '#/components/schemas/InviteMembersRequest' + required: true + responses: + "200": + description: When the invite was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Invite Member + tags: + - Members + x-content-type: application/json + x-accepts: + - application/json + /v1/code-references: + post: + description: "" + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CodeReferenceRequest' + text/json: + schema: + $ref: '#/components/schemas/CodeReferenceRequest' + application/*+json: + schema: + $ref: '#/components/schemas/CodeReferenceRequest' + required: true + responses: + "200": + description: OK + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Upload References + tags: + - Code References + x-content-type: application/json + x-accepts: + - application/json + /v1/organizations/{organizationId}/members/{userId}: + delete: + description: "This endpoint removes a Member identified by the `userId` from\ + \ the \ngiven Organization identified by the `organizationId` parameter." + operationId: delete-organization-member + parameters: + - description: The identifier of the Organization. + explode: false + in: path + name: organizationId + required: true + schema: + format: uuid + type: string + style: simple + - description: The identifier of the Member. + explode: false + in: path + name: userId + required: true + schema: + type: string + style: simple + responses: + "204": + description: When the delete was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Delete Member from Organization + tags: + - Members + x-accepts: + - application/json + post: + description: "This endpoint updates the permissions of a Member identified by\ + \ the `userId`. \nThis endpoint can also be used to move a Member between\ + \ Permission Groups within a Product.\nOnly a single Permission Group can\ + \ be set per Product." + operationId: add-member-to-group + parameters: + - description: The identifier of the Organization. + explode: false + in: path + name: organizationId + required: true + schema: + format: uuid + type: string + style: simple + - description: The identifier of the Member. + explode: false + in: path + name: userId + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateMemberPermissionsRequest' + text/json: + schema: + $ref: '#/components/schemas/UpdateMemberPermissionsRequest' + application/*+json: + schema: + $ref: '#/components/schemas/UpdateMemberPermissionsRequest' + required: true + responses: + "200": + description: When the update was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Update Member Permissions + tags: + - Members + x-content-type: application/json + x-accepts: + - application/json + /v1/invitations/{invitationId}: + delete: + description: This endpoint removes an Invitation identified by the `invitationId` + parameter. + operationId: delete-invitation + parameters: + - description: The identifier of the Invitation. + explode: false + in: path + name: invitationId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "204": + description: When the delete was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Delete Invitation + tags: + - Members + x-accepts: + - application/json + /v1/products/{productId}/members/{userId}: + delete: + description: "This endpoint removes a Member identified by the `userId` from\ + \ the \ngiven Product identified by the `productId` parameter." + operationId: delete-product-member + parameters: + - description: The identifier of the Product. + explode: false + in: path + name: productId + required: true + schema: + format: uuid + type: string + style: simple + - description: The identifier of the Member. + explode: false + in: path + name: userId + required: true + schema: + type: string + style: simple + responses: + "204": + description: When the delete was successful. + "400": + description: Bad request. + "404": + description: Not found. + "429": + description: Too many requests. In case of the request rate exceeds the + rate limits. + summary: Delete Member from Product + tags: + - Members + x-accepts: + - application/json +components: + schemas: + AccessType: + description: Represent the Feature Management permission. + enum: + - readOnly + - full + - custom + type: string + AddOrUpdateIntegrationLinkModel: + example: + description: description + url: url + properties: + description: + maxLength: 1000 + nullable: true + type: string + url: + maxLength: 1000 + nullable: true + type: string + type: object + AddOrUpdateJiraIntegrationLinkModel: + example: + jiraJwtToken: jiraJwtToken + clientKey: clientKey + description: description + url: url + properties: + jiraJwtToken: + maxLength: 15000 + minLength: 0 + type: string + clientKey: + maxLength: 255 + minLength: 0 + type: string + description: + maxLength: 1000 + minLength: 0 + nullable: true + type: string + url: + maxLength: 1000 + minLength: 0 + nullable: true + type: string + required: + - clientKey + - jiraJwtToken + type: object + AuditLogItemModel: + example: + auditLogTypeEnum: productCreated + auditLogDateTime: 2000-01-23T04:56:07.000+00:00 + auditLogType: auditLogType + auditLogId: 0 + truncated: true + why: why + userEmail: userEmail + where: where + details: details + actionTarget: actionTarget + userName: userName + changeSetId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + properties: + auditLogId: + format: int64 + type: integer + auditLogDateTime: + format: date-time + type: string + auditLogTypeEnum: + $ref: '#/components/schemas/AuditLogType' + changeSetId: + format: uuid + nullable: true + type: string + truncated: + type: boolean + auditLogType: + nullable: true + type: string + userEmail: + nullable: true + type: string + userName: + nullable: true + type: string + where: + nullable: true + type: string + why: + nullable: true + type: string + actionTarget: + nullable: true + type: string + details: + nullable: true + type: string + required: + - actionTarget + - auditLogDateTime + - auditLogId + - auditLogType + - auditLogTypeEnum + - changeSetId + - details + - truncated + - userEmail + - userName + - where + - why + type: object + AuditLogType: + enum: + - productCreated + - productChanged + - productOwnershipTransferred + - productDeleted + - productsReordered + - teamMemberInvited + - teamMemberInvitationRevoked + - teamMemberJoined + - teamMemberPermissionGroupChanged + - teamMemberRemoved + - teamMemberLeft + - teamMemberInvitationChanged + - teamMemberInvitationResent + - teamMemberInvitationRejected + - configCreated + - configChanged + - configDeleted + - configsReordered + - environmentCreated + - environmentChanged + - environmentDeleted + - environmentsReordered + - settingCreated + - settingChanged + - settingDeleted + - settingsReordered + - settingValueChanged + - webHookCreated + - webHookChanged + - webHookDeleted + - permissionGroupCreated + - permissionGroupChanged + - permissionGroupDeleted + - permissionGroupDefault + - apiKeyAdded + - apiKeyRemoved + - integrationAdded + - integrationChanged + - integrationRemoved + - apiKeyConnected + - integrationLinkAdded + - integrationLinkRemoved + - organizationAdded + - organizationRemoved + - organizationChanged + - organizationSubscriptionTypeChanged + - organizationAdminChanged + - organizationAdminLeft + - twoFactorDisabledForMember + - tagAdded + - tagChanged + - tagRemoved + - settingTagAdded + - settingTagRemoved + - publicApiAccessTokenAdded + - publicApiAccessTokenRemoved + - domainAdded + - domainVerified + - domainRemoved + - domainSamlConfigured + - domainSamlDeleted + - autoProvisioningConfigurationChanged + - samlIdpConfigurationAdded + - samlIdpConfigurationRemoved + - samlIdpConfigurationUpdated + - autoProvisioningEnabledChanged + - organizationMemberJoined + - organizationMemberProductJoinRequested + - organizationMemberProductJoinRequestRejected + - organizationMemberProductJoinRequestApproved + - organizationMemberRemoved + - codeReferencesUploaded + - codeReferenceDeleted + - codeReferenceStaleBranchDeleted + - segmentCreated + - segmentChanged + - segmentDeleted + - webhookSigningKeyDeleted + - webhookSigningKeyCreated + - userProvisioningConfigurationChanged + - syncGroupProvisioningRuleChanged + - syncGroupsReordered + - syncUserProvisioningEnabled + - syncUserProvisioningDisabled + - userEmailChanged + - userFullNameChanged + - userDisabled + - awsConnected + - awsDisconnected + - userEnabled + - syncUserDeleted + - syncGroupDeleted + type: string + CodeReferenceModel: + example: + codeReferenceId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + references: + - file: file + referenceLine: + lineText: lineText + lineNumber: 0 + fileUrl: fileUrl + postLines: + - lineText: lineText + lineNumber: 0 + - lineText: lineText + lineNumber: 0 + preLines: + - lineText: lineText + lineNumber: 0 + - lineText: lineText + lineNumber: 0 + - file: file + referenceLine: + lineText: lineText + lineNumber: 0 + fileUrl: fileUrl + postLines: + - lineText: lineText + lineNumber: 0 + - lineText: lineText + lineNumber: 0 + preLines: + - lineText: lineText + lineNumber: 0 + - lineText: lineText + lineNumber: 0 + commitUrl: commitUrl + uploader: uploader + repository: repository + branch: branch + syncedAt: 2000-01-23T04:56:07.000+00:00 + commitHash: commitHash + properties: + branch: + description: The source control branch on where the scan was performed. + (Source of the branch selector on the ConfigCat Dashboard) + nullable: true + type: string + references: + description: The actual references to the given Feature Flag or Setting. + items: + $ref: '#/components/schemas/ReferenceLinesModel' + nullable: true + type: array + commitUrl: + description: The related commit's URL. + nullable: true + type: string + commitHash: + description: The related commit's hash. + nullable: true + type: string + syncedAt: + description: The date and time when the reference report was uploaded. + format: date-time + type: string + repository: + description: The source control repository that contains the scanned code. + nullable: true + type: string + codeReferenceId: + description: The identifier of the reference report. + format: uuid + type: string + uploader: + description: The code reference scanning tool's name. + nullable: true + type: string + required: + - branch + - codeReferenceId + - commitHash + - commitUrl + - references + - repository + - syncedAt + - uploader + type: object + CodeReferenceRequest: + example: + flagReferences: + - references: + - file: file + referenceLine: + lineText: lineText + lineNumber: 6 + fileUrl: fileUrl + postLines: + - lineText: lineText + lineNumber: 6 + - lineText: lineText + lineNumber: 6 + preLines: + - lineText: lineText + lineNumber: 6 + - lineText: lineText + lineNumber: 6 + - file: file + referenceLine: + lineText: lineText + lineNumber: 6 + fileUrl: fileUrl + postLines: + - lineText: lineText + lineNumber: 6 + - lineText: lineText + lineNumber: 6 + preLines: + - lineText: lineText + lineNumber: 6 + - lineText: lineText + lineNumber: 6 + settingId: 0 + - references: + - file: file + referenceLine: + lineText: lineText + lineNumber: 6 + fileUrl: fileUrl + postLines: + - lineText: lineText + lineNumber: 6 + - lineText: lineText + lineNumber: 6 + preLines: + - lineText: lineText + lineNumber: 6 + - lineText: lineText + lineNumber: 6 + - file: file + referenceLine: + lineText: lineText + lineNumber: 6 + fileUrl: fileUrl + postLines: + - lineText: lineText + lineNumber: 6 + - lineText: lineText + lineNumber: 6 + preLines: + - lineText: lineText + lineNumber: 6 + - lineText: lineText + lineNumber: 6 + settingId: 0 + configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + commitUrl: commitUrl + uploader: uploader + activeBranches: + - activeBranches + - activeBranches + repository: repository + branch: branch + commitHash: commitHash + properties: + configId: + description: The Config's identifier the scanning was performed against. + format: uuid + type: string + repository: + description: The source control repository that contains the scanned code. + (Source of the repository selector on the ConfigCat Dashboard) + maxLength: 255 + minLength: 1 + type: string + branch: + description: The source control branch on where the scan was performed. + (Source of the branch selector on the ConfigCat Dashboard) + maxLength: 255 + minLength: 1 + type: string + commitUrl: + description: The related commit's URL. (Appears on the ConfigCat Dashboard) + maxLength: 1000 + minLength: 0 + nullable: true + type: string + commitHash: + description: The related commit's hash. (Appears on the ConfigCat Dashboard) + maxLength: 255 + minLength: 0 + nullable: true + type: string + uploader: + description: The scanning tool's name. (Appears on the ConfigCat Dashboard) + maxLength: 255 + minLength: 0 + nullable: true + type: string + activeBranches: + description: The currently active branches of the repository. Each previously + uploaded report that belongs to a non-reported active branch is being + deleted. + items: + type: string + type: array + flagReferences: + description: The actual code reference collection. + items: + $ref: '#/components/schemas/FlagReference' + type: array + required: + - branch + - configId + - repository + type: object + ComparisonValueListModel: + properties: + value: + description: The actual comparison value. + type: string + hint: + description: An optional hint for the comparison value. + maxLength: 1500 + minLength: 0 + nullable: true + type: string + required: + - value + type: object + ComparisonValueModel: + description: The value that the user object's attribute is compared to. + properties: + stringValue: + description: The string representation of the comparison value. + nullable: true + type: string + doubleValue: + description: The number representation of the comparison value. + format: double + nullable: true + type: number + listValue: + description: The list representation of the comparison value. + items: + $ref: '#/components/schemas/ComparisonValueListModel' + nullable: true + type: array + type: object + ConditionModel: + example: + segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + properties: + userCondition: + allOf: + - $ref: '#/components/schemas/UserConditionModel' + nullable: true + segmentCondition: + allOf: + - $ref: '#/components/schemas/SegmentConditionModel' + nullable: true + prerequisiteFlagCondition: + allOf: + - $ref: '#/components/schemas/PrerequisiteFlagConditionModel' + nullable: true + required: + - prerequisiteFlagCondition + - segmentCondition + - userCondition + type: object + ConfigModel: + description: Details of the Config. + example: + product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + description: description + migratedConfigId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + evaluationVersion: v1 + order: 0 + properties: + product: + $ref: '#/components/schemas/ProductModel' + configId: + description: Identifier of the Config. + format: uuid + type: string + name: + description: Name of the Config. + type: string + description: + description: Description of the Config. + nullable: true + type: string + order: + description: The order of the Config represented on the ConfigCat Dashboard. + format: int32 + type: integer + migratedConfigId: + format: uuid + nullable: true + type: string + evaluationVersion: + $ref: '#/components/schemas/EvaluationVersion' + required: + - configId + - description + - evaluationVersion + - migratedConfigId + - name + - order + - product + type: object + ConfigSettingFormulaModel: + example: + lastVersionId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + targetingRules: + - percentageOptions: + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + conditions: + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" + - percentageOptions: + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + conditions: + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" + percentageEvaluationAttribute: percentageEvaluationAttribute + defaultValue: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + settingIdsWherePrerequisite: + - 0 + - 0 + lastUpdaterUserEmail: lastUpdaterUserEmail + integrationLinks: + - integrationLinkType: trello + description: description + key: key + url: url + - integrationLinkType: trello + description: description + key: key + url: url + settingTags: + - color: color + tagId: 6 + name: name + settingTagId: 0 + - color: color + tagId: 6 + name: name + settingTagId: 0 + setting: + createdAt: 2000-01-23T04:56:07.000+00:00 + creatorEmail: creatorEmail + hint: hint + name: name + creatorFullName: creatorFullName + isWatching: true + settingType: boolean + key: key + settingId: 0 + order: 6 + updatedAt: 2000-01-23T04:56:07.000+00:00 + lastUpdaterUserFullName: lastUpdaterUserFullName + properties: + lastVersionId: + format: uuid + type: string + defaultValue: + $ref: '#/components/schemas/ValueModel' + targetingRules: + description: The targeting rules of the Feature Flag or Setting. + items: + $ref: '#/components/schemas/TargetingRuleModel' + type: array + setting: + $ref: '#/components/schemas/SettingDataModel' + updatedAt: + description: The last updated date and time when the Feature Flag or Setting. + format: date-time + nullable: true + type: string + percentageEvaluationAttribute: + description: "The user attribute used for percentage evaluation. If not\ + \ set, it defaults to the `Identifier` user object attribute." + nullable: true + type: string + lastUpdaterUserEmail: + description: The email of the user who last updated the Feature Flag or + Setting. + nullable: true + type: string + lastUpdaterUserFullName: + description: The name of the user who last updated the Feature Flag or Setting. + nullable: true + type: string + integrationLinks: + description: The integration links attached to the Feature Flag or Setting. + items: + $ref: '#/components/schemas/IntegrationLinkModel' + type: array + settingTags: + description: The tags attached to the Feature Flag or Setting. + items: + $ref: '#/components/schemas/SettingTagModel' + type: array + settingIdsWherePrerequisite: + description: List of Feature Flag and Setting IDs where the actual Feature + Flag or Setting is prerequisite. + items: + format: int32 + type: integer + type: array + required: + - defaultValue + - integrationLinks + - lastUpdaterUserEmail + - lastUpdaterUserFullName + - lastVersionId + - percentageEvaluationAttribute + - setting + - settingIdsWherePrerequisite + - settingTags + - targetingRules + - updatedAt + type: object + ConfigSettingFormulasModel: + example: + environment: + product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + color: color + name: name + description: description + order: 0 + reasonRequired: true + featureFlagLimitations: + maxComparisonValueListItemLength: 9 + maxComparisonValueListLength: 7 + maxPercentageOptionCount: 5 + maxConditionPerTargetingRuleCount: 2 + maxComparisonValueLength: 2 + maxStringFlagValueLength: 3 + maxTargetingRuleCount: 5 + settingFormulas: + - lastVersionId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + targetingRules: + - percentageOptions: + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + conditions: + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" + - percentageOptions: + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + conditions: + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" + percentageEvaluationAttribute: percentageEvaluationAttribute + defaultValue: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + settingIdsWherePrerequisite: + - 0 + - 0 + lastUpdaterUserEmail: lastUpdaterUserEmail + integrationLinks: + - integrationLinkType: trello + description: description + key: key + url: url + - integrationLinkType: trello + description: description + key: key + url: url + settingTags: + - color: color + tagId: 6 + name: name + settingTagId: 0 + - color: color + tagId: 6 + name: name + settingTagId: 0 + setting: + createdAt: 2000-01-23T04:56:07.000+00:00 + creatorEmail: creatorEmail + hint: hint + name: name + creatorFullName: creatorFullName + isWatching: true + settingType: boolean + key: key + settingId: 0 + order: 6 + updatedAt: 2000-01-23T04:56:07.000+00:00 + lastUpdaterUserFullName: lastUpdaterUserFullName + - lastVersionId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + targetingRules: + - percentageOptions: + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + conditions: + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" + - percentageOptions: + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + conditions: + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" + percentageEvaluationAttribute: percentageEvaluationAttribute + defaultValue: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + settingIdsWherePrerequisite: + - 0 + - 0 + lastUpdaterUserEmail: lastUpdaterUserEmail + integrationLinks: + - integrationLinkType: trello + description: description + key: key + url: url + - integrationLinkType: trello + description: description + key: key + url: url + settingTags: + - color: color + tagId: 6 + name: name + settingTagId: 0 + - color: color + tagId: 6 + name: name + settingTagId: 0 + setting: + createdAt: 2000-01-23T04:56:07.000+00:00 + creatorEmail: creatorEmail + hint: hint + name: name + creatorFullName: creatorFullName + isWatching: true + settingType: boolean + key: key + settingId: 0 + order: 6 + updatedAt: 2000-01-23T04:56:07.000+00:00 + lastUpdaterUserFullName: lastUpdaterUserFullName + readOnly: true + config: + product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + description: description + migratedConfigId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + evaluationVersion: v1 + order: 0 + properties: + config: + $ref: '#/components/schemas/ConfigModel' + environment: + $ref: '#/components/schemas/EnvironmentModel' + readOnly: + type: boolean + settingFormulas: + description: Evaluation descriptors of each updated Feature Flag and Setting. + items: + $ref: '#/components/schemas/ConfigSettingFormulaModel' + type: array + featureFlagLimitations: + $ref: '#/components/schemas/FeatureFlagLimitations' + required: + - config + - environment + - featureFlagLimitations + - readOnly + - settingFormulas + type: object + ConfigSettingValueModel: + example: + rolloutRules: + - comparator: "" + comparisonValue: comparisonValue + segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + segmentComparator: "" + value: "" + comparisonAttribute: comparisonAttribute + - comparator: "" + comparisonValue: comparisonValue + segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + segmentComparator: "" + value: "" + comparisonAttribute: comparisonAttribute + rolloutPercentageItems: + - percentage: 1 + value: "" + - percentage: 1 + value: "" + lastUpdaterUserEmail: lastUpdaterUserEmail + integrationLinks: + - integrationLinkType: trello + description: description + key: key + url: url + - integrationLinkType: trello + description: description + key: key + url: url + value: "" + settingTags: + - color: color + tagId: 6 + name: name + settingTagId: 0 + - color: color + tagId: 6 + name: name + settingTagId: 0 + setting: + createdAt: 2000-01-23T04:56:07.000+00:00 + creatorEmail: creatorEmail + hint: hint + name: name + creatorFullName: creatorFullName + isWatching: true + settingType: boolean + key: key + settingId: 0 + order: 6 + updatedAt: 2000-01-23T04:56:07.000+00:00 + lastUpdaterUserFullName: lastUpdaterUserFullName + properties: + setting: + $ref: '#/components/schemas/SettingDataModel' + updatedAt: + description: The last updated date and time when the Feature Flag or Setting. + format: date-time + nullable: true + type: string + lastUpdaterUserEmail: + description: The email of the user who last updated the Feature Flag or + Setting. + nullable: true + type: string + lastUpdaterUserFullName: + description: The name of the user who last updated the Feature Flag or Setting. + nullable: true + type: string + integrationLinks: + description: The integration links attached to the Feature Flag or Setting. + items: + $ref: '#/components/schemas/IntegrationLinkModel' + type: array + settingTags: + description: The tags attached to the Feature Flag or Setting. + items: + $ref: '#/components/schemas/SettingTagModel' + type: array + rolloutRules: + description: The targeting rule collection. + items: + $ref: '#/components/schemas/RolloutRuleModel' + type: array + rolloutPercentageItems: + description: The percentage rule collection. + items: + $ref: '#/components/schemas/RolloutPercentageItemModel' + type: array + value: + allOf: + - $ref: '#/components/schemas/SettingValueType' + description: The value to serve. It must respect the setting type. In some + generated clients for strictly typed languages you may use double/float + properties to handle integer values. + required: + - integrationLinks + - lastUpdaterUserEmail + - lastUpdaterUserFullName + - rolloutPercentageItems + - rolloutRules + - setting + - settingTags + - updatedAt + - value + type: object + ConfigSettingValuesModel: + example: + environment: + product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + color: color + name: name + description: description + order: 0 + reasonRequired: true + featureFlagLimitations: + maxComparisonValueListItemLength: 9 + maxComparisonValueListLength: 7 + maxPercentageOptionCount: 5 + maxConditionPerTargetingRuleCount: 2 + maxComparisonValueLength: 2 + maxStringFlagValueLength: 3 + maxTargetingRuleCount: 5 + readOnly: true + settingValues: + - rolloutRules: + - comparator: "" + comparisonValue: comparisonValue + segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + segmentComparator: "" + value: "" + comparisonAttribute: comparisonAttribute + - comparator: "" + comparisonValue: comparisonValue + segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + segmentComparator: "" + value: "" + comparisonAttribute: comparisonAttribute + rolloutPercentageItems: + - percentage: 1 + value: "" + - percentage: 1 + value: "" + lastUpdaterUserEmail: lastUpdaterUserEmail + integrationLinks: + - integrationLinkType: trello + description: description + key: key + url: url + - integrationLinkType: trello + description: description + key: key + url: url + value: "" + settingTags: + - color: color + tagId: 6 + name: name + settingTagId: 0 + - color: color + tagId: 6 + name: name + settingTagId: 0 + setting: + createdAt: 2000-01-23T04:56:07.000+00:00 + creatorEmail: creatorEmail + hint: hint + name: name + creatorFullName: creatorFullName + isWatching: true + settingType: boolean + key: key + settingId: 0 + order: 6 + updatedAt: 2000-01-23T04:56:07.000+00:00 + lastUpdaterUserFullName: lastUpdaterUserFullName + - rolloutRules: + - comparator: "" + comparisonValue: comparisonValue + segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + segmentComparator: "" + value: "" + comparisonAttribute: comparisonAttribute + - comparator: "" + comparisonValue: comparisonValue + segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + segmentComparator: "" + value: "" + comparisonAttribute: comparisonAttribute + rolloutPercentageItems: + - percentage: 1 + value: "" + - percentage: 1 + value: "" + lastUpdaterUserEmail: lastUpdaterUserEmail + integrationLinks: + - integrationLinkType: trello + description: description + key: key + url: url + - integrationLinkType: trello + description: description + key: key + url: url + value: "" + settingTags: + - color: color + tagId: 6 + name: name + settingTagId: 0 + - color: color + tagId: 6 + name: name + settingTagId: 0 + setting: + createdAt: 2000-01-23T04:56:07.000+00:00 + creatorEmail: creatorEmail + hint: hint + name: name + creatorFullName: creatorFullName + isWatching: true + settingType: boolean + key: key + settingId: 0 + order: 6 + updatedAt: 2000-01-23T04:56:07.000+00:00 + lastUpdaterUserFullName: lastUpdaterUserFullName + config: + product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + description: description + migratedConfigId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + evaluationVersion: v1 + order: 0 + properties: + config: + $ref: '#/components/schemas/ConfigModel' + environment: + $ref: '#/components/schemas/EnvironmentModel' + readOnly: + type: boolean + settingValues: + items: + $ref: '#/components/schemas/ConfigSettingValueModel' + type: array + featureFlagLimitations: + $ref: '#/components/schemas/FeatureFlagLimitations' + required: + - config + - environment + - featureFlagLimitations + - readOnly + - settingValues + type: object + ConnectRequest: + example: + jiraJwtToken: jiraJwtToken + clientKey: clientKey + properties: + clientKey: + maxLength: 255 + minLength: 0 + type: string + jiraJwtToken: + maxLength: 15000 + minLength: 0 + type: string + required: + - clientKey + - jiraJwtToken + type: object + CreateConfigRequest: + example: + name: name + description: description + evaluationVersion: v1 + order: 0 + properties: + name: + description: The name of the Config. + maxLength: 255 + minLength: 1 + type: string + description: + description: The description of the Config. + maxLength: 1000 + minLength: 0 + nullable: true + type: string + order: + description: |- + The order of the Config represented on the ConfigCat Dashboard. + Determined from an ascending sequence of integers. + format: int32 + nullable: true + type: integer + evaluationVersion: + $ref: '#/components/schemas/EvaluationVersion' + required: + - name + type: object + CreateEnvironmentModel: + example: + color: color + name: name + description: description + order: 0 + properties: + name: + description: The name of the Environment. + maxLength: 255 + minLength: 1 + type: string + color: + description: The color of the Environment. RGB or HTML color codes are allowed. + maxLength: 255 + minLength: 0 + nullable: true + type: string + description: + description: The description of the Environment. + maxLength: 1000 + minLength: 0 + nullable: true + type: string + order: + description: |- + The order of the Environment represented on the ConfigCat Dashboard. + Determined from an ascending sequence of integers. + format: int32 + nullable: true + type: integer + required: + - name + type: object + CreateIntegrationModel: + example: + integrationType: dataDog + environmentIds: + - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + configIds: + - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + parameters: + key: parameters + properties: + integrationType: + $ref: '#/components/schemas/IntegrationType' + name: + description: Name of the Integration. + minLength: 1 + type: string + parameters: + additionalProperties: + nullable: true + type: string + description: Parameters of the Integration. + type: object + environmentIds: + description: "List of Environment IDs that are connected with this Integration.\ + \ If the list is empty, all of the Environments are connected." + items: + format: uuid + type: string + type: array + configIds: + description: "List of Config IDs that are connected with this Integration.\ + \ If the list is empty, all of the Configs are connected." + items: + format: uuid + type: string + type: array + required: + - configIds + - environmentIds + - integrationType + - name + - parameters + type: object + CreateOrUpdateEnvironmentAccessModel: + example: + environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + environmentAccessType: null + properties: + environmentId: + description: Identifier of the Environment. + format: uuid + type: string + environmentAccessType: + $ref: '#/components/schemas/EnvironmentAccessType' + type: object + CreatePermissionGroupRequest: + example: + canViewProductStatistics: true + canDeleteTag: true + environmentAccesses: + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + environmentAccessType: null + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + environmentAccessType: null + canManageProductPreferences: true + canManageIntegrations: true + canDeleteSegments: true + accessType: readOnly + canManageMembers: true + canManageWebhook: true + canUseExportImport: true + canViewSdkKey: true + canDeleteSetting: true + canRotateSdkKey: true + canCreateOrUpdateSegments: true + canCreateOrUpdateSetting: true + canDeleteConfig: true + canDisable2FA: true + canDeleteEnvironment: true + canCreateOrUpdateConfig: true + canTagSetting: true + canCreateOrUpdateEnvironment: true + name: name + canViewProductAuditLog: true + canCreateOrUpdateTag: true + newEnvironmentAccessType: full + properties: + name: + description: Name of the Permission Group. + maxLength: 255 + minLength: 1 + type: string + canManageMembers: + description: Group members can manage team members. + type: boolean + canCreateOrUpdateConfig: + description: Group members can create/update Configs. + type: boolean + canDeleteConfig: + description: Group members can delete Configs. + type: boolean + canCreateOrUpdateEnvironment: + description: Group members can create/update Environments. + type: boolean + canDeleteEnvironment: + description: Group members can delete Environments. + type: boolean + canCreateOrUpdateSetting: + description: Group members can create/update Feature Flags and Settings. + type: boolean + canTagSetting: + description: Group members can attach/detach Tags to Feature Flags and Settings. + type: boolean + canDeleteSetting: + description: Group members can delete Feature Flags and Settings. + type: boolean + canCreateOrUpdateTag: + description: Group members can create/update Tags. + type: boolean + canDeleteTag: + description: Group members can delete Tags. + type: boolean + canManageWebhook: + description: Group members can create/update/delete Webhooks. + type: boolean + canUseExportImport: + description: Group members can use the export/import feature. + type: boolean + canManageProductPreferences: + description: Group members can update Product preferences. + type: boolean + canManageIntegrations: + description: Group members can add and configure integrations. + type: boolean + canViewSdkKey: + description: Group members has access to SDK keys. + type: boolean + canRotateSdkKey: + description: Group members can rotate SDK keys. + type: boolean + canCreateOrUpdateSegments: + description: Group members can create/update Segments. + type: boolean + canDeleteSegments: + description: Group members can delete Segments. + type: boolean + canViewProductAuditLog: + description: Group members has access to audit logs. + type: boolean + canViewProductStatistics: + description: Group members has access to product statistics. + type: boolean + accessType: + $ref: '#/components/schemas/AccessType' + newEnvironmentAccessType: + $ref: '#/components/schemas/EnvironmentAccessType' + environmentAccesses: + description: List of environment specific permissions. + items: + $ref: '#/components/schemas/CreateOrUpdateEnvironmentAccessModel' + nullable: true + type: array + canDisable2FA: + description: Group members can disable two-factor authentication for other + members. + type: boolean + required: + - name + type: object + CreateProductRequest: + example: + name: name + description: description + order: 0 + properties: + name: + description: The name of the Product. + maxLength: 1000 + minLength: 1 + type: string + description: + description: The description of the Product. + maxLength: 1000 + minLength: 0 + nullable: true + type: string + order: + description: |- + The order of the Product represented on the ConfigCat Dashboard. + Determined from an ascending sequence of integers. + format: int32 + nullable: true + type: integer + required: + - name + type: object + CreateSegmentModel: + example: + comparator: isOneOf + comparisonValue: comparisonValue + name: name + description: description + comparisonAttribute: comparisonAttribute + properties: + name: + description: Name of the Segment. + maxLength: 255 + minLength: 1 + type: string + description: + description: Description of the Segment. + maxLength: 1000 + minLength: 0 + nullable: true + type: string + comparisonAttribute: + description: The user's attribute the evaluation process must take into + account. + maxLength: 1000 + minLength: 1 + type: string + comparator: + $ref: '#/components/schemas/RolloutRuleComparator' + comparisonValue: + description: The value to compare with the given user attribute's value. + minLength: 1 + type: string + required: + - comparator + - comparisonAttribute + - comparisonValue + - name + type: object + CreateSettingInitialValues: + example: + initialValues: + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + value: "" + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + value: "" + settingIdToInitFrom: 1 + hint: hint + name: name + settingType: boolean + key: key + tags: + - 0 + - 0 + order: 6 + properties: + hint: + description: "A short description for the setting, shown on the Dashboard\ + \ UI." + maxLength: 1000 + minLength: 0 + nullable: true + type: string + tags: + description: The IDs of the tags which are attached to the setting. + items: + format: int64 + type: integer + nullable: true + type: array + order: + description: |- + The order of the Setting represented on the ConfigCat Dashboard. + Determined from an ascending sequence of integers. + format: int32 + nullable: true + type: integer + key: + description: The key of the Feature Flag or Setting. + maxLength: 255 + minLength: 1 + type: string + name: + description: The name of the Feature Flag or Setting. + maxLength: 255 + minLength: 1 + type: string + settingType: + $ref: '#/components/schemas/SettingType' + initialValues: + description: "Optional, initial value of the Feature Flag or Setting in\ + \ the given Environments. Only one of the SettingIdToInitFrom or the InitialValues\ + \ properties can be set." + items: + $ref: '#/components/schemas/InitialValue' + nullable: true + type: array + settingIdToInitFrom: + description: "Optional, the SettingId to initialize the values and tags\ + \ of the Feature Flag or Setting from. Only can be set if you have at\ + \ least ReadOnly access in all the Environments. Only one of the SettingIdToInitFrom\ + \ or the InitialValues properties can be set." + format: int32 + nullable: true + type: integer + required: + - key + - name + - settingType + type: object + CreateTagModel: + example: + color: color + name: name + properties: + name: + description: Name of the Tag. + maxLength: 255 + minLength: 1 + type: string + color: + description: "Color of the Tag. Possible values: `panther`, `whale`, `salmon`,\ + \ `lizard`, `canary`, `koala`, or any HTML color code." + maxLength: 255 + minLength: 0 + nullable: true + type: string + required: + - name + type: object + DeleteIntegrationLinkModel: + example: + hasRemainingIntegrationLink: true + properties: + hasRemainingIntegrationLink: + type: boolean + required: + - hasRemainingIntegrationLink + type: object + DeleteRepositoryReportsRequest: + example: + configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + repository: repository + branch: branch + settingId: 0 + properties: + configId: + description: The Config's identifier from where the reports should be deleted. + format: uuid + type: string + repository: + description: The source control repository which's reports should be deleted. + maxLength: 255 + minLength: 1 + type: string + branch: + description: "If it's set, only this branch's reports belonging to the given\ + \ repository will be deleted." + maxLength: 255 + minLength: 0 + nullable: true + type: string + settingId: + description: "If it's set, only this setting's reports belonging to the\ + \ given repository will be deleted." + format: int32 + nullable: true + type: integer + required: + - configId + - repository + type: object + DeletedSettingModel: + example: + hint: hint + name: name + settingType: boolean + key: key + properties: + key: + description: Key of the Feature Flag or Setting. + readOnly: true + type: string + name: + description: Name of the Feature Flag or Setting. + readOnly: true + type: string + hint: + description: Description of the Feature Flag or Setting. + nullable: true + readOnly: true + type: string + settingType: + $ref: '#/components/schemas/SettingType' + required: + - hint + - key + - name + - settingType + type: object + EnvironmentAccessModel: + example: + environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + color: color + environmentAccessType: null + name: name + description: description + order: 6 + reasonRequired: true + properties: + environmentId: + description: Identifier of the Environment. + format: uuid + type: string + name: + description: Name of the Environment. + nullable: true + type: string + color: + description: Color of the Environment. + nullable: true + type: string + description: + description: Description of the Environment. + nullable: true + type: string + order: + description: The order of the Environment represented on the ConfigCat Dashboard. + format: int32 + type: integer + reasonRequired: + description: Determines whether a mandatory reason must be given every time + when the Feature Flags or Settings in the given Environment are saved. + type: boolean + environmentAccessType: + $ref: '#/components/schemas/EnvironmentAccessType' + required: + - color + - description + - environmentAccessType + - environmentId + - name + - order + - reasonRequired + type: object + EnvironmentAccessType: + description: Represent the environment specific Feature Management permission. + enum: + - full + - readOnly + - none + type: string + EnvironmentModel: + description: Details of the Environment. + example: + product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + color: color + name: name + description: description + order: 0 + reasonRequired: true + properties: + product: + $ref: '#/components/schemas/ProductModel' + environmentId: + description: Identifier of the Environment. + format: uuid + type: string + name: + description: Name of the Environment. + type: string + color: + description: The configured color of the Environment. + nullable: true + type: string + description: + description: Description of the Environment. + nullable: true + type: string + order: + description: The order of the Environment represented on the ConfigCat Dashboard. + format: int32 + type: integer + reasonRequired: + description: Determines whether a mandatory reason must be given every time + when the Feature Flags or Settings in the given Environment are saved. + type: boolean + required: + - color + - description + - environmentId + - name + - order + - product + - reasonRequired + type: object + EvaluationVersion: + description: |- + Determines the evaluation version of a Config. + Using `v2` enables the new features of Config V2 (https://configcat.com/docs/advanced/config-v2). + enum: + - v1 + - v2 + type: string + FeatureFlagLimitations: + description: Subscription limitations regarding Feature flag or Setting values + and targeting. + example: + maxComparisonValueListItemLength: 9 + maxComparisonValueListLength: 7 + maxPercentageOptionCount: 5 + maxConditionPerTargetingRuleCount: 2 + maxComparisonValueLength: 2 + maxStringFlagValueLength: 3 + maxTargetingRuleCount: 5 + properties: + maxPercentageOptionCount: + description: Maximum number of percentage options a Feature Flag or Setting + can have within a targeting rule. + format: int32 + type: integer + maxTargetingRuleCount: + description: Maximum number of targeting rules a Feature Flag or Setting + can have. + format: int32 + type: integer + maxComparisonValueLength: + description: Maximum length of a text comparison value. + format: int32 + type: integer + maxComparisonValueListLength: + description: Maximum item count of a list comparison value. + format: int32 + type: integer + maxComparisonValueListItemLength: + description: Maximum length of a list comparison value's item. + format: int32 + type: integer + maxStringFlagValueLength: + description: Maximum length of a text Setting's value. + format: int32 + type: integer + maxConditionPerTargetingRuleCount: + description: Maximum number of `AND` conditions a Feature Flag or Setting + can have within a targeting rule. + format: int32 + type: integer + required: + - maxComparisonValueLength + - maxComparisonValueListItemLength + - maxComparisonValueListLength + - maxConditionPerTargetingRuleCount + - maxPercentageOptionCount + - maxStringFlagValueLength + - maxTargetingRuleCount + type: object + FlagReference: + example: + references: + - file: file + referenceLine: + lineText: lineText + lineNumber: 6 + fileUrl: fileUrl + postLines: + - lineText: lineText + lineNumber: 6 + - lineText: lineText + lineNumber: 6 + preLines: + - lineText: lineText + lineNumber: 6 + - lineText: lineText + lineNumber: 6 + - file: file + referenceLine: + lineText: lineText + lineNumber: 6 + fileUrl: fileUrl + postLines: + - lineText: lineText + lineNumber: 6 + - lineText: lineText + lineNumber: 6 + preLines: + - lineText: lineText + lineNumber: 6 + - lineText: lineText + lineNumber: 6 + settingId: 0 + properties: + settingId: + description: The identifier of the Feature Flag or Setting the code reference + belongs to. + format: int32 + type: integer + references: + description: The actual references to the given Feature Flag or Setting. + items: + $ref: '#/components/schemas/ReferenceLinesRequest' + type: array + required: + - references + - settingId + type: object + InitialValue: + example: + environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + value: "" + properties: + environmentId: + description: The ID of the Environment where the initial value must be set. + format: uuid + type: string + value: + allOf: + - $ref: '#/components/schemas/SettingValueType' + description: The initial value in the given Environment. It must respect + the setting type. In some generated clients for strictly typed languages + you may use double/float properties to handle integer values. + required: + - value + type: object + IntegrationLinkDetail: + example: + product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + environment: + product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + color: color + name: name + description: description + order: 0 + reasonRequired: true + readOnly: true + config: + product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + description: description + migratedConfigId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + evaluationVersion: v1 + order: 0 + setting: + createdAt: 2000-01-23T04:56:07.000+00:00 + creatorEmail: creatorEmail + hint: hint + name: name + creatorFullName: creatorFullName + isWatching: true + settingType: boolean + key: key + settingId: 0 + order: 6 + status: status + properties: + product: + $ref: '#/components/schemas/ProductModel' + config: + $ref: '#/components/schemas/ConfigModel' + environment: + $ref: '#/components/schemas/EnvironmentModel' + setting: + $ref: '#/components/schemas/SettingDataModel' + readOnly: + type: boolean + status: + type: string + required: + - config + - environment + - product + - readOnly + - setting + - status + type: object + IntegrationLinkDetailsModel: + example: + allIntegrationLinkCount: 1 + details: + - product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + environment: + product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + color: color + name: name + description: description + order: 0 + reasonRequired: true + readOnly: true + config: + product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + description: description + migratedConfigId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + evaluationVersion: v1 + order: 0 + setting: + createdAt: 2000-01-23T04:56:07.000+00:00 + creatorEmail: creatorEmail + hint: hint + name: name + creatorFullName: creatorFullName + isWatching: true + settingType: boolean + key: key + settingId: 0 + order: 6 + status: status + - product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + environment: + product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + color: color + name: name + description: description + order: 0 + reasonRequired: true + readOnly: true + config: + product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + description: description + migratedConfigId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + evaluationVersion: v1 + order: 0 + setting: + createdAt: 2000-01-23T04:56:07.000+00:00 + creatorEmail: creatorEmail + hint: hint + name: name + creatorFullName: creatorFullName + isWatching: true + settingType: boolean + key: key + settingId: 0 + order: 6 + status: status + properties: + details: + items: + $ref: '#/components/schemas/IntegrationLinkDetail' + nullable: true + readOnly: true + type: array + allIntegrationLinkCount: + format: int32 + type: integer + required: + - allIntegrationLinkCount + - details + type: object + IntegrationLinkModel: + example: + integrationLinkType: trello + description: description + key: key + url: url + properties: + key: + nullable: true + type: string + description: + nullable: true + type: string + integrationLinkType: + $ref: '#/components/schemas/IntegrationLinkType' + url: + nullable: true + type: string + required: + - description + - integrationLinkType + - key + - url + type: object + IntegrationLinkType: + enum: + - trello + - jira + - monday + type: string + IntegrationModel: + description: Details of the Integration. + example: + product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + integrationType: dataDog + environmentIds: + - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + integrationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + configIds: + - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + parameters: + key: parameters + properties: + product: + $ref: '#/components/schemas/ProductModel' + integrationId: + description: Identifier of the Integration. + format: uuid + type: string + name: + description: Name of the Integration. + type: string + integrationType: + $ref: '#/components/schemas/IntegrationType' + parameters: + additionalProperties: + type: string + description: Parameters of the Integration. + nullable: true + type: object + environmentIds: + description: "List of Environment IDs that are connected with this Integration.\ + \ If the list is empty, all of the Environments are connected." + items: + format: uuid + type: string + type: array + configIds: + description: "List of Config IDs that are connected with this Integration.\ + \ If the list is empty, all of the Configs are connected." + items: + format: uuid + type: string + type: array + required: + - configIds + - environmentIds + - integrationId + - integrationType + - name + - parameters + - product + type: object + IntegrationType: + enum: + - dataDog + - slack + - amplitude + - mixPanel + - segment + - pubNub + type: string + IntegrationsModel: + example: + integrations: + - product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + integrationType: dataDog + environmentIds: + - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + integrationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + configIds: + - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + parameters: + key: parameters + - product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + integrationType: dataDog + environmentIds: + - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + integrationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + configIds: + - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + parameters: + key: parameters + properties: + integrations: + description: The Integrations of the Product. + items: + $ref: '#/components/schemas/IntegrationModel' + nullable: true + type: array + required: + - integrations + type: object + InvitationModel: + example: + permissionGroupId: 0 + createdAt: 2000-01-23T04:56:07.000+00:00 + expired: true + invitationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + email: email + properties: + invitationId: + description: The identifier of the Invitation. + format: uuid + type: string + email: + description: The invited user's email address. + nullable: true + type: string + permissionGroupId: + description: The identifier of the Permission Group the user was invited + to. + format: int64 + type: integer + createdAt: + description: Creation time of the Invitation. + format: date-time + type: string + expired: + description: Determines whether the Invitation is expired. + type: boolean + required: + - createdAt + - email + - expired + - invitationId + - permissionGroupId + type: object + InviteMembersRequest: + example: + emails: + - emails + - emails + permissionGroupId: 0 + properties: + emails: + description: List of email addresses to invite. + items: + type: string + type: array + permissionGroupId: + description: Identifier of the Permission Group to where the invited users + should be added. + format: int64 + type: integer + required: + - emails + - permissionGroupId + type: object + JsonPatchOperation: + example: + op: unknown + path: path + from: from + value: "" + properties: + op: + $ref: '#/components/schemas/OperationType' + path: + description: The source path. + minLength: 1 + type: string + from: + description: The target path. + nullable: true + type: string + value: + description: The discrete value. + nullable: true + required: + - op + - path + type: object + KeyGenerationMode: + description: Determines the Feature Flag key generation mode. + enum: + - camelCase + - lowerCase + - upperCase + - pascalCase + - kebabCase + type: string + MeModel: + example: + fullName: fullName + email: email + properties: + email: + readOnly: true + type: string + fullName: + readOnly: true + type: string + required: + - email + - fullName + type: object + MemberModel: + example: + permissionGroupId: 0 + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + fullName: fullName + userId: userId + email: email + properties: + userId: + description: Identifier of the Member. + nullable: true + type: string + productId: + description: Identifier of the Product where the Member has access. + format: uuid + type: string + permissionGroupId: + description: Identifier of the Member's Permission Group. + format: int64 + type: integer + fullName: + description: Name of the Member. + nullable: true + type: string + email: + description: Email of the Member. + nullable: true + type: string + required: + - email + - fullName + - permissionGroupId + - productId + - userId + type: object + ModifyIntegrationRequest: + example: + environmentIds: + - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + configIds: + - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + - 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + parameters: + key: parameters + properties: + name: + description: Name of the Integration. + minLength: 1 + type: string + parameters: + additionalProperties: + nullable: true + type: string + description: Parameters of the Integration. + type: object + environmentIds: + description: "List of Environment IDs that are connected with this Integration.\ + \ If the list is empty, all of the Environments are connected." + items: + format: uuid + type: string + type: array + configIds: + description: "List of Config IDs that are connected with this Integration.\ + \ If the list is empty, all of the Configs are connected." + items: + format: uuid + type: string + type: array + required: + - configIds + - environmentIds + - name + - parameters + type: object + OperationType: + enum: + - unknown + - add + - remove + - replace + - move + - copy + - test + type: string + OrganizationAdminModel: + description: Describes an Organization Admin. + example: + twoFactorEnabled: true + fullName: fullName + userId: userId + email: email + properties: + userId: + description: Identifier of the Organization Admin. + type: string + fullName: + description: Name of the Organization Admin. + type: string + email: + description: Email of the OrganizationAdmin. + type: string + twoFactorEnabled: + description: Determines whether 2FA is enabled for the Organization Admin. + type: boolean + required: + - email + - fullName + - twoFactorEnabled + - userId + type: object + OrganizationInvitationModel: + example: + permissionGroupId: 0 + createdAt: 2000-01-23T04:56:07.000+00:00 + expires: 2000-01-23T04:56:07.000+00:00 + expired: true + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + invitationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + email: email + productName: productName + properties: + invitationId: + description: The identifier of the Invitation. + format: uuid + type: string + email: + description: The invited user's email address. + nullable: true + type: string + productId: + description: The identifier of the Product the user was invited to. + format: uuid + type: string + productName: + description: The name of the Product the user was invited to. + nullable: true + type: string + permissionGroupId: + description: The identifier of the Permission Group the user was invited + to. + format: int64 + type: integer + createdAt: + description: Creation time of the Invitation. + format: date-time + type: string + expired: + description: Determines whether the Invitation is expired. + type: boolean + expires: + description: Expiration time of the Invitation. + format: date-time + type: string + required: + - createdAt + - email + - expired + - expires + - invitationId + - permissionGroupId + - productId + - productName + type: object + OrganizationMemberModel: + description: Describes an Organization Member. + example: + twoFactorEnabled: true + permissions: + - product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + permissionGroup: + permissionGroupId: 0 + name: name + - product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + permissionGroup: + permissionGroupId: 0 + name: name + fullName: fullName + userId: userId + email: email + properties: + userId: + description: Identifier of the Organization Admin. + type: string + fullName: + description: Name of the Organization Admin. + type: string + email: + description: Email of the OrganizationAdmin. + type: string + twoFactorEnabled: + description: Determines whether 2FA is enabled for the Organization Admin. + type: boolean + permissions: + description: The permissions of the Member. + items: + $ref: '#/components/schemas/OrganizationPermissionModel' + type: array + required: + - email + - fullName + - permissions + - twoFactorEnabled + - userId + type: object + OrganizationMembersModel: + example: + billingManagers: + - twoFactorEnabled: true + fullName: fullName + userId: userId + email: email + - twoFactorEnabled: true + fullName: fullName + userId: userId + email: email + members: + - twoFactorEnabled: true + permissions: + - product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + permissionGroup: + permissionGroupId: 0 + name: name + - product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + permissionGroup: + permissionGroupId: 0 + name: name + fullName: fullName + userId: userId + email: email + - twoFactorEnabled: true + permissions: + - product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + permissionGroup: + permissionGroupId: 0 + name: name + - product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + permissionGroup: + permissionGroupId: 0 + name: name + fullName: fullName + userId: userId + email: email + admins: + - twoFactorEnabled: true + fullName: fullName + userId: userId + email: email + - twoFactorEnabled: true + fullName: fullName + userId: userId + email: email + properties: + admins: + description: List of Organization Admins. + items: + $ref: '#/components/schemas/OrganizationAdminModel' + type: array + billingManagers: + description: List of Billing Managers. + items: + $ref: '#/components/schemas/OrganizationAdminModel' + type: array + members: + description: List of Organization Members. + items: + $ref: '#/components/schemas/OrganizationMemberModel' + type: array + required: + - admins + - billingManagers + - members + type: object + OrganizationModel: + description: Details of the Organization. + example: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + properties: + organizationId: + description: Identifier of the Organization. + format: uuid + type: string + name: + description: Name of the Organization. + type: string + required: + - name + - organizationId + type: object + OrganizationPermissionGroupModel: + description: Describes the Member's Permission Group within a Product. + example: + permissionGroupId: 0 + name: name + properties: + permissionGroupId: + description: Identifier of the Member's Permission Group. + format: int64 + type: integer + name: + description: Name of the Member's Permission Group. + type: string + required: + - name + - permissionGroupId + type: object + OrganizationPermissionModel: + description: Describes the Member's permission. + example: + product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + permissionGroup: + permissionGroupId: 0 + name: name + properties: + product: + $ref: '#/components/schemas/OrganizationProductModel' + permissionGroup: + $ref: '#/components/schemas/OrganizationPermissionGroupModel' + required: + - permissionGroup + - product + type: object + OrganizationProductModel: + description: Describes the Member's Product. + example: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + properties: + productId: + description: Identifier of the Member's Product. + format: uuid + type: string + name: + description: Name of the Member's Product. + type: string + required: + - name + - productId + type: object + PercentageOptionModel: + example: + percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + properties: + percentage: + description: A number between 0 and 100 that represents a randomly allocated + fraction of the users. + format: int32 + type: integer + value: + $ref: '#/components/schemas/ValueModel' + required: + - percentage + - value + type: object + PermissionGroupModel: + example: + canViewProductStatistics: true + canDeleteTag: true + environmentAccesses: + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + color: color + environmentAccessType: null + name: name + description: description + order: 6 + reasonRequired: true + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + color: color + environmentAccessType: null + name: name + description: description + order: 6 + reasonRequired: true + canManageProductPreferences: true + canManageIntegrations: true + canDeleteSegments: true + accessType: readOnly + canManageMembers: true + canManageWebhook: true + canUseExportImport: true + canViewSdkKey: true + canDeleteSetting: true + canRotateSdkKey: true + canCreateOrUpdateSegments: true + canCreateOrUpdateSetting: true + permissionGroupId: 0 + product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + canDeleteConfig: true + canDisable2FA: true + canDeleteEnvironment: true + canCreateOrUpdateConfig: true + canTagSetting: true + canCreateOrUpdateEnvironment: true + name: name + canViewProductAuditLog: true + canCreateOrUpdateTag: true + newEnvironmentAccessType: full + properties: + permissionGroupId: + description: Identifier of the Permission Group. + format: int64 + type: integer + name: + description: Name of the Permission Group. + type: string + canManageMembers: + description: Group members can manage team members. + type: boolean + canCreateOrUpdateConfig: + description: Group members can create/update Configs. + type: boolean + canDeleteConfig: + description: Group members can delete Configs. + type: boolean + canCreateOrUpdateEnvironment: + description: Group members can create/update Environments. + type: boolean + canDeleteEnvironment: + description: Group members can delete Environments. + type: boolean + canCreateOrUpdateSetting: + description: Group members can create/update Feature Flags and Settings. + type: boolean + canTagSetting: + description: Group members can attach/detach Tags to Feature Flags and Settings. + type: boolean + canDeleteSetting: + description: Group members can delete Feature Flags and Settings. + type: boolean + canCreateOrUpdateTag: + description: Group members can create/update Tags. + type: boolean + canDeleteTag: + description: Group members can delete Tags. + type: boolean + canManageWebhook: + description: Group members can create/update/delete Webhooks. + type: boolean + canUseExportImport: + description: Group members can use the export/import feature. + type: boolean + canManageProductPreferences: + description: Group members can update Product preferences. + type: boolean + canManageIntegrations: + description: Group members can add and configure integrations. + type: boolean + canViewSdkKey: + description: Group members has access to SDK keys. + type: boolean + canRotateSdkKey: + description: Group members can rotate SDK keys. + type: boolean + canCreateOrUpdateSegments: + description: Group members can create/update Segments. + type: boolean + canDeleteSegments: + description: Group members can delete Segments. + type: boolean + canViewProductAuditLog: + description: Group members has access to audit logs. + type: boolean + canViewProductStatistics: + description: Group members has access to product statistics. + type: boolean + canDisable2FA: + description: Group members can disable two-factor authentication for other + members. + type: boolean + accessType: + $ref: '#/components/schemas/AccessType' + newEnvironmentAccessType: + $ref: '#/components/schemas/EnvironmentAccessType' + environmentAccesses: + description: List of environment specific permissions. + items: + $ref: '#/components/schemas/EnvironmentAccessModel' + type: array + product: + $ref: '#/components/schemas/ProductModel' + required: + - accessType + - canCreateOrUpdateConfig + - canCreateOrUpdateEnvironment + - canCreateOrUpdateSegments + - canCreateOrUpdateSetting + - canCreateOrUpdateTag + - canDeleteConfig + - canDeleteEnvironment + - canDeleteSegments + - canDeleteSetting + - canDeleteTag + - canDisable2FA + - canManageIntegrations + - canManageMembers + - canManageProductPreferences + - canManageWebhook + - canRotateSdkKey + - canTagSetting + - canUseExportImport + - canViewProductAuditLog + - canViewProductStatistics + - canViewSdkKey + - environmentAccesses + - name + - newEnvironmentAccessType + - permissionGroupId + - product + type: object + PreferencesModel: + example: + keyGenerationMode: camelCase + showVariationId: true + mandatorySettingHint: true + reasonRequiredEnvironments: + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + environmentName: environmentName + reasonRequired: true + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + environmentName: environmentName + reasonRequired: true + reasonRequired: true + properties: + reasonRequired: + description: Indicates that a mandatory note required for saving and publishing. + type: boolean + keyGenerationMode: + $ref: '#/components/schemas/KeyGenerationMode' + showVariationId: + description: Indicates whether a variation ID's must be shown on the ConfigCat + Dashboard. + type: boolean + reasonRequiredEnvironments: + description: List of Environments where mandatory note must be set before + saving and publishing. + items: + $ref: '#/components/schemas/ReasonRequiredEnvironmentModel' + nullable: true + type: array + mandatorySettingHint: + description: Indicates whether Feature flags and Settings must have a hint. + type: boolean + required: + - keyGenerationMode + - mandatorySettingHint + - reasonRequired + - reasonRequiredEnvironments + - showVariationId + type: object + PrerequisiteComparator: + description: Prerequisite flag comparison operator used during the evaluation + process. + enum: + - equals + - doesNotEqual + type: string + PrerequisiteFlagConditionModel: + description: Describes a condition that is based on a prerequisite flag. + properties: + prerequisiteSettingId: + description: The prerequisite flag's identifier. + format: int32 + type: integer + comparator: + $ref: '#/components/schemas/PrerequisiteComparator' + prerequisiteComparisonValue: + $ref: '#/components/schemas/ValueModel' + required: + - comparator + - prerequisiteComparisonValue + - prerequisiteSettingId + type: object + ProductModel: + description: Details of the Product. + example: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + properties: + organization: + $ref: '#/components/schemas/OrganizationModel' + productId: + description: Identifier of the Product. + format: uuid + type: string + name: + description: Name of the Product. + type: string + description: + description: Description of the Product. + nullable: true + type: string + order: + description: |- + The order of the Product represented on the ConfigCat Dashboard. + Determined from an ascending sequence of integers. + format: int32 + type: integer + reasonRequired: + description: Determines whether a mandatory reason must be given every time + when the Feature Flags or Settings within a Product are saved. + type: boolean + required: + - description + - name + - order + - organization + - productId + - reasonRequired + type: object + ReasonRequiredEnvironmentModel: + example: + environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + environmentName: environmentName + reasonRequired: true + properties: + environmentId: + description: Identifier of the Environment. + format: uuid + type: string + reasonRequired: + description: Indicates that a mandatory note is required in this Environment + for saving and publishing. + type: boolean + environmentName: + description: Name of the Environment. + nullable: true + type: string + required: + - environmentId + - environmentName + - reasonRequired + type: object + ReferenceLineModel: + description: Determines a code reference line. + example: + lineText: lineText + lineNumber: 0 + properties: + lineText: + description: The content of the reference line. + maxLength: 1000 + minLength: 0 + nullable: true + type: string + lineNumber: + description: The line number. + format: int32 + type: integer + required: + - lineNumber + - lineText + type: object + ReferenceLineRequest: + description: Determines a code reference line. + example: + lineText: lineText + lineNumber: 6 + properties: + lineText: + description: The content of the reference line. + maxLength: 1000 + minLength: 0 + nullable: true + type: string + lineNumber: + description: The line number. + format: int32 + type: integer + required: + - lineNumber + type: object + ReferenceLinesModel: + example: + file: file + referenceLine: + lineText: lineText + lineNumber: 0 + fileUrl: fileUrl + postLines: + - lineText: lineText + lineNumber: 0 + - lineText: lineText + lineNumber: 0 + preLines: + - lineText: lineText + lineNumber: 0 + - lineText: lineText + lineNumber: 0 + properties: + file: + description: The file's name in where the code reference has been found. + (Appears on the ConfigCat Dashboard) + maxLength: 255 + minLength: 1 + type: string + fileUrl: + description: The file's url. (Used to point to the file on the repository's + website) + maxLength: 1000 + minLength: 0 + nullable: true + type: string + preLines: + description: The lines before the actual reference line. + items: + $ref: '#/components/schemas/ReferenceLineModel' + type: array + postLines: + description: The lines after the actual reference line. + items: + $ref: '#/components/schemas/ReferenceLineModel' + type: array + referenceLine: + $ref: '#/components/schemas/ReferenceLineModel' + required: + - file + - fileUrl + - postLines + - preLines + - referenceLine + type: object + ReferenceLinesRequest: + example: + file: file + referenceLine: + lineText: lineText + lineNumber: 6 + fileUrl: fileUrl + postLines: + - lineText: lineText + lineNumber: 6 + - lineText: lineText + lineNumber: 6 + preLines: + - lineText: lineText + lineNumber: 6 + - lineText: lineText + lineNumber: 6 + properties: + file: + description: The file's name in where the code reference has been found. + (Appears on the ConfigCat Dashboard) + maxLength: 255 + minLength: 1 + type: string + fileUrl: + description: The file's url. (Used to point to the file on the repository's + website) + maxLength: 1000 + minLength: 0 + nullable: true + type: string + preLines: + description: The lines before the actual reference line. + items: + $ref: '#/components/schemas/ReferenceLineRequest' + type: array + postLines: + description: The lines after the actual reference line. + items: + $ref: '#/components/schemas/ReferenceLineRequest' + type: array + referenceLine: + $ref: '#/components/schemas/ReferenceLineRequest' + required: + - file + - referenceLine + type: object + ReplaceSettingModel: + example: + hint: hint + name: name + tags: + - 0 + - 0 + order: 6 + properties: + hint: + description: "A short description for the setting, shown on the Dashboard\ + \ UI." + maxLength: 1000 + minLength: 0 + nullable: true + type: string + tags: + description: The IDs of the tags which are attached to the setting. + items: + format: int64 + type: integer + nullable: true + type: array + order: + description: |- + The order of the Setting represented on the ConfigCat Dashboard. + Determined from an ascending sequence of integers. + format: int32 + nullable: true + type: integer + name: + description: The name of the Feature Flag or Setting. + maxLength: 255 + minLength: 1 + nullable: true + type: string + type: object + RolloutPercentageItemModel: + example: + percentage: 1 + value: "" + properties: + percentage: + description: The percentage value for the rule. + format: int64 + type: integer + value: + allOf: + - $ref: '#/components/schemas/SettingValueType' + description: The value to serve when the user falls in the percentage rule. + It must respect the setting type. In some generated clients for strictly + typed languages you may use double/float properties to handle integer + values. + required: + - percentage + - value + type: object + RolloutRuleComparator: + description: The comparison operator the evaluation process must use when it + compares the given user attribute's value with the comparison value. + enum: + - isOneOf + - isNotOneOf + - contains + - doesNotContain + - semVerIsOneOf + - semVerIsNotOneOf + - semVerLess + - semVerLessOrEquals + - semVerGreater + - semVerGreaterOrEquals + - numberEquals + - numberDoesNotEqual + - numberLess + - numberLessOrEquals + - numberGreater + - numberGreaterOrEquals + - sensitiveIsOneOf + - sensitiveIsNotOneOf + type: string + RolloutRuleModel: + example: + comparator: "" + comparisonValue: comparisonValue + segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + segmentComparator: "" + value: "" + comparisonAttribute: comparisonAttribute + properties: + comparisonAttribute: + description: The user attribute to compare. + maxLength: 1000 + minLength: 0 + nullable: true + type: string + comparator: + allOf: + - $ref: '#/components/schemas/RolloutRuleComparator' + nullable: true + comparisonValue: + description: The value to compare against. + nullable: true + type: string + value: + allOf: + - $ref: '#/components/schemas/SettingValueType' + description: The value to serve when the comparison matches. It must respect + the setting type. In some generated clients for strictly typed languages + you may use double/float properties to handle integer values. + segmentComparator: + allOf: + - $ref: '#/components/schemas/SegmentComparator' + nullable: true + segmentId: + description: The segment to compare against. + format: uuid + nullable: true + type: string + required: + - comparator + - comparisonAttribute + - comparisonValue + - segmentComparator + - segmentId + - value + type: object + SdkKeysModel: + example: + secondary: secondary + primary: primary + properties: + primary: + description: The primary SDK key. + type: string + secondary: + description: The secondary SDK key. + nullable: true + type: string + required: + - primary + - secondary + type: object + SegmentComparator: + description: The segment comparison operator used during the evaluation process. + enum: + - isIn + - isNotIn + type: string + SegmentConditionModel: + description: Describes a condition that is based on a segment. + properties: + segmentId: + description: The segment's identifier. + format: uuid + type: string + comparator: + $ref: '#/components/schemas/SegmentComparator' + required: + - comparator + - segmentId + type: object + SegmentListModel: + example: + createdAt: 2000-01-23T04:56:07.000+00:00 + product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + lastUpdaterEmail: lastUpdaterEmail + creatorEmail: creatorEmail + segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + usage: 0 + name: name + description: description + creatorFullName: creatorFullName + lastUpdaterFullName: lastUpdaterFullName + updatedAt: 2000-01-23T04:56:07.000+00:00 + properties: + product: + $ref: '#/components/schemas/ProductModel' + segmentId: + description: Identifier of the Segment. + format: uuid + type: string + name: + description: Name of the Segment. + type: string + description: + description: Description of the Segment. + nullable: true + type: string + creatorEmail: + description: The email of the user who created the Segment. + nullable: true + type: string + creatorFullName: + description: The name of the user who created the Segment. + nullable: true + type: string + createdAt: + description: The date and time when the Segment was created. + format: date-time + type: string + lastUpdaterEmail: + description: The email of the user who last updated the Segment. + nullable: true + type: string + lastUpdaterFullName: + description: The name of the user who last updated the Segment. + nullable: true + type: string + updatedAt: + description: The date and time when the Segment was last updated. + format: date-time + type: string + usage: + description: Determines how many Feature Flags and Settings are using the + Segment. + format: int32 + type: integer + required: + - createdAt + - creatorEmail + - creatorFullName + - description + - lastUpdaterEmail + - lastUpdaterFullName + - name + - product + - segmentId + - updatedAt + - usage + type: object + SegmentModel: + example: + product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + comparisonValue: comparisonValue + creatorEmail: creatorEmail + description: description + createdAt: 2000-01-23T04:56:07.000+00:00 + comparator: isOneOf + lastUpdaterEmail: lastUpdaterEmail + segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + creatorFullName: creatorFullName + lastUpdaterFullName: lastUpdaterFullName + comparisonAttribute: comparisonAttribute + updatedAt: 2000-01-23T04:56:07.000+00:00 + properties: + product: + $ref: '#/components/schemas/ProductModel' + segmentId: + description: Identifier of the Segment. + format: uuid + type: string + name: + description: Name of the Segment. + type: string + description: + description: Description of the Segment. + nullable: true + type: string + creatorEmail: + description: The email of the user who created the Segment. + nullable: true + type: string + creatorFullName: + description: The name of the user who created the Segment. + nullable: true + type: string + createdAt: + description: The date and time when the Segment was created. + format: date-time + type: string + lastUpdaterEmail: + description: The email of the user who last updated the Segment. + nullable: true + type: string + lastUpdaterFullName: + description: The name of the user who last updated the Segment. + nullable: true + type: string + updatedAt: + description: The date and time when the Segment was last updated. + format: date-time + type: string + comparisonAttribute: + description: The user's attribute the evaluation process must take into + account. + type: string + comparator: + $ref: '#/components/schemas/RolloutRuleComparator' + comparisonValue: + description: The value to compare with the given user attribute's value. + type: string + required: + - comparator + - comparisonAttribute + - comparisonValue + - createdAt + - creatorEmail + - creatorFullName + - description + - lastUpdaterEmail + - lastUpdaterFullName + - name + - product + - segmentId + - updatedAt + type: object + SettingDataModel: + description: Metadata of a Feature Flag or Setting. + example: + createdAt: 2000-01-23T04:56:07.000+00:00 + creatorEmail: creatorEmail + hint: hint + name: name + creatorFullName: creatorFullName + isWatching: true + settingType: boolean + key: key + settingId: 0 + order: 6 + properties: + settingId: + description: Identifier of the Feature Flag or Setting. + format: int32 + type: integer + key: + description: Key of the Feature Flag or Setting. + type: string + name: + description: Name of the Feature Flag or Setting. + type: string + hint: + description: Description of the Feature Flag or Setting. + nullable: true + type: string + settingType: + $ref: '#/components/schemas/SettingType' + order: + description: The order of the Feature Flag or Setting represented on the + ConfigCat Dashboard. + format: int32 + type: integer + createdAt: + description: The creation time of the Feature Flag or Setting. + format: date-time + nullable: true + type: string + creatorEmail: + description: The user's email address who created the Feature Flag or Setting. + nullable: true + type: string + creatorFullName: + description: The user's name who created the Feature Flag or Setting. + nullable: true + type: string + isWatching: + type: boolean + required: + - createdAt + - creatorEmail + - creatorFullName + - hint + - isWatching + - key + - name + - order + - settingId + - settingType + type: object + SettingFormulaModel: + example: + targetingRules: + - percentageOptions: + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + conditions: + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" + - percentageOptions: + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + conditions: + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" + percentageEvaluationAttribute: percentageEvaluationAttribute + defaultValue: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + lastUpdaterUserEmail: lastUpdaterUserEmail + readOnly: true + setting: + createdAt: 2000-01-23T04:56:07.000+00:00 + creatorEmail: creatorEmail + hint: hint + name: name + creatorFullName: creatorFullName + isWatching: true + settingType: boolean + key: key + settingId: 0 + order: 6 + lastVersionId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + environment: + product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + color: color + name: name + description: description + order: 0 + reasonRequired: true + featureFlagLimitations: + maxComparisonValueListItemLength: 9 + maxComparisonValueListLength: 7 + maxPercentageOptionCount: 5 + maxConditionPerTargetingRuleCount: 2 + maxComparisonValueLength: 2 + maxStringFlagValueLength: 3 + maxTargetingRuleCount: 5 + settingIdsWherePrerequisite: + - 5 + - 5 + integrationLinks: + - integrationLinkType: trello + description: description + key: key + url: url + - integrationLinkType: trello + description: description + key: key + url: url + config: + product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + description: description + migratedConfigId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + evaluationVersion: v1 + order: 0 + settingTags: + - color: color + tagId: 6 + name: name + settingTagId: 0 + - color: color + tagId: 6 + name: name + settingTagId: 0 + updatedAt: 2000-01-23T04:56:07.000+00:00 + lastUpdaterUserFullName: lastUpdaterUserFullName + properties: + lastVersionId: + format: uuid + type: string + defaultValue: + $ref: '#/components/schemas/ValueModel' + targetingRules: + description: The targeting rules of the Feature Flag or Setting. + items: + $ref: '#/components/schemas/TargetingRuleModel' + type: array + setting: + $ref: '#/components/schemas/SettingDataModel' + updatedAt: + description: The last updated date and time when the Feature Flag or Setting. + format: date-time + nullable: true + type: string + percentageEvaluationAttribute: + description: "The user attribute used for percentage evaluation. If not\ + \ set, it defaults to the `Identifier` user object attribute." + nullable: true + type: string + lastUpdaterUserEmail: + description: The email of the user who last updated the Feature Flag or + Setting. + nullable: true + type: string + lastUpdaterUserFullName: + description: The name of the user who last updated the Feature Flag or Setting. + nullable: true + type: string + integrationLinks: + description: The integration links attached to the Feature Flag or Setting. + items: + $ref: '#/components/schemas/IntegrationLinkModel' + type: array + settingTags: + description: The tags attached to the Feature Flag or Setting. + items: + $ref: '#/components/schemas/SettingTagModel' + type: array + settingIdsWherePrerequisite: + description: List of Feature Flag and Setting IDs where the actual Feature + Flag or Setting is prerequisite. + items: + format: int32 + type: integer + type: array + config: + $ref: '#/components/schemas/ConfigModel' + environment: + $ref: '#/components/schemas/EnvironmentModel' + readOnly: + type: boolean + featureFlagLimitations: + $ref: '#/components/schemas/FeatureFlagLimitations' + required: + - config + - defaultValue + - environment + - featureFlagLimitations + - integrationLinks + - lastUpdaterUserEmail + - lastUpdaterUserFullName + - lastVersionId + - percentageEvaluationAttribute + - readOnly + - setting + - settingIdsWherePrerequisite + - settingTags + - targetingRules + - updatedAt + type: object + SettingModel: + description: Metadata of a Feature Flag or Setting. + example: + configName: configName + createdAt: 2000-01-23T04:56:07.000+00:00 + configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + hint: hint + name: name + settingType: boolean + key: key + settingId: 0 + order: 6 + tags: + - product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + color: color + tagId: 0 + name: name + - product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + color: color + tagId: 0 + name: name + properties: + settingId: + description: Identifier of the Feature Flag or Setting. + format: int32 + type: integer + key: + description: Key of the Feature Flag or Setting. + type: string + name: + description: Name of the Feature Flag or Setting. + type: string + hint: + description: Description of the Feature Flag or Setting. + nullable: true + type: string + order: + description: The order of the Feature Flag or Setting represented on the + ConfigCat Dashboard. + format: int32 + type: integer + settingType: + $ref: '#/components/schemas/SettingType' + configId: + description: Identifier of the Feature Flag's Config. + format: uuid + type: string + configName: + description: Name of the Feature Flag's Config. + type: string + createdAt: + description: The creation time of the Feature Flag or Setting. + format: date-time + nullable: true + type: string + tags: + description: The tags attached to the Feature Flag or Setting. + items: + $ref: '#/components/schemas/TagModel' + type: array + required: + - configId + - configName + - createdAt + - hint + - key + - name + - order + - settingId + - settingType + - tags + type: object + SettingTagModel: + example: + color: color + tagId: 6 + name: name + settingTagId: 0 + properties: + settingTagId: + format: int64 + type: integer + tagId: + format: int64 + type: integer + name: + type: string + color: + nullable: true + type: string + required: + - color + - name + - settingTagId + - tagId + type: object + SettingType: + description: The type of the Feature Flag or Setting. + enum: + - boolean + - string + - int + - double + type: string + SettingValueModel: + example: + rolloutRules: + - comparator: "" + comparisonValue: comparisonValue + segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + segmentComparator: "" + value: "" + comparisonAttribute: comparisonAttribute + - comparator: "" + comparisonValue: comparisonValue + segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + segmentComparator: "" + value: "" + comparisonAttribute: comparisonAttribute + rolloutPercentageItems: + - percentage: 1 + value: "" + - percentage: 1 + value: "" + lastUpdaterUserEmail: lastUpdaterUserEmail + readOnly: true + setting: + createdAt: 2000-01-23T04:56:07.000+00:00 + creatorEmail: creatorEmail + hint: hint + name: name + creatorFullName: creatorFullName + isWatching: true + settingType: boolean + key: key + settingId: 0 + order: 6 + environment: + product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + color: color + name: name + description: description + order: 0 + reasonRequired: true + featureFlagLimitations: + maxComparisonValueListItemLength: 9 + maxComparisonValueListLength: 7 + maxPercentageOptionCount: 5 + maxConditionPerTargetingRuleCount: 2 + maxComparisonValueLength: 2 + maxStringFlagValueLength: 3 + maxTargetingRuleCount: 5 + integrationLinks: + - integrationLinkType: trello + description: description + key: key + url: url + - integrationLinkType: trello + description: description + key: key + url: url + value: "" + config: + product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + description: description + migratedConfigId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + evaluationVersion: v1 + order: 0 + settingTags: + - color: color + tagId: 6 + name: name + settingTagId: 0 + - color: color + tagId: 6 + name: name + settingTagId: 0 + updatedAt: 2000-01-23T04:56:07.000+00:00 + lastUpdaterUserFullName: lastUpdaterUserFullName + properties: + setting: + $ref: '#/components/schemas/SettingDataModel' + updatedAt: + description: The last updated date and time when the Feature Flag or Setting. + format: date-time + nullable: true + type: string + lastUpdaterUserEmail: + description: The email of the user who last updated the Feature Flag or + Setting. + nullable: true + type: string + lastUpdaterUserFullName: + description: The name of the user who last updated the Feature Flag or Setting. + nullable: true + type: string + integrationLinks: + description: The integration links attached to the Feature Flag or Setting. + items: + $ref: '#/components/schemas/IntegrationLinkModel' + type: array + settingTags: + description: The tags attached to the Feature Flag or Setting. + items: + $ref: '#/components/schemas/SettingTagModel' + type: array + rolloutRules: + description: The targeting rule collection. + items: + $ref: '#/components/schemas/RolloutRuleModel' + type: array + rolloutPercentageItems: + description: The percentage rule collection. + items: + $ref: '#/components/schemas/RolloutPercentageItemModel' + type: array + value: + allOf: + - $ref: '#/components/schemas/SettingValueType' + description: The value to serve. It must respect the setting type. In some + generated clients for strictly typed languages you may use double/float + properties to handle integer values. + config: + $ref: '#/components/schemas/ConfigModel' + environment: + $ref: '#/components/schemas/EnvironmentModel' + featureFlagLimitations: + $ref: '#/components/schemas/FeatureFlagLimitations' + readOnly: + type: boolean + required: + - config + - environment + - featureFlagLimitations + - integrationLinks + - lastUpdaterUserEmail + - lastUpdaterUserFullName + - readOnly + - rolloutPercentageItems + - rolloutRules + - setting + - settingTags + - updatedAt + - value + type: object + SettingValueType: + oneOf: + - type: boolean + - type: string + - format: double + type: number + StaleFlagConfigModel: + example: + settings: + - hint: hint + name: name + settingValues: + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + key: key + hasCodeReferences: true + settingId: 0 + tags: + - tagId: 6 + settingTagId: 1 + - tagId: 6 + settingTagId: 1 + - hint: hint + name: name + settingValues: + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + key: key + hasCodeReferences: true + settingId: 0 + tags: + - tagId: 6 + settingTagId: 1 + - tagId: 6 + settingTagId: 1 + configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + evaluationVersion: v1 + hasCodeReferences: true + properties: + configId: + description: Identifier of the Config. + format: uuid + type: string + name: + description: Name of the Config. + type: string + evaluationVersion: + $ref: '#/components/schemas/EvaluationVersion' + hasCodeReferences: + description: Config has code references uploaded. + type: boolean + settings: + description: Stale feature flags. + items: + $ref: '#/components/schemas/StaleFlagSettingModel' + type: array + required: + - configId + - evaluationVersion + - hasCodeReferences + - name + - settings + type: object + StaleFlagEnvironmentModel: + example: + environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + properties: + environmentId: + description: Identifier of the Environment. + format: uuid + type: string + name: + description: Name of the Environment. + type: string + required: + - environmentId + - name + type: object + StaleFlagProductModel: + example: + configs: + - settings: + - hint: hint + name: name + settingValues: + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + key: key + hasCodeReferences: true + settingId: 0 + tags: + - tagId: 6 + settingTagId: 1 + - tagId: 6 + settingTagId: 1 + - hint: hint + name: name + settingValues: + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + key: key + hasCodeReferences: true + settingId: 0 + tags: + - tagId: 6 + settingTagId: 1 + - tagId: 6 + settingTagId: 1 + configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + evaluationVersion: v1 + hasCodeReferences: true + - settings: + - hint: hint + name: name + settingValues: + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + key: key + hasCodeReferences: true + settingId: 0 + tags: + - tagId: 6 + settingTagId: 1 + - tagId: 6 + settingTagId: 1 + - hint: hint + name: name + settingValues: + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + key: key + hasCodeReferences: true + settingId: 0 + tags: + - tagId: 6 + settingTagId: 1 + - tagId: 6 + settingTagId: 1 + configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + evaluationVersion: v1 + hasCodeReferences: true + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + environments: + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + properties: + productId: + description: Identifier of the Product. + format: uuid + type: string + name: + description: Name of the Product. + type: string + configs: + description: Configs that contain stale feature flags. + items: + $ref: '#/components/schemas/StaleFlagConfigModel' + type: array + environments: + description: Environment list. + items: + $ref: '#/components/schemas/StaleFlagEnvironmentModel' + type: array + required: + - configs + - environments + - name + - productId + type: object + StaleFlagReminderScope: + enum: + - all + - watchedByMe + type: string + StaleFlagSettingModel: + example: + hint: hint + name: name + settingValues: + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + key: key + hasCodeReferences: true + settingId: 0 + tags: + - tagId: 6 + settingTagId: 1 + - tagId: 6 + settingTagId: 1 + properties: + settingId: + description: Identifier of the Feature Flag or Setting. + format: int32 + type: integer + name: + description: Name of the Feature Flag or Setting. + type: string + key: + description: Key of the Feature Flag or Setting. + type: string + hint: + description: Description of the Feature Flag or Setting. + nullable: true + type: string + hasCodeReferences: + description: Feature Flag or Setting has code references uploaded. + type: boolean + tags: + description: The tags' identifiers attached to the Feature Flag or Setting. + items: + $ref: '#/components/schemas/StaleFlagSettingTagModel' + type: array + settingValues: + description: Environment level feature flag stale data. + items: + $ref: '#/components/schemas/StaleFlagSettingValueModel' + type: array + required: + - hasCodeReferences + - hint + - key + - name + - settingId + - settingValues + - tags + type: object + StaleFlagSettingTagModel: + example: + tagId: 6 + settingTagId: 1 + properties: + tagId: + format: int64 + type: integer + settingTagId: + format: int64 + type: integer + required: + - settingTagId + - tagId + type: object + StaleFlagSettingValueModel: + example: + environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + isStale: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + properties: + environmentId: + description: Identifier of the Environment. + format: uuid + type: string + updatedAt: + description: The last updated date and time when the Feature Flag or Setting. + format: date-time + nullable: true + type: string + isStale: + description: Is the feature flag considered stale in the environment. + type: boolean + required: + - environmentId + - isStale + - updatedAt + type: object + StaleFlagStaleInEnvironmentsType: + enum: + - staleInAnyEnvironments + - staleInAllEnvironments + type: string + TagModel: + example: + product: + productId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + organization: + organizationId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + name: name + description: description + order: 0 + reasonRequired: true + color: color + tagId: 0 + name: name + properties: + product: + $ref: '#/components/schemas/ProductModel' + tagId: + description: Identifier of the Tag. + format: int64 + type: integer + name: + description: Name of the Tag. + type: string + color: + description: The configured color of the Tag. + nullable: true + type: string + required: + - color + - name + - product + - tagId + type: object + TargetingRuleModel: + example: + percentageOptions: + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + conditions: + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" + properties: + conditions: + description: |- + The list of conditions that are combined with logical AND operators. + It can be one of the following: + - User condition + - Segment condition + - Prerequisite flag condition + items: + $ref: '#/components/schemas/ConditionModel' + type: array + percentageOptions: + description: The percentage options from where the evaluation process will + choose a value based on the flag's percentage evaluation attribute. + items: + $ref: '#/components/schemas/PercentageOptionModel' + type: array + value: + allOf: + - $ref: '#/components/schemas/ValueModel' + nullable: true + required: + - conditions + - percentageOptions + - value + type: object + UpdateComparisonValueListModel: + properties: + value: + description: The actual comparison value. + type: string + hint: + description: An optional hint for the comparison value. + maxLength: 1500 + minLength: 0 + nullable: true + type: string + required: + - value + type: object + UpdateComparisonValueModel: + description: The value that the user object's attribute is compared to. + properties: + stringValue: + description: The string representation of the comparison value. + nullable: true + type: string + doubleValue: + description: The number representation of the comparison value. + format: double + nullable: true + type: number + listValue: + description: The list representation of the comparison value. + items: + $ref: '#/components/schemas/UpdateComparisonValueListModel' + nullable: true + type: array + type: object + UpdateConditionModel: + example: + segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + properties: + userCondition: + allOf: + - $ref: '#/components/schemas/UpdateUserConditionModel' + nullable: true + segmentCondition: + allOf: + - $ref: '#/components/schemas/UpdateSegmentConditionModel' + nullable: true + prerequisiteFlagCondition: + allOf: + - $ref: '#/components/schemas/UpdatePrerequisiteFlagConditionModel' + nullable: true + type: object + UpdateConfigRequest: + example: + name: name + description: description + order: 0 + properties: + name: + description: The name of the Config. + maxLength: 255 + minLength: 0 + nullable: true + type: string + description: + description: The description of the Config. + maxLength: 1000 + minLength: 0 + nullable: true + type: string + order: + description: |- + The order of the Config represented on the ConfigCat Dashboard. + Determined from an ascending sequence of integers. + format: int32 + nullable: true + type: integer + type: object + UpdateEnvironmentModel: + example: + color: color + name: name + description: description + order: 0 + properties: + name: + description: The name of the Environment. + maxLength: 255 + minLength: 0 + nullable: true + type: string + color: + description: The color of the Environment. RGB or HTML color codes are allowed. + maxLength: 255 + minLength: 0 + nullable: true + type: string + description: + description: The description of the Environment. + maxLength: 1000 + minLength: 0 + nullable: true + type: string + order: + description: |- + The order of the Environment represented on the ConfigCat Dashboard. + Determined from an ascending sequence of integers. + format: int32 + nullable: true + type: integer + type: object + UpdateEvaluationFormulaModel: + example: + targetingRules: + - percentageOptions: + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + conditions: + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" + - percentageOptions: + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + conditions: + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" + percentageEvaluationAttribute: percentageEvaluationAttribute + defaultValue: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + properties: + defaultValue: + $ref: '#/components/schemas/UpdateValueModel' + targetingRules: + description: The targeting rules of the Feature Flag or Setting. + items: + $ref: '#/components/schemas/UpdateTargetingRuleModel' + nullable: true + type: array + percentageEvaluationAttribute: + description: "The user attribute used for percentage evaluation. If not\ + \ set, it defaults to the `Identifier` user object attribute." + maxLength: 1000 + nullable: true + type: string + required: + - defaultValue + type: object + UpdateEvaluationFormulaWithIdModel: + example: + targetingRules: + - percentageOptions: + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + conditions: + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" + - percentageOptions: + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + conditions: + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" + percentageEvaluationAttribute: percentageEvaluationAttribute + defaultValue: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + settingId: 0 + properties: + defaultValue: + $ref: '#/components/schemas/UpdateValueModel' + targetingRules: + description: The targeting rules of the Feature Flag or Setting. + items: + $ref: '#/components/schemas/UpdateTargetingRuleModel' + nullable: true + type: array + percentageEvaluationAttribute: + description: "The user attribute used for percentage evaluation. If not\ + \ set, it defaults to the `Identifier` user object attribute." + maxLength: 1000 + nullable: true + type: string + settingId: + description: The identifier of the feature flag or setting. + format: int32 + type: integer + required: + - defaultValue + type: object + UpdateEvaluationFormulasModel: + example: + updateFormulas: + - targetingRules: + - percentageOptions: + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + conditions: + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" + - percentageOptions: + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + conditions: + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" + percentageEvaluationAttribute: percentageEvaluationAttribute + defaultValue: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + settingId: 0 + - targetingRules: + - percentageOptions: + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + conditions: + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" + - percentageOptions: + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + conditions: + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" + percentageEvaluationAttribute: percentageEvaluationAttribute + defaultValue: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + settingId: 0 + properties: + updateFormulas: + description: Evaluation descriptors of each updated Feature Flag and Setting. + items: + $ref: '#/components/schemas/UpdateEvaluationFormulaWithIdModel' + type: array + type: object + UpdateMemberPermissionsRequest: + example: + removeFromPermissionGroupsWhereIdNotSet: true + isBillingManager: true + permissionGroupIds: + - 0 + - 0 + isAdmin: true + properties: + permissionGroupIds: + description: List of Permission Group identifiers to where the Member should + be added. + items: + format: int64 + type: integer + nullable: true + type: array + isAdmin: + description: Indicates that the member must be Organization Admin. + nullable: true + type: boolean + isBillingManager: + description: Indicates that the member must be Billing Manager. + nullable: true + type: boolean + removeFromPermissionGroupsWhereIdNotSet: + description: "When `true`, the member will be removed from those Permission\ + \ Groups that are not listed in the `permissionGroupIds` field." + type: boolean + type: object + UpdatePercentageOptionModel: + example: + percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + properties: + percentage: + description: A number between 0 and 100 that represents a randomly allocated + fraction of the users. + format: int32 + type: integer + value: + $ref: '#/components/schemas/UpdateValueModel' + required: + - percentage + - value + type: object + UpdatePermissionGroupRequest: + example: + canViewProductStatistics: true + canDeleteTag: true + environmentAccesses: + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + environmentAccessType: null + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + environmentAccessType: null + canManageProductPreferences: true + canManageIntegrations: true + canDeleteSegments: true + accessType: "" + canManageMembers: true + canManageWebhook: true + canUseExportImport: true + canViewSdkKey: true + canDeleteSetting: true + canRotateSdkKey: true + canCreateOrUpdateSegments: true + canCreateOrUpdateSetting: true + canDeleteConfig: true + canDisable2FA: true + canDeleteEnvironment: true + canCreateOrUpdateConfig: true + canTagSetting: true + canCreateOrUpdateEnvironment: true + name: name + canViewProductAuditLog: true + canCreateOrUpdateTag: true + newEnvironmentAccessType: "" + properties: + name: + description: Name of the Permission Group. + maxLength: 255 + minLength: 0 + nullable: true + type: string + canManageMembers: + description: Group members can manage team members. + nullable: true + type: boolean + canCreateOrUpdateConfig: + description: Group members can create/update Configs. + nullable: true + type: boolean + canDeleteConfig: + description: Group members can delete Configs. + nullable: true + type: boolean + canCreateOrUpdateEnvironment: + description: Group members can create/update Environments. + nullable: true + type: boolean + canDeleteEnvironment: + description: Group members can delete Environments. + nullable: true + type: boolean + canCreateOrUpdateSetting: + description: Group members can create/update Feature Flags and Settings. + nullable: true + type: boolean + canTagSetting: + description: Group members can attach/detach Tags to Feature Flags and Settings. + nullable: true + type: boolean + canDeleteSetting: + description: Group members can delete Feature Flags and Settings. + nullable: true + type: boolean + canCreateOrUpdateTag: + description: Group members can create/update Tags. + nullable: true + type: boolean + canDeleteTag: + description: Group members can delete Tags. + nullable: true + type: boolean + canManageWebhook: + description: Group members can create/update/delete Webhooks. + nullable: true + type: boolean + canUseExportImport: + description: Group members can use the export/import feature. + nullable: true + type: boolean + canManageProductPreferences: + description: Group members can update Product preferences. + nullable: true + type: boolean + canManageIntegrations: + description: Group members can add and configure integrations. + nullable: true + type: boolean + canViewSdkKey: + description: Group members has access to SDK keys. + nullable: true + type: boolean + canRotateSdkKey: + description: Group members can rotate SDK keys. + nullable: true + type: boolean + canCreateOrUpdateSegments: + description: Group members can create/update Segments. + nullable: true + type: boolean + canDeleteSegments: + description: Group members can delete Segments. + nullable: true + type: boolean + canViewProductAuditLog: + description: Group members has access to audit logs. + nullable: true + type: boolean + canViewProductStatistics: + description: Group members has access to product statistics. + nullable: true + type: boolean + canDisable2FA: + description: Group members can disable two-factor authentication for other + members. + nullable: true + type: boolean + accessType: + allOf: + - $ref: '#/components/schemas/AccessType' + nullable: true + newEnvironmentAccessType: + allOf: + - $ref: '#/components/schemas/EnvironmentAccessType' + nullable: true + environmentAccesses: + description: List of environment specific permissions. + items: + $ref: '#/components/schemas/CreateOrUpdateEnvironmentAccessModel' + nullable: true + type: array + type: object + UpdatePreferencesRequest: + example: + keyGenerationMode: "" + showVariationId: true + mandatorySettingHint: true + reasonRequiredEnvironments: + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + reasonRequired: true + - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + reasonRequired: true + reasonRequired: true + properties: + reasonRequired: + description: Indicates that a mandatory note is required for saving and + publishing. + nullable: true + type: boolean + keyGenerationMode: + allOf: + - $ref: '#/components/schemas/KeyGenerationMode' + nullable: true + showVariationId: + description: Indicates whether a variation ID's must be shown on the ConfigCat + Dashboard. + nullable: true + type: boolean + mandatorySettingHint: + description: Indicates whether Feature flags and Settings must have a hint. + nullable: true + type: boolean + reasonRequiredEnvironments: + description: List of Environments where mandatory note must be set before + saving and publishing. + items: + $ref: '#/components/schemas/UpdateReasonRequiredEnvironmentModel' + nullable: true + type: array + type: object + UpdatePrerequisiteFlagConditionModel: + description: Describes a condition that is based on a prerequisite flag. + properties: + prerequisiteSettingId: + description: The prerequisite flag's identifier. + format: int32 + type: integer + comparator: + $ref: '#/components/schemas/PrerequisiteComparator' + prerequisiteComparisonValue: + $ref: '#/components/schemas/UpdateValueModel' + required: + - comparator + - prerequisiteComparisonValue + - prerequisiteSettingId + type: object + UpdateProductRequest: + example: + name: name + description: description + order: 0 + properties: + name: + description: The name of the Product. + maxLength: 1000 + minLength: 0 + nullable: true + type: string + description: + description: The description of the Product. + maxLength: 1000 + minLength: 0 + nullable: true + type: string + order: + description: |- + The order of the Product represented on the ConfigCat Dashboard. + Determined from an ascending sequence of integers. + format: int32 + nullable: true + type: integer + type: object + UpdateReasonRequiredEnvironmentModel: + example: + environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + reasonRequired: true + properties: + environmentId: + description: Identifier of the Environment. + format: uuid + type: string + reasonRequired: + description: Indicates that a mandatory note is required in this Environment + for saving and publishing. + type: boolean + type: object + UpdateRolloutPercentageItemModel: + example: + percentage: 0 + value: "" + properties: + percentage: + description: The percentage value for the rule. + format: int64 + type: integer + value: + allOf: + - $ref: '#/components/schemas/SettingValueType' + description: The value to serve when the user falls in the percentage rule. + It must respect the setting type. In some generated clients for strictly + typed languages you may use double/float properties to handle integer + values. + required: + - percentage + - value + type: object + UpdateRolloutRuleModel: + example: + comparator: "" + comparisonValue: comparisonValue + segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + segmentComparator: "" + value: "" + comparisonAttribute: comparisonAttribute + properties: + comparisonAttribute: + description: The user attribute to compare. + maxLength: 1000 + minLength: 0 + nullable: true + type: string + comparator: + allOf: + - $ref: '#/components/schemas/RolloutRuleComparator' + nullable: true + comparisonValue: + description: The value to compare against. + nullable: true + type: string + value: + allOf: + - $ref: '#/components/schemas/SettingValueType' + description: The value to serve when the comparison matches. It must respect + the setting type. In some generated clients for strictly typed languages + you may use double/float properties to handle integer values. + segmentComparator: + allOf: + - $ref: '#/components/schemas/SegmentComparator' + nullable: true + segmentId: + description: The segment to compare against. + format: uuid + nullable: true + type: string + required: + - value + type: object + UpdateSegmentConditionModel: + description: Describes a condition that is based on a segment. + properties: + segmentId: + description: The segment's identifier. + format: uuid + type: string + comparator: + $ref: '#/components/schemas/SegmentComparator' + required: + - comparator + - segmentId + type: object + UpdateSegmentModel: + example: + comparator: "" + comparisonValue: comparisonValue + name: name + description: description + comparisonAttribute: comparisonAttribute + properties: + name: + maxLength: 255 + minLength: 0 + nullable: true + type: string + description: + maxLength: 1000 + minLength: 0 + nullable: true + type: string + comparisonAttribute: + maxLength: 1000 + minLength: 0 + nullable: true + type: string + comparator: + allOf: + - $ref: '#/components/schemas/RolloutRuleComparator' + nullable: true + comparisonValue: + nullable: true + type: string + type: object + UpdateSettingValueModel: + example: + rolloutRules: + - comparator: "" + comparisonValue: comparisonValue + segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + segmentComparator: "" + value: "" + comparisonAttribute: comparisonAttribute + - comparator: "" + comparisonValue: comparisonValue + segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + segmentComparator: "" + value: "" + comparisonAttribute: comparisonAttribute + rolloutPercentageItems: + - percentage: 0 + value: "" + - percentage: 0 + value: "" + value: "" + properties: + rolloutRules: + description: The targeting rule collection. + items: + $ref: '#/components/schemas/UpdateRolloutRuleModel' + type: array + rolloutPercentageItems: + description: The percentage rule collection. + items: + $ref: '#/components/schemas/UpdateRolloutPercentageItemModel' + type: array + value: + allOf: + - $ref: '#/components/schemas/SettingValueType' + description: The value to serve. It must respect the setting type. In some + generated clients for strictly typed languages you may use double/float + properties to handle integer values. + required: + - value + type: object + UpdateSettingValueWithSettingIdModel: + example: + rolloutRules: + - comparator: "" + comparisonValue: comparisonValue + segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + segmentComparator: "" + value: "" + comparisonAttribute: comparisonAttribute + - comparator: "" + comparisonValue: comparisonValue + segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + segmentComparator: "" + value: "" + comparisonAttribute: comparisonAttribute + rolloutPercentageItems: + - percentage: 0 + value: "" + - percentage: 0 + value: "" + value: "" + settingId: 0 + properties: + rolloutRules: + description: The targeting rule collection. + items: + $ref: '#/components/schemas/UpdateRolloutRuleModel' + type: array + rolloutPercentageItems: + description: The percentage rule collection. + items: + $ref: '#/components/schemas/UpdateRolloutPercentageItemModel' + type: array + value: + allOf: + - $ref: '#/components/schemas/SettingValueType' + description: The value to serve. It must respect the setting type. In some + generated clients for strictly typed languages you may use double/float + properties to handle integer values. + settingId: + description: The id of the Setting. + format: int32 + type: integer + required: + - value + type: object + UpdateSettingValuesWithIdModel: + example: + settingValues: + - rolloutRules: + - comparator: "" + comparisonValue: comparisonValue + segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + segmentComparator: "" + value: "" + comparisonAttribute: comparisonAttribute + - comparator: "" + comparisonValue: comparisonValue + segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + segmentComparator: "" + value: "" + comparisonAttribute: comparisonAttribute + rolloutPercentageItems: + - percentage: 0 + value: "" + - percentage: 0 + value: "" + value: "" + settingId: 0 + - rolloutRules: + - comparator: "" + comparisonValue: comparisonValue + segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + segmentComparator: "" + value: "" + comparisonAttribute: comparisonAttribute + - comparator: "" + comparisonValue: comparisonValue + segmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + segmentComparator: "" + value: "" + comparisonAttribute: comparisonAttribute + rolloutPercentageItems: + - percentage: 0 + value: "" + - percentage: 0 + value: "" + value: "" + settingId: 0 + properties: + settingValues: + description: The values to update. + items: + $ref: '#/components/schemas/UpdateSettingValueWithSettingIdModel' + type: array + type: object + UpdateTagModel: + example: + color: color + name: name + properties: + name: + description: Name of the Tag. + maxLength: 255 + minLength: 0 + nullable: true + type: string + color: + description: "Color of the Tag. Possible values: `panther`, `whale`, `salmon`,\ + \ `lizard`, `canary`, `koala`, or any HTML color code." + maxLength: 255 + minLength: 0 + nullable: true + type: string + type: object + UpdateTargetingRuleModel: + example: + percentageOptions: + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + - percentage: 1 + value: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + conditions: + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + - segmentCondition: "" + userCondition: "" + prerequisiteFlagCondition: "" + value: "" + properties: + conditions: + description: |- + The list of conditions that are combined with logical AND operators. + It can be one of the following: + - User condition + - Segment condition + - Prerequisite flag condition + items: + $ref: '#/components/schemas/UpdateConditionModel' + nullable: true + type: array + percentageOptions: + description: The percentage options from where the evaluation process will + choose a value based on the flag's percentage evaluation attribute. + items: + $ref: '#/components/schemas/UpdatePercentageOptionModel' + nullable: true + type: array + value: + allOf: + - $ref: '#/components/schemas/UpdateValueModel' + nullable: true + type: object + UpdateUserConditionModel: + description: Describes a condition that is based on user attributes. + properties: + comparisonAttribute: + description: "The User Object attribute that the condition is based on.\ + \ Can be \"User ID\", \"Email\", \"Country\" or any custom attribute." + maxLength: 1000 + minLength: 1 + type: string + comparator: + $ref: '#/components/schemas/UserComparator' + comparisonValue: + $ref: '#/components/schemas/UpdateComparisonValueModel' + required: + - comparator + - comparisonAttribute + - comparisonValue + type: object + UpdateValueModel: + description: Represents the value of a Feature Flag or Setting. + example: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + properties: + boolValue: + description: The served value in case of a boolean Feature Flag. + nullable: true + type: boolean + stringValue: + description: The served value in case of a text Setting. + nullable: true + type: string + intValue: + description: The served value in case of a whole number Setting. + format: int32 + nullable: true + type: integer + doubleValue: + description: The served value in case of a decimal number Setting. + format: double + nullable: true + type: number + type: object + UserComparator: + description: The comparison operator which defines the relation between the + comparison attribute and the comparison value. + enum: + - isOneOf + - isNotOneOf + - containsAnyOf + - doesNotContainAnyOf + - semVerIsOneOf + - semVerIsNotOneOf + - semVerLess + - semVerLessOrEquals + - semVerGreater + - semVerGreaterOrEquals + - numberEquals + - numberDoesNotEqual + - numberLess + - numberLessOrEquals + - numberGreater + - numberGreaterOrEquals + - sensitiveIsOneOf + - sensitiveIsNotOneOf + - dateTimeBefore + - dateTimeAfter + - sensitiveTextEquals + - sensitiveTextDoesNotEqual + - sensitiveTextStartsWithAnyOf + - sensitiveTextNotStartsWithAnyOf + - sensitiveTextEndsWithAnyOf + - sensitiveTextNotEndsWithAnyOf + - sensitiveArrayContainsAnyOf + - sensitiveArrayDoesNotContainAnyOf + - textEquals + - textDoesNotEqual + - textStartsWithAnyOf + - textNotStartsWithAnyOf + - textEndsWithAnyOf + - textNotEndsWithAnyOf + - arrayContainsAnyOf + - arrayDoesNotContainAnyOf + type: string + UserConditionModel: + description: Describes a condition that is based on user attributes. + properties: + comparisonAttribute: + description: "The User Object attribute that the condition is based on.\ + \ Can be \"User ID\", \"Email\", \"Country\" or any custom attribute." + maxLength: 1000 + minLength: 1 + type: string + comparator: + $ref: '#/components/schemas/UserComparator' + comparisonValue: + $ref: '#/components/schemas/ComparisonValueModel' + required: + - comparator + - comparisonAttribute + - comparisonValue + type: object + UserModel: + example: + twoFactorEnabled: true + fullName: fullName + userId: userId + email: email + properties: + userId: + description: Identifier of the Member. + nullable: true + type: string + fullName: + description: Name of the Member. + nullable: true + type: string + email: + description: Email of the Member. + nullable: true + type: string + twoFactorEnabled: + description: Determines whether 2FA is enabled for the Member. + type: boolean + required: + - email + - fullName + - twoFactorEnabled + - userId + type: object + ValueModel: + description: Represents the value of a Feature Flag or Setting. + example: + stringValue: stringValue + intValue: 0 + boolValue: true + doubleValue: 6.027456183070403 + properties: + boolValue: + description: The served value in case of a boolean Feature Flag. + nullable: true + type: boolean + stringValue: + description: The served value in case of a text Setting. + nullable: true + type: string + intValue: + description: The served value in case of a whole number Setting. + format: int32 + nullable: true + type: integer + doubleValue: + description: The served value in case of a decimal number Setting. + format: double + nullable: true + type: number + required: + - boolValue + - doubleValue + - intValue + - stringValue + type: object + WebHookHttpMethod: + enum: + - get + - post + type: string + WebHookRequestModel: + example: + webHookHeaders: + - isSecure: true + value: value + key: key + - isSecure: true + value: value + key: key + httpMethod: "" + url: url + content: content + properties: + url: + description: The URL of the Webhook. + maxLength: 1000 + minLength: 7 + type: string + content: + description: The HTTP body content. + maxLength: 15000 + minLength: 0 + nullable: true + type: string + httpMethod: + allOf: + - $ref: '#/components/schemas/WebHookHttpMethod' + nullable: true + webHookHeaders: + description: List of HTTP headers. + items: + $ref: '#/components/schemas/WebhookHeaderModel' + nullable: true + type: array + required: + - url + type: object + WebhookConfig: + description: The Config where the applied changes will invoke the Webhook. + example: + configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + properties: + name: + description: The Config's name. + type: string + configId: + description: The Config's identifier. + format: uuid + type: string + required: + - configId + - name + type: object + WebhookEnvironment: + description: The Environment where the applied changes will invoke the Webhook. + example: + environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + properties: + name: + description: The Environment's name. + type: string + environmentId: + description: The Environment's identifier. + format: uuid + type: string + required: + - environmentId + - name + type: object + WebhookHeaderModel: + example: + isSecure: true + value: value + key: key + properties: + key: + description: The HTTP header key. + maxLength: 255 + minLength: 1 + type: string + value: + description: The HTTP header value. + maxLength: 1000 + minLength: 1 + type: string + isSecure: + description: Indicates whether the header value is sensitive. + type: boolean + required: + - key + - value + type: object + WebhookHeaderResponseModel: + example: + isSecure: true + value: value + key: key + properties: + key: + description: The HTTP header key. + type: string + value: + description: The HTTP header value. + type: string + isSecure: + description: Indicates whether the header value is sensitive. + type: boolean + required: + - isSecure + - key + - value + type: object + WebhookResponseModel: + example: + webHookHeaders: + - isSecure: true + value: value + key: key + - isSecure: true + value: value + key: key + environment: + environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + webhookId: 0 + httpMethod: get + config: + configId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + name: name + url: url + content: content + properties: + webhookId: + description: The identifier of the Webhook. + format: int32 + type: integer + url: + description: The URL of the Webhook. + type: string + httpMethod: + $ref: '#/components/schemas/WebHookHttpMethod' + content: + description: The HTTP body content. + nullable: true + type: string + webHookHeaders: + description: List of HTTP headers that the Webhook must send. + items: + $ref: '#/components/schemas/WebhookHeaderResponseModel' + type: array + config: + $ref: '#/components/schemas/WebhookConfig' + environment: + $ref: '#/components/schemas/WebhookEnvironment' + required: + - config + - content + - environment + - httpMethod + - url + - webHookHeaders + - webhookId + type: object + WebhookSigningKeysModel: + example: + key1: key1 + key2: key2 + properties: + key1: + description: The first signing key. + nullable: true + type: string + key2: + description: The second signing key. + nullable: true + type: string + required: + - key1 + - key2 + type: object + securitySchemes: + Basic: + description: |- + To authenticate with the API you have to fill the `Authorization` HTTP request header with your Public API credentials. + + You can create your credentials on the Public API credentials management page. + scheme: basic + type: http +x-tagGroups: +- name: Feature Flag values V2 + tags: + - Feature Flag & Setting values using SDK Key V2 + - Feature Flag & Setting values V2 +- name: Feature Flag values (legacy) + tags: + - Feature Flag & Setting values using SDK Key + - Feature Flag & Setting values +- name: Feature Flag metadata + tags: + - Feature Flags & Settings + - Tags +- name: General + tags: + - Products + - Configs + - Environments + - Segments + - SDK Keys + - Webhooks + - Integrations + - Code References +- name: Membership + tags: + - Organizations + - Members + - Permission Groups +- name: Diagnostics + tags: + - Audit logs + - Zombie (stale) flags + - Me + diff --git a/docs/AccessType.md b/docs/AccessType.md new file mode 100644 index 0000000..c0f13ef --- /dev/null +++ b/docs/AccessType.md @@ -0,0 +1,15 @@ + + +# AccessType + +## Enum + + +* `READ_ONLY` (value: `"readOnly"`) + +* `FULL` (value: `"full"`) + +* `CUSTOM` (value: `"custom"`) + + + diff --git a/docs/AddOrUpdateIntegrationLinkModel.md b/docs/AddOrUpdateIntegrationLinkModel.md new file mode 100644 index 0000000..1c5c89e --- /dev/null +++ b/docs/AddOrUpdateIntegrationLinkModel.md @@ -0,0 +1,14 @@ + + +# AddOrUpdateIntegrationLinkModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**description** | **String** | | [optional] | +|**url** | **String** | | [optional] | + + + diff --git a/docs/AddOrUpdateJiraIntegrationLinkModel.md b/docs/AddOrUpdateJiraIntegrationLinkModel.md new file mode 100644 index 0000000..2933b2b --- /dev/null +++ b/docs/AddOrUpdateJiraIntegrationLinkModel.md @@ -0,0 +1,16 @@ + + +# AddOrUpdateJiraIntegrationLinkModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**jiraJwtToken** | **String** | | | +|**clientKey** | **String** | | | +|**description** | **String** | | [optional] | +|**url** | **String** | | [optional] | + + + diff --git a/docs/AuditLogItemModel.md b/docs/AuditLogItemModel.md new file mode 100644 index 0000000..2d84daf --- /dev/null +++ b/docs/AuditLogItemModel.md @@ -0,0 +1,24 @@ + + +# AuditLogItemModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**auditLogId** | **Long** | | | +|**auditLogDateTime** | **OffsetDateTime** | | | +|**auditLogTypeEnum** | **AuditLogType** | | | +|**changeSetId** | **UUID** | | | +|**truncated** | **Boolean** | | | +|**auditLogType** | **String** | | | +|**userEmail** | **String** | | | +|**userName** | **String** | | | +|**where** | **String** | | | +|**why** | **String** | | | +|**actionTarget** | **String** | | | +|**details** | **String** | | | + + + diff --git a/docs/AuditLogType.md b/docs/AuditLogType.md new file mode 100644 index 0000000..58996dd --- /dev/null +++ b/docs/AuditLogType.md @@ -0,0 +1,193 @@ + + +# AuditLogType + +## Enum + + +* `PRODUCT_CREATED` (value: `"productCreated"`) + +* `PRODUCT_CHANGED` (value: `"productChanged"`) + +* `PRODUCT_OWNERSHIP_TRANSFERRED` (value: `"productOwnershipTransferred"`) + +* `PRODUCT_DELETED` (value: `"productDeleted"`) + +* `PRODUCTS_REORDERED` (value: `"productsReordered"`) + +* `TEAM_MEMBER_INVITED` (value: `"teamMemberInvited"`) + +* `TEAM_MEMBER_INVITATION_REVOKED` (value: `"teamMemberInvitationRevoked"`) + +* `TEAM_MEMBER_JOINED` (value: `"teamMemberJoined"`) + +* `TEAM_MEMBER_PERMISSION_GROUP_CHANGED` (value: `"teamMemberPermissionGroupChanged"`) + +* `TEAM_MEMBER_REMOVED` (value: `"teamMemberRemoved"`) + +* `TEAM_MEMBER_LEFT` (value: `"teamMemberLeft"`) + +* `TEAM_MEMBER_INVITATION_CHANGED` (value: `"teamMemberInvitationChanged"`) + +* `TEAM_MEMBER_INVITATION_RESENT` (value: `"teamMemberInvitationResent"`) + +* `TEAM_MEMBER_INVITATION_REJECTED` (value: `"teamMemberInvitationRejected"`) + +* `CONFIG_CREATED` (value: `"configCreated"`) + +* `CONFIG_CHANGED` (value: `"configChanged"`) + +* `CONFIG_DELETED` (value: `"configDeleted"`) + +* `CONFIGS_REORDERED` (value: `"configsReordered"`) + +* `ENVIRONMENT_CREATED` (value: `"environmentCreated"`) + +* `ENVIRONMENT_CHANGED` (value: `"environmentChanged"`) + +* `ENVIRONMENT_DELETED` (value: `"environmentDeleted"`) + +* `ENVIRONMENTS_REORDERED` (value: `"environmentsReordered"`) + +* `SETTING_CREATED` (value: `"settingCreated"`) + +* `SETTING_CHANGED` (value: `"settingChanged"`) + +* `SETTING_DELETED` (value: `"settingDeleted"`) + +* `SETTINGS_REORDERED` (value: `"settingsReordered"`) + +* `SETTING_VALUE_CHANGED` (value: `"settingValueChanged"`) + +* `WEB_HOOK_CREATED` (value: `"webHookCreated"`) + +* `WEB_HOOK_CHANGED` (value: `"webHookChanged"`) + +* `WEB_HOOK_DELETED` (value: `"webHookDeleted"`) + +* `PERMISSION_GROUP_CREATED` (value: `"permissionGroupCreated"`) + +* `PERMISSION_GROUP_CHANGED` (value: `"permissionGroupChanged"`) + +* `PERMISSION_GROUP_DELETED` (value: `"permissionGroupDeleted"`) + +* `PERMISSION_GROUP_DEFAULT` (value: `"permissionGroupDefault"`) + +* `API_KEY_ADDED` (value: `"apiKeyAdded"`) + +* `API_KEY_REMOVED` (value: `"apiKeyRemoved"`) + +* `INTEGRATION_ADDED` (value: `"integrationAdded"`) + +* `INTEGRATION_CHANGED` (value: `"integrationChanged"`) + +* `INTEGRATION_REMOVED` (value: `"integrationRemoved"`) + +* `API_KEY_CONNECTED` (value: `"apiKeyConnected"`) + +* `INTEGRATION_LINK_ADDED` (value: `"integrationLinkAdded"`) + +* `INTEGRATION_LINK_REMOVED` (value: `"integrationLinkRemoved"`) + +* `ORGANIZATION_ADDED` (value: `"organizationAdded"`) + +* `ORGANIZATION_REMOVED` (value: `"organizationRemoved"`) + +* `ORGANIZATION_CHANGED` (value: `"organizationChanged"`) + +* `ORGANIZATION_SUBSCRIPTION_TYPE_CHANGED` (value: `"organizationSubscriptionTypeChanged"`) + +* `ORGANIZATION_ADMIN_CHANGED` (value: `"organizationAdminChanged"`) + +* `ORGANIZATION_ADMIN_LEFT` (value: `"organizationAdminLeft"`) + +* `TWO_FACTOR_DISABLED_FOR_MEMBER` (value: `"twoFactorDisabledForMember"`) + +* `TAG_ADDED` (value: `"tagAdded"`) + +* `TAG_CHANGED` (value: `"tagChanged"`) + +* `TAG_REMOVED` (value: `"tagRemoved"`) + +* `SETTING_TAG_ADDED` (value: `"settingTagAdded"`) + +* `SETTING_TAG_REMOVED` (value: `"settingTagRemoved"`) + +* `PUBLIC_API_ACCESS_TOKEN_ADDED` (value: `"publicApiAccessTokenAdded"`) + +* `PUBLIC_API_ACCESS_TOKEN_REMOVED` (value: `"publicApiAccessTokenRemoved"`) + +* `DOMAIN_ADDED` (value: `"domainAdded"`) + +* `DOMAIN_VERIFIED` (value: `"domainVerified"`) + +* `DOMAIN_REMOVED` (value: `"domainRemoved"`) + +* `DOMAIN_SAML_CONFIGURED` (value: `"domainSamlConfigured"`) + +* `DOMAIN_SAML_DELETED` (value: `"domainSamlDeleted"`) + +* `AUTO_PROVISIONING_CONFIGURATION_CHANGED` (value: `"autoProvisioningConfigurationChanged"`) + +* `SAML_IDP_CONFIGURATION_ADDED` (value: `"samlIdpConfigurationAdded"`) + +* `SAML_IDP_CONFIGURATION_REMOVED` (value: `"samlIdpConfigurationRemoved"`) + +* `SAML_IDP_CONFIGURATION_UPDATED` (value: `"samlIdpConfigurationUpdated"`) + +* `AUTO_PROVISIONING_ENABLED_CHANGED` (value: `"autoProvisioningEnabledChanged"`) + +* `ORGANIZATION_MEMBER_JOINED` (value: `"organizationMemberJoined"`) + +* `ORGANIZATION_MEMBER_PRODUCT_JOIN_REQUESTED` (value: `"organizationMemberProductJoinRequested"`) + +* `ORGANIZATION_MEMBER_PRODUCT_JOIN_REQUEST_REJECTED` (value: `"organizationMemberProductJoinRequestRejected"`) + +* `ORGANIZATION_MEMBER_PRODUCT_JOIN_REQUEST_APPROVED` (value: `"organizationMemberProductJoinRequestApproved"`) + +* `ORGANIZATION_MEMBER_REMOVED` (value: `"organizationMemberRemoved"`) + +* `CODE_REFERENCES_UPLOADED` (value: `"codeReferencesUploaded"`) + +* `CODE_REFERENCE_DELETED` (value: `"codeReferenceDeleted"`) + +* `CODE_REFERENCE_STALE_BRANCH_DELETED` (value: `"codeReferenceStaleBranchDeleted"`) + +* `SEGMENT_CREATED` (value: `"segmentCreated"`) + +* `SEGMENT_CHANGED` (value: `"segmentChanged"`) + +* `SEGMENT_DELETED` (value: `"segmentDeleted"`) + +* `WEBHOOK_SIGNING_KEY_DELETED` (value: `"webhookSigningKeyDeleted"`) + +* `WEBHOOK_SIGNING_KEY_CREATED` (value: `"webhookSigningKeyCreated"`) + +* `USER_PROVISIONING_CONFIGURATION_CHANGED` (value: `"userProvisioningConfigurationChanged"`) + +* `SYNC_GROUP_PROVISIONING_RULE_CHANGED` (value: `"syncGroupProvisioningRuleChanged"`) + +* `SYNC_GROUPS_REORDERED` (value: `"syncGroupsReordered"`) + +* `SYNC_USER_PROVISIONING_ENABLED` (value: `"syncUserProvisioningEnabled"`) + +* `SYNC_USER_PROVISIONING_DISABLED` (value: `"syncUserProvisioningDisabled"`) + +* `USER_EMAIL_CHANGED` (value: `"userEmailChanged"`) + +* `USER_FULL_NAME_CHANGED` (value: `"userFullNameChanged"`) + +* `USER_DISABLED` (value: `"userDisabled"`) + +* `AWS_CONNECTED` (value: `"awsConnected"`) + +* `AWS_DISCONNECTED` (value: `"awsDisconnected"`) + +* `USER_ENABLED` (value: `"userEnabled"`) + +* `SYNC_USER_DELETED` (value: `"syncUserDeleted"`) + +* `SYNC_GROUP_DELETED` (value: `"syncGroupDeleted"`) + + + diff --git a/docs/AuditLogsApi.md b/docs/AuditLogsApi.md new file mode 100644 index 0000000..5446e57 --- /dev/null +++ b/docs/AuditLogsApi.md @@ -0,0 +1,246 @@ +# AuditLogsApi + +All URIs are relative to *https://api.configcat.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getAuditlogs**](AuditLogsApi.md#getAuditlogs) | **GET** /v1/products/{productId}/auditlogs | List Audit log items for Product | +| [**getDeletedSettings**](AuditLogsApi.md#getDeletedSettings) | **GET** /v1/configs/{configId}/deleted-settings | List Deleted Settings | +| [**getOrganizationAuditlogs**](AuditLogsApi.md#getOrganizationAuditlogs) | **GET** /v1/organizations/{organizationId}/auditlogs | List Audit log items for Organization | + + + +# **getAuditlogs** +> List<AuditLogItemModel> getAuditlogs(productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime) + +List Audit log items for Product + +This endpoint returns the list of Audit log items for a given Product and the result can be optionally filtered by Config and/or Environment. If neither `fromUtcDateTime` nor `toUtcDateTime` is set, the audit logs for the **last 7 days** will be returned. The distance between `fromUtcDateTime` and `toUtcDateTime` cannot exceed **30 days**. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.AuditLogsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + AuditLogsApi apiInstance = new AuditLogsApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. + UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. + AuditLogType auditLogType = AuditLogType.fromValue("productCreated"); // AuditLogType | Filter Audit logs by Audit log type. + OffsetDateTime fromUtcDateTime = OffsetDateTime.now(); // OffsetDateTime | Filter Audit logs by starting UTC date. + OffsetDateTime toUtcDateTime = OffsetDateTime.now(); // OffsetDateTime | Filter Audit logs by ending UTC date. + try { + List result = apiInstance.getAuditlogs(productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuditLogsApi#getAuditlogs"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | +| **configId** | **UUID**| The identifier of the Config. | [optional] | +| **environmentId** | **UUID**| The identifier of the Environment. | [optional] | +| **auditLogType** | [**AuditLogType**](.md)| Filter Audit logs by Audit log type. | [optional] [enum: productCreated, productChanged, productOwnershipTransferred, productDeleted, productsReordered, teamMemberInvited, teamMemberInvitationRevoked, teamMemberJoined, teamMemberPermissionGroupChanged, teamMemberRemoved, teamMemberLeft, teamMemberInvitationChanged, teamMemberInvitationResent, teamMemberInvitationRejected, configCreated, configChanged, configDeleted, configsReordered, environmentCreated, environmentChanged, environmentDeleted, environmentsReordered, settingCreated, settingChanged, settingDeleted, settingsReordered, settingValueChanged, webHookCreated, webHookChanged, webHookDeleted, permissionGroupCreated, permissionGroupChanged, permissionGroupDeleted, permissionGroupDefault, apiKeyAdded, apiKeyRemoved, integrationAdded, integrationChanged, integrationRemoved, apiKeyConnected, integrationLinkAdded, integrationLinkRemoved, organizationAdded, organizationRemoved, organizationChanged, organizationSubscriptionTypeChanged, organizationAdminChanged, organizationAdminLeft, twoFactorDisabledForMember, tagAdded, tagChanged, tagRemoved, settingTagAdded, settingTagRemoved, publicApiAccessTokenAdded, publicApiAccessTokenRemoved, domainAdded, domainVerified, domainRemoved, domainSamlConfigured, domainSamlDeleted, autoProvisioningConfigurationChanged, samlIdpConfigurationAdded, samlIdpConfigurationRemoved, samlIdpConfigurationUpdated, autoProvisioningEnabledChanged, organizationMemberJoined, organizationMemberProductJoinRequested, organizationMemberProductJoinRequestRejected, organizationMemberProductJoinRequestApproved, organizationMemberRemoved, codeReferencesUploaded, codeReferenceDeleted, codeReferenceStaleBranchDeleted, segmentCreated, segmentChanged, segmentDeleted, webhookSigningKeyDeleted, webhookSigningKeyCreated, userProvisioningConfigurationChanged, syncGroupProvisioningRuleChanged, syncGroupsReordered, syncUserProvisioningEnabled, syncUserProvisioningDisabled, userEmailChanged, userFullNameChanged, userDisabled, awsConnected, awsDisconnected, userEnabled, syncUserDeleted, syncGroupDeleted] | +| **fromUtcDateTime** | **OffsetDateTime**| Filter Audit logs by starting UTC date. | [optional] | +| **toUtcDateTime** | **OffsetDateTime**| Filter Audit logs by ending UTC date. | [optional] | + +### Return type + +[**List<AuditLogItemModel>**](AuditLogItemModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getDeletedSettings** +> List<DeletedSettingModel> getDeletedSettings(configId) + +List Deleted Settings + +This endpoint returns the list of Feature Flags and Settings that were deleted from the given Config. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.AuditLogsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + AuditLogsApi apiInstance = new AuditLogsApi(defaultClient); + UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. + try { + List result = apiInstance.getDeletedSettings(configId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuditLogsApi#getDeletedSettings"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **configId** | **UUID**| The identifier of the Config. | | + +### Return type + +[**List<DeletedSettingModel>**](DeletedSettingModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getOrganizationAuditlogs** +> List<AuditLogItemModel> getOrganizationAuditlogs(organizationId, productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime) + +List Audit log items for Organization + +This endpoint returns the list of Audit log items for a given Organization and the result can be optionally filtered by Product and/or Config and/or Environment. If neither `fromUtcDateTime` nor `toUtcDateTime` is set, the audit logs for the **last 7 days** will be returned. The distance between `fromUtcDateTime` and `toUtcDateTime` cannot exceed **30 days**. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.AuditLogsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + AuditLogsApi apiInstance = new AuditLogsApi(defaultClient); + UUID organizationId = UUID.randomUUID(); // UUID | The identifier of the Organization. + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. + UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. + AuditLogType auditLogType = AuditLogType.fromValue("productCreated"); // AuditLogType | Filter Audit logs by Audit log type. + OffsetDateTime fromUtcDateTime = OffsetDateTime.now(); // OffsetDateTime | Filter Audit logs by starting UTC date. + OffsetDateTime toUtcDateTime = OffsetDateTime.now(); // OffsetDateTime | Filter Audit logs by ending UTC date. + try { + List result = apiInstance.getOrganizationAuditlogs(organizationId, productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuditLogsApi#getOrganizationAuditlogs"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **organizationId** | **UUID**| The identifier of the Organization. | | +| **productId** | **UUID**| The identifier of the Product. | [optional] | +| **configId** | **UUID**| The identifier of the Config. | [optional] | +| **environmentId** | **UUID**| The identifier of the Environment. | [optional] | +| **auditLogType** | [**AuditLogType**](.md)| Filter Audit logs by Audit log type. | [optional] [enum: productCreated, productChanged, productOwnershipTransferred, productDeleted, productsReordered, teamMemberInvited, teamMemberInvitationRevoked, teamMemberJoined, teamMemberPermissionGroupChanged, teamMemberRemoved, teamMemberLeft, teamMemberInvitationChanged, teamMemberInvitationResent, teamMemberInvitationRejected, configCreated, configChanged, configDeleted, configsReordered, environmentCreated, environmentChanged, environmentDeleted, environmentsReordered, settingCreated, settingChanged, settingDeleted, settingsReordered, settingValueChanged, webHookCreated, webHookChanged, webHookDeleted, permissionGroupCreated, permissionGroupChanged, permissionGroupDeleted, permissionGroupDefault, apiKeyAdded, apiKeyRemoved, integrationAdded, integrationChanged, integrationRemoved, apiKeyConnected, integrationLinkAdded, integrationLinkRemoved, organizationAdded, organizationRemoved, organizationChanged, organizationSubscriptionTypeChanged, organizationAdminChanged, organizationAdminLeft, twoFactorDisabledForMember, tagAdded, tagChanged, tagRemoved, settingTagAdded, settingTagRemoved, publicApiAccessTokenAdded, publicApiAccessTokenRemoved, domainAdded, domainVerified, domainRemoved, domainSamlConfigured, domainSamlDeleted, autoProvisioningConfigurationChanged, samlIdpConfigurationAdded, samlIdpConfigurationRemoved, samlIdpConfigurationUpdated, autoProvisioningEnabledChanged, organizationMemberJoined, organizationMemberProductJoinRequested, organizationMemberProductJoinRequestRejected, organizationMemberProductJoinRequestApproved, organizationMemberRemoved, codeReferencesUploaded, codeReferenceDeleted, codeReferenceStaleBranchDeleted, segmentCreated, segmentChanged, segmentDeleted, webhookSigningKeyDeleted, webhookSigningKeyCreated, userProvisioningConfigurationChanged, syncGroupProvisioningRuleChanged, syncGroupsReordered, syncUserProvisioningEnabled, syncUserProvisioningDisabled, userEmailChanged, userFullNameChanged, userDisabled, awsConnected, awsDisconnected, userEnabled, syncUserDeleted, syncGroupDeleted] | +| **fromUtcDateTime** | **OffsetDateTime**| Filter Audit logs by starting UTC date. | [optional] | +| **toUtcDateTime** | **OffsetDateTime**| Filter Audit logs by ending UTC date. | [optional] | + +### Return type + +[**List<AuditLogItemModel>**](AuditLogItemModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + diff --git a/docs/CodeReferenceModel.md b/docs/CodeReferenceModel.md new file mode 100644 index 0000000..0c38583 --- /dev/null +++ b/docs/CodeReferenceModel.md @@ -0,0 +1,20 @@ + + +# CodeReferenceModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**branch** | **String** | The source control branch on where the scan was performed. (Source of the branch selector on the ConfigCat Dashboard) | | +|**references** | [**List<ReferenceLinesModel>**](ReferenceLinesModel.md) | The actual references to the given Feature Flag or Setting. | | +|**commitUrl** | **String** | The related commit's URL. | | +|**commitHash** | **String** | The related commit's hash. | | +|**syncedAt** | **OffsetDateTime** | The date and time when the reference report was uploaded. | | +|**repository** | **String** | The source control repository that contains the scanned code. | | +|**codeReferenceId** | **UUID** | The identifier of the reference report. | | +|**uploader** | **String** | The code reference scanning tool's name. | | + + + diff --git a/docs/CodeReferenceRequest.md b/docs/CodeReferenceRequest.md new file mode 100644 index 0000000..912c806 --- /dev/null +++ b/docs/CodeReferenceRequest.md @@ -0,0 +1,20 @@ + + +# CodeReferenceRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**configId** | **UUID** | The Config's identifier the scanning was performed against. | | +|**repository** | **String** | The source control repository that contains the scanned code. (Source of the repository selector on the ConfigCat Dashboard) | | +|**branch** | **String** | The source control branch on where the scan was performed. (Source of the branch selector on the ConfigCat Dashboard) | | +|**commitUrl** | **String** | The related commit's URL. (Appears on the ConfigCat Dashboard) | [optional] | +|**commitHash** | **String** | The related commit's hash. (Appears on the ConfigCat Dashboard) | [optional] | +|**uploader** | **String** | The scanning tool's name. (Appears on the ConfigCat Dashboard) | [optional] | +|**activeBranches** | **List<String>** | The currently active branches of the repository. Each previously uploaded report that belongs to a non-reported active branch is being deleted. | [optional] | +|**flagReferences** | [**List<FlagReference>**](FlagReference.md) | The actual code reference collection. | [optional] | + + + diff --git a/docs/CodeReferencesApi.md b/docs/CodeReferencesApi.md new file mode 100644 index 0000000..a2e8ea0 --- /dev/null +++ b/docs/CodeReferencesApi.md @@ -0,0 +1,222 @@ +# CodeReferencesApi + +All URIs are relative to *https://api.configcat.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**v1CodeReferencesDeleteReportsPost**](CodeReferencesApi.md#v1CodeReferencesDeleteReportsPost) | **POST** /v1/code-references/delete-reports | Delete Reference reports | +| [**v1CodeReferencesPost**](CodeReferencesApi.md#v1CodeReferencesPost) | **POST** /v1/code-references | Upload References | +| [**v1SettingsSettingIdCodeReferencesGet**](CodeReferencesApi.md#v1SettingsSettingIdCodeReferencesGet) | **GET** /v1/settings/{settingId}/code-references | Get References for Feature Flag or Setting | + + + +# **v1CodeReferencesDeleteReportsPost** +> v1CodeReferencesDeleteReportsPost(deleteRepositoryReportsRequest) + +Delete Reference reports + + + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.CodeReferencesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + CodeReferencesApi apiInstance = new CodeReferencesApi(defaultClient); + DeleteRepositoryReportsRequest deleteRepositoryReportsRequest = new DeleteRepositoryReportsRequest(); // DeleteRepositoryReportsRequest | + try { + apiInstance.v1CodeReferencesDeleteReportsPost(deleteRepositoryReportsRequest); + } catch (ApiException e) { + System.err.println("Exception when calling CodeReferencesApi#v1CodeReferencesDeleteReportsPost"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **deleteRepositoryReportsRequest** | [**DeleteRepositoryReportsRequest**](DeleteRepositoryReportsRequest.md)| | | + +### Return type + +null (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **v1CodeReferencesPost** +> v1CodeReferencesPost(codeReferenceRequest) + +Upload References + + + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.CodeReferencesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + CodeReferencesApi apiInstance = new CodeReferencesApi(defaultClient); + CodeReferenceRequest codeReferenceRequest = new CodeReferenceRequest(); // CodeReferenceRequest | + try { + apiInstance.v1CodeReferencesPost(codeReferenceRequest); + } catch (ApiException e) { + System.err.println("Exception when calling CodeReferencesApi#v1CodeReferencesPost"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **codeReferenceRequest** | [**CodeReferenceRequest**](CodeReferenceRequest.md)| | | + +### Return type + +null (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **v1SettingsSettingIdCodeReferencesGet** +> List<CodeReferenceModel> v1SettingsSettingIdCodeReferencesGet(settingId) + +Get References for Feature Flag or Setting + + + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.CodeReferencesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + CodeReferencesApi apiInstance = new CodeReferencesApi(defaultClient); + Integer settingId = 56; // Integer | The identifier of the Feature Flag or Setting. + try { + List result = apiInstance.v1SettingsSettingIdCodeReferencesGet(settingId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CodeReferencesApi#v1SettingsSettingIdCodeReferencesGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **settingId** | **Integer**| The identifier of the Feature Flag or Setting. | | + +### Return type + +[**List<CodeReferenceModel>**](CodeReferenceModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + diff --git a/docs/ComparisonValueListModel.md b/docs/ComparisonValueListModel.md new file mode 100644 index 0000000..f66975b --- /dev/null +++ b/docs/ComparisonValueListModel.md @@ -0,0 +1,14 @@ + + +# ComparisonValueListModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**value** | **String** | The actual comparison value. | | +|**hint** | **String** | An optional hint for the comparison value. | [optional] | + + + diff --git a/docs/ComparisonValueModel.md b/docs/ComparisonValueModel.md new file mode 100644 index 0000000..af7a8ad --- /dev/null +++ b/docs/ComparisonValueModel.md @@ -0,0 +1,16 @@ + + +# ComparisonValueModel + +The value that the user object's attribute is compared to. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**stringValue** | **String** | The string representation of the comparison value. | [optional] | +|**doubleValue** | **Double** | The number representation of the comparison value. | [optional] | +|**listValue** | [**List<ComparisonValueListModel>**](ComparisonValueListModel.md) | The list representation of the comparison value. | [optional] | + + + diff --git a/docs/ConditionModel.md b/docs/ConditionModel.md new file mode 100644 index 0000000..81b5ab0 --- /dev/null +++ b/docs/ConditionModel.md @@ -0,0 +1,15 @@ + + +# ConditionModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userCondition** | [**UserConditionModel**](UserConditionModel.md) | | | +|**segmentCondition** | [**SegmentConditionModel**](SegmentConditionModel.md) | | | +|**prerequisiteFlagCondition** | [**PrerequisiteFlagConditionModel**](PrerequisiteFlagConditionModel.md) | | | + + + diff --git a/docs/ConfigModel.md b/docs/ConfigModel.md new file mode 100644 index 0000000..64b3a71 --- /dev/null +++ b/docs/ConfigModel.md @@ -0,0 +1,20 @@ + + +# ConfigModel + +Details of the Config. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**product** | [**ProductModel**](ProductModel.md) | | | +|**configId** | **UUID** | Identifier of the Config. | | +|**name** | **String** | Name of the Config. | | +|**description** | **String** | Description of the Config. | | +|**order** | **Integer** | The order of the Config represented on the ConfigCat Dashboard. | | +|**migratedConfigId** | **UUID** | | | +|**evaluationVersion** | **EvaluationVersion** | | | + + + diff --git a/docs/ConfigSettingFormulaModel.md b/docs/ConfigSettingFormulaModel.md new file mode 100644 index 0000000..7a31b7a --- /dev/null +++ b/docs/ConfigSettingFormulaModel.md @@ -0,0 +1,23 @@ + + +# ConfigSettingFormulaModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**lastVersionId** | **UUID** | | | +|**defaultValue** | [**ValueModel**](ValueModel.md) | | | +|**targetingRules** | [**List<TargetingRuleModel>**](TargetingRuleModel.md) | The targeting rules of the Feature Flag or Setting. | | +|**setting** | [**SettingDataModel**](SettingDataModel.md) | | | +|**updatedAt** | **OffsetDateTime** | The last updated date and time when the Feature Flag or Setting. | | +|**percentageEvaluationAttribute** | **String** | The user attribute used for percentage evaluation. If not set, it defaults to the `Identifier` user object attribute. | | +|**lastUpdaterUserEmail** | **String** | The email of the user who last updated the Feature Flag or Setting. | | +|**lastUpdaterUserFullName** | **String** | The name of the user who last updated the Feature Flag or Setting. | | +|**integrationLinks** | [**List<IntegrationLinkModel>**](IntegrationLinkModel.md) | The integration links attached to the Feature Flag or Setting. | | +|**settingTags** | [**List<SettingTagModel>**](SettingTagModel.md) | The tags attached to the Feature Flag or Setting. | | +|**settingIdsWherePrerequisite** | **List<Integer>** | List of Feature Flag and Setting IDs where the actual Feature Flag or Setting is prerequisite. | | + + + diff --git a/docs/ConfigSettingFormulasModel.md b/docs/ConfigSettingFormulasModel.md new file mode 100644 index 0000000..48d2ebe --- /dev/null +++ b/docs/ConfigSettingFormulasModel.md @@ -0,0 +1,17 @@ + + +# ConfigSettingFormulasModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**config** | [**ConfigModel**](ConfigModel.md) | | | +|**environment** | [**EnvironmentModel**](EnvironmentModel.md) | | | +|**readOnly** | **Boolean** | | | +|**settingFormulas** | [**List<ConfigSettingFormulaModel>**](ConfigSettingFormulaModel.md) | Evaluation descriptors of each updated Feature Flag and Setting. | | +|**featureFlagLimitations** | [**FeatureFlagLimitations**](FeatureFlagLimitations.md) | | | + + + diff --git a/docs/ConfigSettingValueModel.md b/docs/ConfigSettingValueModel.md new file mode 100644 index 0000000..f6a4c1b --- /dev/null +++ b/docs/ConfigSettingValueModel.md @@ -0,0 +1,21 @@ + + +# ConfigSettingValueModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**setting** | [**SettingDataModel**](SettingDataModel.md) | | | +|**updatedAt** | **OffsetDateTime** | The last updated date and time when the Feature Flag or Setting. | | +|**lastUpdaterUserEmail** | **String** | The email of the user who last updated the Feature Flag or Setting. | | +|**lastUpdaterUserFullName** | **String** | The name of the user who last updated the Feature Flag or Setting. | | +|**integrationLinks** | [**List<IntegrationLinkModel>**](IntegrationLinkModel.md) | The integration links attached to the Feature Flag or Setting. | | +|**settingTags** | [**List<SettingTagModel>**](SettingTagModel.md) | The tags attached to the Feature Flag or Setting. | | +|**rolloutRules** | [**List<RolloutRuleModel>**](RolloutRuleModel.md) | The targeting rule collection. | | +|**rolloutPercentageItems** | [**List<RolloutPercentageItemModel>**](RolloutPercentageItemModel.md) | The percentage rule collection. | | +|**value** | [**SettingValueType**](SettingValueType.md) | The value to serve. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. | | + + + diff --git a/docs/ConfigSettingValuesModel.md b/docs/ConfigSettingValuesModel.md new file mode 100644 index 0000000..ce96c52 --- /dev/null +++ b/docs/ConfigSettingValuesModel.md @@ -0,0 +1,17 @@ + + +# ConfigSettingValuesModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**config** | [**ConfigModel**](ConfigModel.md) | | | +|**environment** | [**EnvironmentModel**](EnvironmentModel.md) | | | +|**readOnly** | **Boolean** | | | +|**settingValues** | [**List<ConfigSettingValueModel>**](ConfigSettingValueModel.md) | | | +|**featureFlagLimitations** | [**FeatureFlagLimitations**](FeatureFlagLimitations.md) | | | + + + diff --git a/docs/ConfigsApi.md b/docs/ConfigsApi.md new file mode 100644 index 0000000..5cb3740 --- /dev/null +++ b/docs/ConfigsApi.md @@ -0,0 +1,371 @@ +# ConfigsApi + +All URIs are relative to *https://api.configcat.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createConfig**](ConfigsApi.md#createConfig) | **POST** /v1/products/{productId}/configs | Create Config | +| [**deleteConfig**](ConfigsApi.md#deleteConfig) | **DELETE** /v1/configs/{configId} | Delete Config | +| [**getConfig**](ConfigsApi.md#getConfig) | **GET** /v1/configs/{configId} | Get Config | +| [**getConfigs**](ConfigsApi.md#getConfigs) | **GET** /v1/products/{productId}/configs | List Configs | +| [**updateConfig**](ConfigsApi.md#updateConfig) | **PUT** /v1/configs/{configId} | Update Config | + + + +# **createConfig** +> ConfigModel createConfig(productId, createConfigRequest) + +Create Config + +This endpoint creates a new Config in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.ConfigsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + ConfigsApi apiInstance = new ConfigsApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + CreateConfigRequest createConfigRequest = new CreateConfigRequest(); // CreateConfigRequest | + try { + ConfigModel result = apiInstance.createConfig(productId, createConfigRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ConfigsApi#createConfig"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | +| **createConfigRequest** | [**CreateConfigRequest**](CreateConfigRequest.md)| | | + +### Return type + +[**ConfigModel**](ConfigModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | When the creation was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **deleteConfig** +> deleteConfig(configId) + +Delete Config + +This endpoint removes a Config identified by the `configId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.ConfigsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + ConfigsApi apiInstance = new ConfigsApi(defaultClient); + UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. + try { + apiInstance.deleteConfig(configId); + } catch (ApiException e) { + System.err.println("Exception when calling ConfigsApi#deleteConfig"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **configId** | **UUID**| The identifier of the Config. | | + +### Return type + +null (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | When the delete was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getConfig** +> ConfigModel getConfig(configId) + +Get Config + +This endpoint returns the metadata of a Config identified by the `configId`. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.ConfigsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + ConfigsApi apiInstance = new ConfigsApi(defaultClient); + UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. + try { + ConfigModel result = apiInstance.getConfig(configId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ConfigsApi#getConfig"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **configId** | **UUID**| The identifier of the Config. | | + +### Return type + +[**ConfigModel**](ConfigModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When everything is ok, the config data returned. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getConfigs** +> List<ConfigModel> getConfigs(productId) + +List Configs + +This endpoint returns the list of the Configs that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.ConfigsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + ConfigsApi apiInstance = new ConfigsApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + try { + List result = apiInstance.getConfigs(productId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ConfigsApi#getConfigs"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | + +### Return type + +[**List<ConfigModel>**](ConfigModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **updateConfig** +> ConfigModel updateConfig(configId, updateConfigRequest) + +Update Config + +This endpoint updates a Config identified by the `configId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.ConfigsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + ConfigsApi apiInstance = new ConfigsApi(defaultClient); + UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. + UpdateConfigRequest updateConfigRequest = new UpdateConfigRequest(); // UpdateConfigRequest | + try { + ConfigModel result = apiInstance.updateConfig(configId, updateConfigRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ConfigsApi#updateConfig"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **configId** | **UUID**| The identifier of the Config. | | +| **updateConfigRequest** | [**UpdateConfigRequest**](UpdateConfigRequest.md)| | | + +### Return type + +[**ConfigModel**](ConfigModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + diff --git a/docs/ConnectRequest.md b/docs/ConnectRequest.md new file mode 100644 index 0000000..30c565a --- /dev/null +++ b/docs/ConnectRequest.md @@ -0,0 +1,14 @@ + + +# ConnectRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**clientKey** | **String** | | | +|**jiraJwtToken** | **String** | | | + + + diff --git a/docs/CreateConfigRequest.md b/docs/CreateConfigRequest.md new file mode 100644 index 0000000..9ab9aeb --- /dev/null +++ b/docs/CreateConfigRequest.md @@ -0,0 +1,16 @@ + + +# CreateConfigRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The name of the Config. | | +|**description** | **String** | The description of the Config. | [optional] | +|**order** | **Integer** | The order of the Config represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | +|**evaluationVersion** | **EvaluationVersion** | | [optional] | + + + diff --git a/docs/CreateEnvironmentModel.md b/docs/CreateEnvironmentModel.md new file mode 100644 index 0000000..e15893e --- /dev/null +++ b/docs/CreateEnvironmentModel.md @@ -0,0 +1,16 @@ + + +# CreateEnvironmentModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The name of the Environment. | | +|**color** | **String** | The color of the Environment. RGB or HTML color codes are allowed. | [optional] | +|**description** | **String** | The description of the Environment. | [optional] | +|**order** | **Integer** | The order of the Environment represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | + + + diff --git a/docs/CreateIntegrationModel.md b/docs/CreateIntegrationModel.md new file mode 100644 index 0000000..f2c2d78 --- /dev/null +++ b/docs/CreateIntegrationModel.md @@ -0,0 +1,17 @@ + + +# CreateIntegrationModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**integrationType** | **IntegrationType** | | | +|**name** | **String** | Name of the Integration. | | +|**parameters** | **Map<String, String>** | Parameters of the Integration. | | +|**environmentIds** | **List<UUID>** | List of Environment IDs that are connected with this Integration. If the list is empty, all of the Environments are connected. | | +|**configIds** | **List<UUID>** | List of Config IDs that are connected with this Integration. If the list is empty, all of the Configs are connected. | | + + + diff --git a/docs/CreateOrUpdateEnvironmentAccessModel.md b/docs/CreateOrUpdateEnvironmentAccessModel.md new file mode 100644 index 0000000..1bd23a1 --- /dev/null +++ b/docs/CreateOrUpdateEnvironmentAccessModel.md @@ -0,0 +1,14 @@ + + +# CreateOrUpdateEnvironmentAccessModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**environmentId** | **UUID** | Identifier of the Environment. | [optional] | +|**environmentAccessType** | **EnvironmentAccessType** | | [optional] | + + + diff --git a/docs/CreatePermissionGroupRequest.md b/docs/CreatePermissionGroupRequest.md new file mode 100644 index 0000000..af04058 --- /dev/null +++ b/docs/CreatePermissionGroupRequest.md @@ -0,0 +1,37 @@ + + +# CreatePermissionGroupRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Name of the Permission Group. | | +|**canManageMembers** | **Boolean** | Group members can manage team members. | [optional] | +|**canCreateOrUpdateConfig** | **Boolean** | Group members can create/update Configs. | [optional] | +|**canDeleteConfig** | **Boolean** | Group members can delete Configs. | [optional] | +|**canCreateOrUpdateEnvironment** | **Boolean** | Group members can create/update Environments. | [optional] | +|**canDeleteEnvironment** | **Boolean** | Group members can delete Environments. | [optional] | +|**canCreateOrUpdateSetting** | **Boolean** | Group members can create/update Feature Flags and Settings. | [optional] | +|**canTagSetting** | **Boolean** | Group members can attach/detach Tags to Feature Flags and Settings. | [optional] | +|**canDeleteSetting** | **Boolean** | Group members can delete Feature Flags and Settings. | [optional] | +|**canCreateOrUpdateTag** | **Boolean** | Group members can create/update Tags. | [optional] | +|**canDeleteTag** | **Boolean** | Group members can delete Tags. | [optional] | +|**canManageWebhook** | **Boolean** | Group members can create/update/delete Webhooks. | [optional] | +|**canUseExportImport** | **Boolean** | Group members can use the export/import feature. | [optional] | +|**canManageProductPreferences** | **Boolean** | Group members can update Product preferences. | [optional] | +|**canManageIntegrations** | **Boolean** | Group members can add and configure integrations. | [optional] | +|**canViewSdkKey** | **Boolean** | Group members has access to SDK keys. | [optional] | +|**canRotateSdkKey** | **Boolean** | Group members can rotate SDK keys. | [optional] | +|**canCreateOrUpdateSegments** | **Boolean** | Group members can create/update Segments. | [optional] | +|**canDeleteSegments** | **Boolean** | Group members can delete Segments. | [optional] | +|**canViewProductAuditLog** | **Boolean** | Group members has access to audit logs. | [optional] | +|**canViewProductStatistics** | **Boolean** | Group members has access to product statistics. | [optional] | +|**accessType** | **AccessType** | | [optional] | +|**newEnvironmentAccessType** | **EnvironmentAccessType** | | [optional] | +|**environmentAccesses** | [**List<CreateOrUpdateEnvironmentAccessModel>**](CreateOrUpdateEnvironmentAccessModel.md) | List of environment specific permissions. | [optional] | +|**canDisable2FA** | **Boolean** | Group members can disable two-factor authentication for other members. | [optional] | + + + diff --git a/docs/CreateProductRequest.md b/docs/CreateProductRequest.md new file mode 100644 index 0000000..31f81f0 --- /dev/null +++ b/docs/CreateProductRequest.md @@ -0,0 +1,15 @@ + + +# CreateProductRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The name of the Product. | | +|**description** | **String** | The description of the Product. | [optional] | +|**order** | **Integer** | The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | + + + diff --git a/docs/CreateSegmentModel.md b/docs/CreateSegmentModel.md new file mode 100644 index 0000000..a382243 --- /dev/null +++ b/docs/CreateSegmentModel.md @@ -0,0 +1,17 @@ + + +# CreateSegmentModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Name of the Segment. | | +|**description** | **String** | Description of the Segment. | [optional] | +|**comparisonAttribute** | **String** | The user's attribute the evaluation process must take into account. | | +|**comparator** | **RolloutRuleComparator** | | | +|**comparisonValue** | **String** | The value to compare with the given user attribute's value. | | + + + diff --git a/docs/CreateSettingInitialValues.md b/docs/CreateSettingInitialValues.md new file mode 100644 index 0000000..b0be01b --- /dev/null +++ b/docs/CreateSettingInitialValues.md @@ -0,0 +1,20 @@ + + +# CreateSettingInitialValues + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**hint** | **String** | A short description for the setting, shown on the Dashboard UI. | [optional] | +|**tags** | **List<Long>** | The IDs of the tags which are attached to the setting. | [optional] | +|**order** | **Integer** | The order of the Setting represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | +|**key** | **String** | The key of the Feature Flag or Setting. | | +|**name** | **String** | The name of the Feature Flag or Setting. | | +|**settingType** | **SettingType** | | | +|**initialValues** | [**List<InitialValue>**](InitialValue.md) | Optional, initial value of the Feature Flag or Setting in the given Environments. Only one of the SettingIdToInitFrom or the InitialValues properties can be set. | [optional] | +|**settingIdToInitFrom** | **Integer** | Optional, the SettingId to initialize the values and tags of the Feature Flag or Setting from. Only can be set if you have at least ReadOnly access in all the Environments. Only one of the SettingIdToInitFrom or the InitialValues properties can be set. | [optional] | + + + diff --git a/docs/CreateTagModel.md b/docs/CreateTagModel.md new file mode 100644 index 0000000..dbe3d41 --- /dev/null +++ b/docs/CreateTagModel.md @@ -0,0 +1,14 @@ + + +# CreateTagModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Name of the Tag. | | +|**color** | **String** | Color of the Tag. Possible values: `panther`, `whale`, `salmon`, `lizard`, `canary`, `koala`, or any HTML color code. | [optional] | + + + diff --git a/docs/DeleteIntegrationLinkModel.md b/docs/DeleteIntegrationLinkModel.md new file mode 100644 index 0000000..da5447e --- /dev/null +++ b/docs/DeleteIntegrationLinkModel.md @@ -0,0 +1,13 @@ + + +# DeleteIntegrationLinkModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**hasRemainingIntegrationLink** | **Boolean** | | | + + + diff --git a/docs/DeleteRepositoryReportsRequest.md b/docs/DeleteRepositoryReportsRequest.md new file mode 100644 index 0000000..c37de90 --- /dev/null +++ b/docs/DeleteRepositoryReportsRequest.md @@ -0,0 +1,16 @@ + + +# DeleteRepositoryReportsRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**configId** | **UUID** | The Config's identifier from where the reports should be deleted. | | +|**repository** | **String** | The source control repository which's reports should be deleted. | | +|**branch** | **String** | If it's set, only this branch's reports belonging to the given repository will be deleted. | [optional] | +|**settingId** | **Integer** | If it's set, only this setting's reports belonging to the given repository will be deleted. | [optional] | + + + diff --git a/docs/DeletedSettingModel.md b/docs/DeletedSettingModel.md new file mode 100644 index 0000000..ae0c299 --- /dev/null +++ b/docs/DeletedSettingModel.md @@ -0,0 +1,16 @@ + + +# DeletedSettingModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**key** | **String** | Key of the Feature Flag or Setting. | [readonly] | +|**name** | **String** | Name of the Feature Flag or Setting. | [readonly] | +|**hint** | **String** | Description of the Feature Flag or Setting. | [readonly] | +|**settingType** | **SettingType** | | | + + + diff --git a/docs/EnvironmentAccessModel.md b/docs/EnvironmentAccessModel.md new file mode 100644 index 0000000..2b3011d --- /dev/null +++ b/docs/EnvironmentAccessModel.md @@ -0,0 +1,19 @@ + + +# EnvironmentAccessModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**environmentId** | **UUID** | Identifier of the Environment. | | +|**name** | **String** | Name of the Environment. | | +|**color** | **String** | Color of the Environment. | | +|**description** | **String** | Description of the Environment. | | +|**order** | **Integer** | The order of the Environment represented on the ConfigCat Dashboard. | | +|**reasonRequired** | **Boolean** | Determines whether a mandatory reason must be given every time when the Feature Flags or Settings in the given Environment are saved. | | +|**environmentAccessType** | **EnvironmentAccessType** | | | + + + diff --git a/docs/EnvironmentAccessType.md b/docs/EnvironmentAccessType.md new file mode 100644 index 0000000..367506c --- /dev/null +++ b/docs/EnvironmentAccessType.md @@ -0,0 +1,15 @@ + + +# EnvironmentAccessType + +## Enum + + +* `FULL` (value: `"full"`) + +* `READ_ONLY` (value: `"readOnly"`) + +* `NONE` (value: `"none"`) + + + diff --git a/docs/EnvironmentModel.md b/docs/EnvironmentModel.md new file mode 100644 index 0000000..b7323af --- /dev/null +++ b/docs/EnvironmentModel.md @@ -0,0 +1,20 @@ + + +# EnvironmentModel + +Details of the Environment. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**product** | [**ProductModel**](ProductModel.md) | | | +|**environmentId** | **UUID** | Identifier of the Environment. | | +|**name** | **String** | Name of the Environment. | | +|**color** | **String** | The configured color of the Environment. | | +|**description** | **String** | Description of the Environment. | | +|**order** | **Integer** | The order of the Environment represented on the ConfigCat Dashboard. | | +|**reasonRequired** | **Boolean** | Determines whether a mandatory reason must be given every time when the Feature Flags or Settings in the given Environment are saved. | | + + + diff --git a/docs/EnvironmentsApi.md b/docs/EnvironmentsApi.md new file mode 100644 index 0000000..caade43 --- /dev/null +++ b/docs/EnvironmentsApi.md @@ -0,0 +1,373 @@ +# EnvironmentsApi + +All URIs are relative to *https://api.configcat.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createEnvironment**](EnvironmentsApi.md#createEnvironment) | **POST** /v1/products/{productId}/environments | Create Environment | +| [**deleteEnvironment**](EnvironmentsApi.md#deleteEnvironment) | **DELETE** /v1/environments/{environmentId} | Delete Environment | +| [**getEnvironment**](EnvironmentsApi.md#getEnvironment) | **GET** /v1/environments/{environmentId} | Get Environment | +| [**getEnvironments**](EnvironmentsApi.md#getEnvironments) | **GET** /v1/products/{productId}/environments | List Environments | +| [**updateEnvironment**](EnvironmentsApi.md#updateEnvironment) | **PUT** /v1/environments/{environmentId} | Update Environment | + + + +# **createEnvironment** +> EnvironmentModel createEnvironment(productId, createEnvironmentModel) + +Create Environment + +This endpoint creates a new Environment in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.EnvironmentsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + EnvironmentsApi apiInstance = new EnvironmentsApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + CreateEnvironmentModel createEnvironmentModel = new CreateEnvironmentModel(); // CreateEnvironmentModel | + try { + EnvironmentModel result = apiInstance.createEnvironment(productId, createEnvironmentModel); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling EnvironmentsApi#createEnvironment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | +| **createEnvironmentModel** | [**CreateEnvironmentModel**](CreateEnvironmentModel.md)| | | + +### Return type + +[**EnvironmentModel**](EnvironmentModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | When the creation was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **deleteEnvironment** +> deleteEnvironment(environmentId, cleanupAuditLogs) + +Delete Environment + +This endpoint removes an Environment identified by the `environmentId` parameter. If the `cleanupAuditLogs` flag is set to true, it also deletes the audit log records related to the environment (except for the `Created a new environment` and `Deleted an environment` records). + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.EnvironmentsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + EnvironmentsApi apiInstance = new EnvironmentsApi(defaultClient); + UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. + Boolean cleanupAuditLogs = true; // Boolean | An optional flag which indicates whether the audit log records related to the environment should be deleted or not. + try { + apiInstance.deleteEnvironment(environmentId, cleanupAuditLogs); + } catch (ApiException e) { + System.err.println("Exception when calling EnvironmentsApi#deleteEnvironment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **environmentId** | **UUID**| The identifier of the Environment. | | +| **cleanupAuditLogs** | **Boolean**| An optional flag which indicates whether the audit log records related to the environment should be deleted or not. | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | When the delete was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getEnvironment** +> EnvironmentModel getEnvironment(environmentId) + +Get Environment + +This endpoint returns the metadata of an Environment identified by the `environmentId`. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.EnvironmentsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + EnvironmentsApi apiInstance = new EnvironmentsApi(defaultClient); + UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. + try { + EnvironmentModel result = apiInstance.getEnvironment(environmentId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling EnvironmentsApi#getEnvironment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **environmentId** | **UUID**| The identifier of the Environment. | | + +### Return type + +[**EnvironmentModel**](EnvironmentModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When everything is ok, the environment data returned. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getEnvironments** +> List<EnvironmentModel> getEnvironments(productId) + +List Environments + +This endpoint returns the list of the Environments that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.EnvironmentsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + EnvironmentsApi apiInstance = new EnvironmentsApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + try { + List result = apiInstance.getEnvironments(productId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling EnvironmentsApi#getEnvironments"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | + +### Return type + +[**List<EnvironmentModel>**](EnvironmentModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **updateEnvironment** +> EnvironmentModel updateEnvironment(environmentId, updateEnvironmentModel) + +Update Environment + +This endpoint updates an Environment identified by the `environmentId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.EnvironmentsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + EnvironmentsApi apiInstance = new EnvironmentsApi(defaultClient); + UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. + UpdateEnvironmentModel updateEnvironmentModel = new UpdateEnvironmentModel(); // UpdateEnvironmentModel | + try { + EnvironmentModel result = apiInstance.updateEnvironment(environmentId, updateEnvironmentModel); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling EnvironmentsApi#updateEnvironment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **environmentId** | **UUID**| The identifier of the Environment. | | +| **updateEnvironmentModel** | [**UpdateEnvironmentModel**](UpdateEnvironmentModel.md)| | | + +### Return type + +[**EnvironmentModel**](EnvironmentModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + diff --git a/docs/EvaluationVersion.md b/docs/EvaluationVersion.md new file mode 100644 index 0000000..dc44b6f --- /dev/null +++ b/docs/EvaluationVersion.md @@ -0,0 +1,13 @@ + + +# EvaluationVersion + +## Enum + + +* `V1` (value: `"v1"`) + +* `V2` (value: `"v2"`) + + + diff --git a/docs/FeatureFlagLimitations.md b/docs/FeatureFlagLimitations.md new file mode 100644 index 0000000..581087a --- /dev/null +++ b/docs/FeatureFlagLimitations.md @@ -0,0 +1,20 @@ + + +# FeatureFlagLimitations + +Subscription limitations regarding Feature flag or Setting values and targeting. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**maxPercentageOptionCount** | **Integer** | Maximum number of percentage options a Feature Flag or Setting can have within a targeting rule. | | +|**maxTargetingRuleCount** | **Integer** | Maximum number of targeting rules a Feature Flag or Setting can have. | | +|**maxComparisonValueLength** | **Integer** | Maximum length of a text comparison value. | | +|**maxComparisonValueListLength** | **Integer** | Maximum item count of a list comparison value. | | +|**maxComparisonValueListItemLength** | **Integer** | Maximum length of a list comparison value's item. | | +|**maxStringFlagValueLength** | **Integer** | Maximum length of a text Setting's value. | | +|**maxConditionPerTargetingRuleCount** | **Integer** | Maximum number of `AND` conditions a Feature Flag or Setting can have within a targeting rule. | | + + + diff --git a/docs/FeatureFlagSettingValuesApi.md b/docs/FeatureFlagSettingValuesApi.md new file mode 100644 index 0000000..4df7cb4 --- /dev/null +++ b/docs/FeatureFlagSettingValuesApi.md @@ -0,0 +1,391 @@ +# FeatureFlagSettingValuesApi + +All URIs are relative to *https://api.configcat.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getSettingValue**](FeatureFlagSettingValuesApi.md#getSettingValue) | **GET** /v1/environments/{environmentId}/settings/{settingId}/value | Get value | +| [**getSettingValues**](FeatureFlagSettingValuesApi.md#getSettingValues) | **GET** /v1/configs/{configId}/environments/{environmentId}/values | Get values | +| [**postSettingValues**](FeatureFlagSettingValuesApi.md#postSettingValues) | **POST** /v1/configs/{configId}/environments/{environmentId}/values | Post values | +| [**replaceSettingValue**](FeatureFlagSettingValuesApi.md#replaceSettingValue) | **PUT** /v1/environments/{environmentId}/settings/{settingId}/value | Replace value | +| [**updateSettingValue**](FeatureFlagSettingValuesApi.md#updateSettingValue) | **PATCH** /v1/environments/{environmentId}/settings/{settingId}/value | Update value | + + + +# **getSettingValue** +> SettingValueModel getSettingValue(environmentId, settingId) + +Get value + +This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the `environmentId` parameter. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview). + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + FeatureFlagSettingValuesApi apiInstance = new FeatureFlagSettingValuesApi(defaultClient); + UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. + Integer settingId = 56; // Integer | The id of the Setting. + try { + SettingValueModel result = apiInstance.getSettingValue(environmentId, settingId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagSettingValuesApi#getSettingValue"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **environmentId** | **UUID**| The identifier of the Environment. | | +| **settingId** | **Integer**| The id of the Setting. | | + +### Return type + +[**SettingValueModel**](SettingValueModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When everything is ok, the setting value data returned. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getSettingValues** +> ConfigSettingValuesModel getSettingValues(configId, environmentId) + +Get values + +This endpoint returns the value of a specified Config's Feature Flags or Settings identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + FeatureFlagSettingValuesApi apiInstance = new FeatureFlagSettingValuesApi(defaultClient); + UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. + UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. + try { + ConfigSettingValuesModel result = apiInstance.getSettingValues(configId, environmentId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagSettingValuesApi#getSettingValues"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **configId** | **UUID**| The identifier of the Config. | | +| **environmentId** | **UUID**| The identifier of the Environment. | | + +### Return type + +[**ConfigSettingValuesModel**](ConfigSettingValuesModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When everything is ok, the setting values returned. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **postSettingValues** +> ConfigSettingValuesModel postSettingValues(configId, environmentId, updateSettingValuesWithIdModel, reason) + +Post values + +This endpoint replaces the values of a specified Config's Feature Flags or Settings identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"settingValues\": [ { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false, \"settingId\": 1 } ] } ``` If we send a replace request body as below: ```json { \"settingValues\": [ { \"value\": true, \"settingId\": 1 } ] } ``` Then besides that the default value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"settingValues\": [ { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true, \"setting\": { \"settingId\": 1 } } ] } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + FeatureFlagSettingValuesApi apiInstance = new FeatureFlagSettingValuesApi(defaultClient); + UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. + UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. + UpdateSettingValuesWithIdModel updateSettingValuesWithIdModel = new UpdateSettingValuesWithIdModel(); // UpdateSettingValuesWithIdModel | + String reason = "reason_example"; // String | The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. + try { + ConfigSettingValuesModel result = apiInstance.postSettingValues(configId, environmentId, updateSettingValuesWithIdModel, reason); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagSettingValuesApi#postSettingValues"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **configId** | **UUID**| The identifier of the Config. | | +| **environmentId** | **UUID**| The identifier of the Environment. | | +| **updateSettingValuesWithIdModel** | [**UpdateSettingValuesWithIdModel**](UpdateSettingValuesWithIdModel.md)| | | +| **reason** | **String**| The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. | [optional] | + +### Return type + +[**ConfigSettingValuesModel**](ConfigSettingValuesModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When everything is ok, the updated setting values returned. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **replaceSettingValue** +> SettingValueModel replaceSettingValue(environmentId, settingId, updateSettingValueModel, reason) + +Replace value + +This endpoint replaces the whole value of a Feature Flag or Setting in a specified Environment. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send a replace request body as below: ```json { \"value\": true } ``` Then besides that the default value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + FeatureFlagSettingValuesApi apiInstance = new FeatureFlagSettingValuesApi(defaultClient); + UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. + Integer settingId = 56; // Integer | The id of the Setting. + UpdateSettingValueModel updateSettingValueModel = new UpdateSettingValueModel(); // UpdateSettingValueModel | + String reason = "reason_example"; // String | The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. + try { + SettingValueModel result = apiInstance.replaceSettingValue(environmentId, settingId, updateSettingValueModel, reason); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagSettingValuesApi#replaceSettingValue"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **environmentId** | **UUID**| The identifier of the Environment. | | +| **settingId** | **Integer**| The id of the Setting. | | +| **updateSettingValueModel** | [**UpdateSettingValueModel**](UpdateSettingValueModel.md)| | | +| **reason** | **String**| The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. | [optional] | + +### Return type + +[**SettingValueModel**](SettingValueModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **updateSettingValue** +> SettingValueModel updateSettingValue(environmentId, settingId, jsonPatchOperation, reason) + +Update value + +This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/value\", \"value\": true } ] ``` Only the default value is going to be set to `true` and all the Percentage Rules are remaining unchanged. So we get a response like this: ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": true } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + FeatureFlagSettingValuesApi apiInstance = new FeatureFlagSettingValuesApi(defaultClient); + UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. + Integer settingId = 56; // Integer | The id of the Setting. + List jsonPatchOperation = Arrays.asList(); // List | + String reason = "reason_example"; // String | The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. + try { + SettingValueModel result = apiInstance.updateSettingValue(environmentId, settingId, jsonPatchOperation, reason); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagSettingValuesApi#updateSettingValue"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **environmentId** | **UUID**| The identifier of the Environment. | | +| **settingId** | **Integer**| The id of the Setting. | | +| **jsonPatchOperation** | [**List<JsonPatchOperation>**](JsonPatchOperation.md)| | | +| **reason** | **String**| The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. | [optional] | + +### Return type + +[**SettingValueModel**](SettingValueModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When the patch was successful. | - | +| **204** | When no change applied on the resource. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + diff --git a/docs/FeatureFlagSettingValuesUsingSdkKeyApi.md b/docs/FeatureFlagSettingValuesUsingSdkKeyApi.md new file mode 100644 index 0000000..669056c --- /dev/null +++ b/docs/FeatureFlagSettingValuesUsingSdkKeyApi.md @@ -0,0 +1,239 @@ +# FeatureFlagSettingValuesUsingSdkKeyApi + +All URIs are relative to *https://api.configcat.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getSettingValueBySdkkey**](FeatureFlagSettingValuesUsingSdkKeyApi.md#getSettingValueBySdkkey) | **GET** /v1/settings/{settingKeyOrId}/value | Get value | +| [**replaceSettingValueBySdkkey**](FeatureFlagSettingValuesUsingSdkKeyApi.md#replaceSettingValueBySdkkey) | **PUT** /v1/settings/{settingKeyOrId}/value | Replace value | +| [**updateSettingValueBySdkkey**](FeatureFlagSettingValuesUsingSdkKeyApi.md#updateSettingValueBySdkkey) | **PATCH** /v1/settings/{settingKeyOrId}/value | Update value | + + + +# **getSettingValueBySdkkey** +> SettingValueModel getSettingValueBySdkkey(settingKeyOrId, X_CONFIGCAT_SDKKEY) + +Get value + +This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesUsingSdkKeyApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + FeatureFlagSettingValuesUsingSdkKeyApi apiInstance = new FeatureFlagSettingValuesUsingSdkKeyApi(defaultClient); + String settingKeyOrId = "settingKeyOrId_example"; // String | The key or id of the Setting. + String X_CONFIGCAT_SDKKEY = "X_CONFIGCAT_SDKKEY_example"; // String | The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) + try { + SettingValueModel result = apiInstance.getSettingValueBySdkkey(settingKeyOrId, X_CONFIGCAT_SDKKEY); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagSettingValuesUsingSdkKeyApi#getSettingValueBySdkkey"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **settingKeyOrId** | **String**| The key or id of the Setting. | | +| **X_CONFIGCAT_SDKKEY** | **String**| The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) | [optional] | + +### Return type + +[**SettingValueModel**](SettingValueModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **replaceSettingValueBySdkkey** +> SettingValueModel replaceSettingValueBySdkkey(settingKeyOrId, updateSettingValueModel, reason, X_CONFIGCAT_SDKKEY) + +Replace value + +This endpoint replaces the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send a replace request body as below: ```json { \"value\": true } ``` Then besides that the default served value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true } ``` + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesUsingSdkKeyApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + FeatureFlagSettingValuesUsingSdkKeyApi apiInstance = new FeatureFlagSettingValuesUsingSdkKeyApi(defaultClient); + String settingKeyOrId = "settingKeyOrId_example"; // String | The key or id of the Setting. + UpdateSettingValueModel updateSettingValueModel = new UpdateSettingValueModel(); // UpdateSettingValueModel | + String reason = "reason_example"; // String | The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. + String X_CONFIGCAT_SDKKEY = "X_CONFIGCAT_SDKKEY_example"; // String | The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) + try { + SettingValueModel result = apiInstance.replaceSettingValueBySdkkey(settingKeyOrId, updateSettingValueModel, reason, X_CONFIGCAT_SDKKEY); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagSettingValuesUsingSdkKeyApi#replaceSettingValueBySdkkey"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **settingKeyOrId** | **String**| The key or id of the Setting. | | +| **updateSettingValueModel** | [**UpdateSettingValueModel**](UpdateSettingValueModel.md)| | | +| **reason** | **String**| The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. | [optional] | +| **X_CONFIGCAT_SDKKEY** | **String**| The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) | [optional] | + +### Return type + +[**SettingValueModel**](SettingValueModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **updateSettingValueBySdkkey** +> SettingValueModel updateSettingValueBySdkkey(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY) + +Update value + +This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/value\", \"value\": true } ] ``` Only the default served value is going to be set to `true` and all the Percentage Rules are remaining unchanged. So we get a response like this: ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": true } ``` + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesUsingSdkKeyApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + FeatureFlagSettingValuesUsingSdkKeyApi apiInstance = new FeatureFlagSettingValuesUsingSdkKeyApi(defaultClient); + String settingKeyOrId = "settingKeyOrId_example"; // String | The key or id of the Setting. + List jsonPatchOperation = Arrays.asList(); // List | + String reason = "reason_example"; // String | The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. + String X_CONFIGCAT_SDKKEY = "X_CONFIGCAT_SDKKEY_example"; // String | The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) + try { + SettingValueModel result = apiInstance.updateSettingValueBySdkkey(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagSettingValuesUsingSdkKeyApi#updateSettingValueBySdkkey"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **settingKeyOrId** | **String**| The key or id of the Setting. | | +| **jsonPatchOperation** | [**List<JsonPatchOperation>**](JsonPatchOperation.md)| | | +| **reason** | **String**| The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. | [optional] | +| **X_CONFIGCAT_SDKKEY** | **String**| The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) | [optional] | + +### Return type + +[**SettingValueModel**](SettingValueModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **204** | When no change applied on the resource. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + diff --git a/docs/FeatureFlagSettingValuesUsingSdkKeyV2Api.md b/docs/FeatureFlagSettingValuesUsingSdkKeyV2Api.md new file mode 100644 index 0000000..b81bc51 --- /dev/null +++ b/docs/FeatureFlagSettingValuesUsingSdkKeyV2Api.md @@ -0,0 +1,239 @@ +# FeatureFlagSettingValuesUsingSdkKeyV2Api + +All URIs are relative to *https://api.configcat.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getSettingValueBySdkkeyV2**](FeatureFlagSettingValuesUsingSdkKeyV2Api.md#getSettingValueBySdkkeyV2) | **GET** /v2/settings/{settingKeyOrId}/value | Get value | +| [**replaceSettingValueBySdkkeyV2**](FeatureFlagSettingValuesUsingSdkKeyV2Api.md#replaceSettingValueBySdkkeyV2) | **PUT** /v2/settings/{settingKeyOrId}/value | Replace value | +| [**updateSettingValueBySdkkeyV2**](FeatureFlagSettingValuesUsingSdkKeyV2Api.md#updateSettingValueBySdkkeyV2) | **PATCH** /v2/settings/{settingKeyOrId}/value | Update value | + + + +# **getSettingValueBySdkkeyV2** +> SettingFormulaModel getSettingValueBySdkkeyV2(settingKeyOrId, X_CONFIGCAT_SDKKEY) + +Get value + +This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. The most important fields in the response are the `defaultValue`, `targetingRules`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used at the [percentage evaluation](https://configcat.com/docs/advanced/targeting/#anatomy-of-the-percentage-based-targeting) of the Feature Flag or Setting. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesUsingSdkKeyV2Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + FeatureFlagSettingValuesUsingSdkKeyV2Api apiInstance = new FeatureFlagSettingValuesUsingSdkKeyV2Api(defaultClient); + String settingKeyOrId = "settingKeyOrId_example"; // String | The key or id of the Setting. + String X_CONFIGCAT_SDKKEY = "X_CONFIGCAT_SDKKEY_example"; // String | The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) + try { + SettingFormulaModel result = apiInstance.getSettingValueBySdkkeyV2(settingKeyOrId, X_CONFIGCAT_SDKKEY); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagSettingValuesUsingSdkKeyV2Api#getSettingValueBySdkkeyV2"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **settingKeyOrId** | **String**| The key or id of the Setting. | | +| **X_CONFIGCAT_SDKKEY** | **String**| The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) | [optional] | + +### Return type + +[**SettingFormulaModel**](SettingFormulaModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **replaceSettingValueBySdkkeyV2** +> SettingFormulaModel replaceSettingValueBySdkkeyV2(settingKeyOrId, updateEvaluationFormulaModel, reason, X_CONFIGCAT_SDKKEY) + +Replace value + +This endpoint replaces the value and the Targeting Rules of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other field that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send a replace request body as below: ```json { \"defaultValue\": { \"boolValue\": true } } ``` Then besides that the default served value is set to `true`, all the Targeting Rules are deleted. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": true }, \"targetingRules\": [] } ``` + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesUsingSdkKeyV2Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + FeatureFlagSettingValuesUsingSdkKeyV2Api apiInstance = new FeatureFlagSettingValuesUsingSdkKeyV2Api(defaultClient); + String settingKeyOrId = "settingKeyOrId_example"; // String | The key or id of the Setting. + UpdateEvaluationFormulaModel updateEvaluationFormulaModel = new UpdateEvaluationFormulaModel(); // UpdateEvaluationFormulaModel | + String reason = "reason_example"; // String | The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. + String X_CONFIGCAT_SDKKEY = "X_CONFIGCAT_SDKKEY_example"; // String | The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) + try { + SettingFormulaModel result = apiInstance.replaceSettingValueBySdkkeyV2(settingKeyOrId, updateEvaluationFormulaModel, reason, X_CONFIGCAT_SDKKEY); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagSettingValuesUsingSdkKeyV2Api#replaceSettingValueBySdkkeyV2"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **settingKeyOrId** | **String**| The key or id of the Setting. | | +| **updateEvaluationFormulaModel** | [**UpdateEvaluationFormulaModel**](UpdateEvaluationFormulaModel.md)| | | +| **reason** | **String**| The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. | [optional] | +| **X_CONFIGCAT_SDKKEY** | **String**| The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) | [optional] | + +### Return type + +[**SettingFormulaModel**](SettingFormulaModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **updateSettingValueBySdkkeyV2** +> SettingFormulaModel updateSettingValueBySdkkeyV2(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY) + +Update value + +This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/targetingRules/0/value/boolValue\", \"value\": true } ] ``` Only the first Targeting Rule's `value` is going to be set to `false` and all the other fields are remaining unchanged. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": false } } ] } ``` + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesUsingSdkKeyV2Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + FeatureFlagSettingValuesUsingSdkKeyV2Api apiInstance = new FeatureFlagSettingValuesUsingSdkKeyV2Api(defaultClient); + String settingKeyOrId = "settingKeyOrId_example"; // String | The key or id of the Setting. + List jsonPatchOperation = Arrays.asList(); // List | + String reason = "reason_example"; // String | The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. + String X_CONFIGCAT_SDKKEY = "X_CONFIGCAT_SDKKEY_example"; // String | The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) + try { + SettingFormulaModel result = apiInstance.updateSettingValueBySdkkeyV2(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagSettingValuesUsingSdkKeyV2Api#updateSettingValueBySdkkeyV2"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **settingKeyOrId** | **String**| The key or id of the Setting. | | +| **jsonPatchOperation** | [**List<JsonPatchOperation>**](JsonPatchOperation.md)| | | +| **reason** | **String**| The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. | [optional] | +| **X_CONFIGCAT_SDKKEY** | **String**| The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) | [optional] | + +### Return type + +[**SettingFormulaModel**](SettingFormulaModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **204** | When no change applied on the resource. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + diff --git a/docs/FeatureFlagSettingValuesV2Api.md b/docs/FeatureFlagSettingValuesV2Api.md new file mode 100644 index 0000000..c26e24e --- /dev/null +++ b/docs/FeatureFlagSettingValuesV2Api.md @@ -0,0 +1,391 @@ +# FeatureFlagSettingValuesV2Api + +All URIs are relative to *https://api.configcat.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getSettingValueV2**](FeatureFlagSettingValuesV2Api.md#getSettingValueV2) | **GET** /v2/environments/{environmentId}/settings/{settingId}/value | Get value | +| [**getSettingValuesV2**](FeatureFlagSettingValuesV2Api.md#getSettingValuesV2) | **GET** /v2/configs/{configId}/environments/{environmentId}/values | Get values | +| [**postSettingValuesV2**](FeatureFlagSettingValuesV2Api.md#postSettingValuesV2) | **POST** /v2/configs/{configId}/environments/{environmentId}/values | Post values | +| [**replaceSettingValueV2**](FeatureFlagSettingValuesV2Api.md#replaceSettingValueV2) | **PUT** /v2/environments/{environmentId}/settings/{settingId}/value | Replace value | +| [**updateSettingValueV2**](FeatureFlagSettingValuesV2Api.md#updateSettingValueV2) | **PATCH** /v2/environments/{environmentId}/settings/{settingId}/value | Update value | + + + +# **getSettingValueV2** +> SettingFormulaModel getSettingValueV2(environmentId, settingId) + +Get value + +This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the `environmentId` parameter. The most important fields in the response are the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used for [percentage evaluation](https://configcat.com/docs/targeting/percentage-options/) of the Feature Flag or Setting. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesV2Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + FeatureFlagSettingValuesV2Api apiInstance = new FeatureFlagSettingValuesV2Api(defaultClient); + UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. + Integer settingId = 56; // Integer | The id of the Setting. + try { + SettingFormulaModel result = apiInstance.getSettingValueV2(environmentId, settingId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagSettingValuesV2Api#getSettingValueV2"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **environmentId** | **UUID**| The identifier of the Environment. | | +| **settingId** | **Integer**| The id of the Setting. | | + +### Return type + +[**SettingFormulaModel**](SettingFormulaModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When everything is ok, the setting value data returned. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getSettingValuesV2** +> ConfigSettingFormulasModel getSettingValuesV2(configId, environmentId) + +Get values + +This endpoint returns all Feature Flag and Setting values of a Config identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. The most important fields in the response are the `defaultValue`, `targetingRules`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used for [percentage evaluation](https://configcat.com/docs/targeting/percentage-options/) of the Feature Flag or Setting. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesV2Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + FeatureFlagSettingValuesV2Api apiInstance = new FeatureFlagSettingValuesV2Api(defaultClient); + UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. + UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. + try { + ConfigSettingFormulasModel result = apiInstance.getSettingValuesV2(configId, environmentId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagSettingValuesV2Api#getSettingValuesV2"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **configId** | **UUID**| The identifier of the Config. | | +| **environmentId** | **UUID**| The identifier of the Environment. | | + +### Return type + +[**ConfigSettingFormulasModel**](ConfigSettingFormulasModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When everything is ok, the setting values returned. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **postSettingValuesV2** +> ConfigSettingFormulasModel postSettingValuesV2(configId, environmentId, updateEvaluationFormulasModel, reason) + +Post values + +This endpoint batch updates the Feature Flags and Settings of a Config identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. Only those Feature Flags and Settings are updated which are part of the request, all the others are left untouched. **Important:** As this endpoint is doing a complete replace on those Feature Flags and Settings, which are set in the request. It's important to set every other field that you don't want to change in its original state. Not listing a field means that it will reset. For example: We have the following resource of a Feature Flag. ```json { \"settingFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ], \"settingId\": 1 } ] } ``` If we send a batch replace request body as below: ```json { \"updateFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"settingId\": 1 } ] } ``` Then besides that the default value is set to `true`, all Targeting Rules of the related Feature Flag are deleted. So we get a response like this: ```json { \"settingFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [], \"setting\": { \"settingId\": 1 } } ] } ``` + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesV2Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + FeatureFlagSettingValuesV2Api apiInstance = new FeatureFlagSettingValuesV2Api(defaultClient); + UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. + UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. + UpdateEvaluationFormulasModel updateEvaluationFormulasModel = new UpdateEvaluationFormulasModel(); // UpdateEvaluationFormulasModel | + String reason = "reason_example"; // String | The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. + try { + ConfigSettingFormulasModel result = apiInstance.postSettingValuesV2(configId, environmentId, updateEvaluationFormulasModel, reason); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagSettingValuesV2Api#postSettingValuesV2"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **configId** | **UUID**| The identifier of the Config. | | +| **environmentId** | **UUID**| The identifier of the Environment. | | +| **updateEvaluationFormulasModel** | [**UpdateEvaluationFormulasModel**](UpdateEvaluationFormulasModel.md)| | | +| **reason** | **String**| The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. | [optional] | + +### Return type + +[**ConfigSettingFormulasModel**](ConfigSettingFormulasModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When everything is ok, the updated setting values returned. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **replaceSettingValueV2** +> SettingFormulaModel replaceSettingValueV2(environmentId, settingId, updateEvaluationFormulaModel, reason) + +Replace value + +This endpoint replaces the value and the Targeting Rules of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other field that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send a replace request body as below: ```json { \"defaultValue\": { \"boolValue\": true } } ``` Then besides that the default served value is set to `true`, all the Targeting Rules are deleted. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": true }, \"targetingRules\": [] } ``` + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesV2Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + FeatureFlagSettingValuesV2Api apiInstance = new FeatureFlagSettingValuesV2Api(defaultClient); + UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. + Integer settingId = 56; // Integer | The id of the Setting. + UpdateEvaluationFormulaModel updateEvaluationFormulaModel = new UpdateEvaluationFormulaModel(); // UpdateEvaluationFormulaModel | + String reason = "reason_example"; // String | The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. + try { + SettingFormulaModel result = apiInstance.replaceSettingValueV2(environmentId, settingId, updateEvaluationFormulaModel, reason); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagSettingValuesV2Api#replaceSettingValueV2"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **environmentId** | **UUID**| The identifier of the Environment. | | +| **settingId** | **Integer**| The id of the Setting. | | +| **updateEvaluationFormulaModel** | [**UpdateEvaluationFormulaModel**](UpdateEvaluationFormulaModel.md)| | | +| **reason** | **String**| The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. | [optional] | + +### Return type + +[**SettingFormulaModel**](SettingFormulaModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **updateSettingValueV2** +> SettingFormulaModel updateSettingValueV2(environmentId, settingId, jsonPatchOperation, reason) + +Update value + +This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/targetingRules/0/value/boolValue\", \"value\": true } ] ``` Only the first Targeting Rule's `value` is going to be set to `false` and all the other fields are remaining unchanged. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": false } } ] } ``` + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.FeatureFlagSettingValuesV2Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + FeatureFlagSettingValuesV2Api apiInstance = new FeatureFlagSettingValuesV2Api(defaultClient); + UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. + Integer settingId = 56; // Integer | The id of the Setting. + List jsonPatchOperation = Arrays.asList(); // List | + String reason = "reason_example"; // String | The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. + try { + SettingFormulaModel result = apiInstance.updateSettingValueV2(environmentId, settingId, jsonPatchOperation, reason); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagSettingValuesV2Api#updateSettingValueV2"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **environmentId** | **UUID**| The identifier of the Environment. | | +| **settingId** | **Integer**| The id of the Setting. | | +| **jsonPatchOperation** | [**List<JsonPatchOperation>**](JsonPatchOperation.md)| | | +| **reason** | **String**| The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. | [optional] | + +### Return type + +[**SettingFormulaModel**](SettingFormulaModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When the patch was successful. | - | +| **204** | When no change applied on the resource. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + diff --git a/docs/FeatureFlagsSettingsApi.md b/docs/FeatureFlagsSettingsApi.md new file mode 100644 index 0000000..ae72c05 --- /dev/null +++ b/docs/FeatureFlagsSettingsApi.md @@ -0,0 +1,445 @@ +# FeatureFlagsSettingsApi + +All URIs are relative to *https://api.configcat.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createSetting**](FeatureFlagsSettingsApi.md#createSetting) | **POST** /v1/configs/{configId}/settings | Create Flag | +| [**deleteSetting**](FeatureFlagsSettingsApi.md#deleteSetting) | **DELETE** /v1/settings/{settingId} | Delete Flag | +| [**getSetting**](FeatureFlagsSettingsApi.md#getSetting) | **GET** /v1/settings/{settingId} | Get Flag | +| [**getSettings**](FeatureFlagsSettingsApi.md#getSettings) | **GET** /v1/configs/{configId}/settings | List Flags | +| [**replaceSetting**](FeatureFlagsSettingsApi.md#replaceSetting) | **PUT** /v1/settings/{settingId} | Replace Flag | +| [**updateSetting**](FeatureFlagsSettingsApi.md#updateSetting) | **PATCH** /v1/settings/{settingId} | Update Flag | + + + +# **createSetting** +> SettingModel createSetting(configId, createSettingInitialValues) + +Create Flag + +This endpoint creates a new Feature Flag or Setting in a specified Config identified by the `configId` parameter. **Important:** The `key` attribute must be unique within the given Config. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.FeatureFlagsSettingsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + FeatureFlagsSettingsApi apiInstance = new FeatureFlagsSettingsApi(defaultClient); + UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. + CreateSettingInitialValues createSettingInitialValues = new CreateSettingInitialValues(); // CreateSettingInitialValues | + try { + SettingModel result = apiInstance.createSetting(configId, createSettingInitialValues); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagsSettingsApi#createSetting"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **configId** | **UUID**| The identifier of the Config. | | +| **createSettingInitialValues** | [**CreateSettingInitialValues**](CreateSettingInitialValues.md)| | | + +### Return type + +[**SettingModel**](SettingModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | When the creation was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **deleteSetting** +> deleteSetting(settingId) + +Delete Flag + +This endpoint removes a Feature Flag or Setting from a specified Config, identified by the `configId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.FeatureFlagsSettingsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + FeatureFlagsSettingsApi apiInstance = new FeatureFlagsSettingsApi(defaultClient); + Integer settingId = 56; // Integer | The identifier of the Setting. + try { + apiInstance.deleteSetting(settingId); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagsSettingsApi#deleteSetting"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **settingId** | **Integer**| The identifier of the Setting. | | + +### Return type + +null (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | When the delete was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getSetting** +> SettingModel getSetting(settingId) + +Get Flag + +This endpoint returns the metadata attributes of a Feature Flag or Setting identified by the `settingId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.FeatureFlagsSettingsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + FeatureFlagsSettingsApi apiInstance = new FeatureFlagsSettingsApi(defaultClient); + Integer settingId = 56; // Integer | The identifier of the Setting. + try { + SettingModel result = apiInstance.getSetting(settingId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagsSettingsApi#getSetting"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **settingId** | **Integer**| The identifier of the Setting. | | + +### Return type + +[**SettingModel**](SettingModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When everything is ok, the setting data returned. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getSettings** +> List<SettingModel> getSettings(configId) + +List Flags + +This endpoint returns the list of the Feature Flags and Settings defined in a specified Config, identified by the `configId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.FeatureFlagsSettingsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + FeatureFlagsSettingsApi apiInstance = new FeatureFlagsSettingsApi(defaultClient); + UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. + try { + List result = apiInstance.getSettings(configId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagsSettingsApi#getSettings"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **configId** | **UUID**| The identifier of the Config. | | + +### Return type + +[**List<SettingModel>**](SettingModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **replaceSetting** +> SettingModel replaceSetting(settingId, replaceSettingModel) + +Replace Flag + +This endpoint replaces the whole value of a Feature Flag or Setting identified by the `settingId` parameter. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.FeatureFlagsSettingsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + FeatureFlagsSettingsApi apiInstance = new FeatureFlagsSettingsApi(defaultClient); + Integer settingId = 56; // Integer | The identifier of the Setting. + ReplaceSettingModel replaceSettingModel = new ReplaceSettingModel(); // ReplaceSettingModel | + try { + SettingModel result = apiInstance.replaceSetting(settingId, replaceSettingModel); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagsSettingsApi#replaceSetting"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **settingId** | **Integer**| The identifier of the Setting. | | +| **replaceSettingModel** | [**ReplaceSettingModel**](ReplaceSettingModel.md)| | | + +### Return type + +[**SettingModel**](SettingModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When the replace was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **updateSetting** +> SettingModel updateSetting(settingId, jsonPatchOperation) + +Update Flag + +This endpoint updates the metadata of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Config. Only the `name`, `hint` and `tags` attributes are modifiable by this endpoint. The `tags` attribute is a simple collection of the [tag IDs](#operation/get-tags) attached to the given setting. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. For example: We have the following resource. ```json { \"settingId\": 5345, \"key\": \"myGrandFeature\", \"name\": \"Tihs is a naem with soem typos.\", \"hint\": \"This flag controls my grandioso feature.\", \"settingType\": \"boolean\", \"tags\": [ { \"tagId\": 0, \"name\": \"sample tag\", \"color\": \"whale\" } ] } ``` If we send an update request body as below (it changes the `name` and adds the already existing tag with the id `2`): ```json [ { \"op\": \"replace\", \"path\": \"/name\", \"value\": \"This is the name without typos.\" }, { \"op\": \"add\", \"path\": \"/tags/-\", \"value\": 2 } ] ``` Only the `name` and `tags` are updated and all the other attributes remain unchanged. So we get a response like this: ```json { \"settingId\": 5345, \"key\": \"myGrandFeature\", \"name\": \"This is the name without typos.\", \"hint\": \"This flag controls my grandioso feature.\", \"settingType\": \"boolean\", \"tags\": [ { \"tagId\": 0, \"name\": \"sample tag\", \"color\": \"whale\" }, { \"tagId\": 2, \"name\": \"another tag\", \"color\": \"koala\" } ] } ``` + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.FeatureFlagsSettingsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + FeatureFlagsSettingsApi apiInstance = new FeatureFlagsSettingsApi(defaultClient); + Integer settingId = 56; // Integer | The identifier of the Setting. + List jsonPatchOperation = Arrays.asList(); // List | + try { + SettingModel result = apiInstance.updateSetting(settingId, jsonPatchOperation); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagsSettingsApi#updateSetting"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **settingId** | **Integer**| The identifier of the Setting. | | +| **jsonPatchOperation** | [**List<JsonPatchOperation>**](JsonPatchOperation.md)| | | + +### Return type + +[**SettingModel**](SettingModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When the update was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + diff --git a/docs/FlagReference.md b/docs/FlagReference.md new file mode 100644 index 0000000..3301d48 --- /dev/null +++ b/docs/FlagReference.md @@ -0,0 +1,14 @@ + + +# FlagReference + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**settingId** | **Integer** | The identifier of the Feature Flag or Setting the code reference belongs to. | | +|**references** | [**List<ReferenceLinesRequest>**](ReferenceLinesRequest.md) | The actual references to the given Feature Flag or Setting. | | + + + diff --git a/docs/InitialValue.md b/docs/InitialValue.md new file mode 100644 index 0000000..40218bd --- /dev/null +++ b/docs/InitialValue.md @@ -0,0 +1,14 @@ + + +# InitialValue + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**environmentId** | **UUID** | The ID of the Environment where the initial value must be set. | [optional] | +|**value** | [**SettingValueType**](SettingValueType.md) | The initial value in the given Environment. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. | | + + + diff --git a/docs/IntegrationLinkDetail.md b/docs/IntegrationLinkDetail.md new file mode 100644 index 0000000..ed85b8d --- /dev/null +++ b/docs/IntegrationLinkDetail.md @@ -0,0 +1,18 @@ + + +# IntegrationLinkDetail + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**product** | [**ProductModel**](ProductModel.md) | | | +|**config** | [**ConfigModel**](ConfigModel.md) | | | +|**environment** | [**EnvironmentModel**](EnvironmentModel.md) | | | +|**setting** | [**SettingDataModel**](SettingDataModel.md) | | | +|**readOnly** | **Boolean** | | | +|**status** | **String** | | | + + + diff --git a/docs/IntegrationLinkDetailsModel.md b/docs/IntegrationLinkDetailsModel.md new file mode 100644 index 0000000..7f6a401 --- /dev/null +++ b/docs/IntegrationLinkDetailsModel.md @@ -0,0 +1,14 @@ + + +# IntegrationLinkDetailsModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**details** | [**List<IntegrationLinkDetail>**](IntegrationLinkDetail.md) | | [readonly] | +|**allIntegrationLinkCount** | **Integer** | | | + + + diff --git a/docs/IntegrationLinkModel.md b/docs/IntegrationLinkModel.md new file mode 100644 index 0000000..6d69a1c --- /dev/null +++ b/docs/IntegrationLinkModel.md @@ -0,0 +1,16 @@ + + +# IntegrationLinkModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**key** | **String** | | | +|**description** | **String** | | | +|**integrationLinkType** | **IntegrationLinkType** | | | +|**url** | **String** | | | + + + diff --git a/docs/IntegrationLinkType.md b/docs/IntegrationLinkType.md new file mode 100644 index 0000000..20d1589 --- /dev/null +++ b/docs/IntegrationLinkType.md @@ -0,0 +1,15 @@ + + +# IntegrationLinkType + +## Enum + + +* `TRELLO` (value: `"trello"`) + +* `JIRA` (value: `"jira"`) + +* `MONDAY` (value: `"monday"`) + + + diff --git a/docs/IntegrationLinksApi.md b/docs/IntegrationLinksApi.md new file mode 100644 index 0000000..1e44563 --- /dev/null +++ b/docs/IntegrationLinksApi.md @@ -0,0 +1,383 @@ +# IntegrationLinksApi + +All URIs are relative to *https://api.configcat.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addOrUpdateIntegrationLink**](IntegrationLinksApi.md#addOrUpdateIntegrationLink) | **POST** /v1/environments/{environmentId}/settings/{settingId}/integrationLinks/{integrationLinkType}/{key} | Add or update Integration link | +| [**deleteIntegrationLink**](IntegrationLinksApi.md#deleteIntegrationLink) | **DELETE** /v1/environments/{environmentId}/settings/{settingId}/integrationLinks/{integrationLinkType}/{key} | Delete Integration link | +| [**getIntegrationLinkDetails**](IntegrationLinksApi.md#getIntegrationLinkDetails) | **GET** /v1/integrationLink/{integrationLinkType}/{key}/details | Get Integration link | +| [**jiraAddOrUpdateIntegrationLink**](IntegrationLinksApi.md#jiraAddOrUpdateIntegrationLink) | **POST** /v1/jira/environments/{environmentId}/settings/{settingId}/integrationLinks/{key} | | +| [**jiraConnect**](IntegrationLinksApi.md#jiraConnect) | **POST** /v1/jira/connect | | + + + +# **addOrUpdateIntegrationLink** +> IntegrationLinkModel addOrUpdateIntegrationLink(environmentId, settingId, integrationLinkType, key, addOrUpdateIntegrationLinkModel) + +Add or update Integration link + + + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.IntegrationLinksApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + IntegrationLinksApi apiInstance = new IntegrationLinksApi(defaultClient); + UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. + Integer settingId = 56; // Integer | The id of the Setting. + IntegrationLinkType integrationLinkType = IntegrationLinkType.fromValue("trello"); // IntegrationLinkType | The integration link's type. + String key = "key_example"; // String | The key of the integration link. + AddOrUpdateIntegrationLinkModel addOrUpdateIntegrationLinkModel = new AddOrUpdateIntegrationLinkModel(); // AddOrUpdateIntegrationLinkModel | + try { + IntegrationLinkModel result = apiInstance.addOrUpdateIntegrationLink(environmentId, settingId, integrationLinkType, key, addOrUpdateIntegrationLinkModel); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IntegrationLinksApi#addOrUpdateIntegrationLink"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **environmentId** | **UUID**| The identifier of the Environment. | | +| **settingId** | **Integer**| The id of the Setting. | | +| **integrationLinkType** | [**IntegrationLinkType**](.md)| The integration link's type. | [enum: trello, jira, monday] | +| **key** | **String**| The key of the integration link. | | +| **addOrUpdateIntegrationLinkModel** | [**AddOrUpdateIntegrationLinkModel**](AddOrUpdateIntegrationLinkModel.md)| | [optional] | + +### Return type + +[**IntegrationLinkModel**](IntegrationLinkModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When everything is ok, the integration link data returned. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **deleteIntegrationLink** +> DeleteIntegrationLinkModel deleteIntegrationLink(environmentId, settingId, integrationLinkType, key) + +Delete Integration link + + + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.IntegrationLinksApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + IntegrationLinksApi apiInstance = new IntegrationLinksApi(defaultClient); + UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. + Integer settingId = 56; // Integer | The id of the Setting. + IntegrationLinkType integrationLinkType = IntegrationLinkType.fromValue("trello"); // IntegrationLinkType | The integration's type. + String key = "key_example"; // String | The key of the integration link. + try { + DeleteIntegrationLinkModel result = apiInstance.deleteIntegrationLink(environmentId, settingId, integrationLinkType, key); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IntegrationLinksApi#deleteIntegrationLink"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **environmentId** | **UUID**| The identifier of the Environment. | | +| **settingId** | **Integer**| The id of the Setting. | | +| **integrationLinkType** | [**IntegrationLinkType**](.md)| The integration's type. | [enum: trello, jira, monday] | +| **key** | **String**| The key of the integration link. | | + +### Return type + +[**DeleteIntegrationLinkModel**](DeleteIntegrationLinkModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When everything is ok. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getIntegrationLinkDetails** +> IntegrationLinkDetailsModel getIntegrationLinkDetails(integrationLinkType, key) + +Get Integration link + + + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.IntegrationLinksApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + IntegrationLinksApi apiInstance = new IntegrationLinksApi(defaultClient); + IntegrationLinkType integrationLinkType = IntegrationLinkType.fromValue("trello"); // IntegrationLinkType | The integration link's type. + String key = "key_example"; // String | The key of the integration link. + try { + IntegrationLinkDetailsModel result = apiInstance.getIntegrationLinkDetails(integrationLinkType, key); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IntegrationLinksApi#getIntegrationLinkDetails"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **integrationLinkType** | [**IntegrationLinkType**](.md)| The integration link's type. | [enum: trello, jira, monday] | +| **key** | **String**| The key of the integration link. | | + +### Return type + +[**IntegrationLinkDetailsModel**](IntegrationLinkDetailsModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When everything is ok, the details for the integration link returned. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **jiraAddOrUpdateIntegrationLink** +> IntegrationLinkModel jiraAddOrUpdateIntegrationLink(environmentId, settingId, key, addOrUpdateJiraIntegrationLinkModel) + + + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.IntegrationLinksApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + IntegrationLinksApi apiInstance = new IntegrationLinksApi(defaultClient); + UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. + Integer settingId = 56; // Integer | The id of the Setting. + String key = "key_example"; // String | The key of the integration link. + AddOrUpdateJiraIntegrationLinkModel addOrUpdateJiraIntegrationLinkModel = new AddOrUpdateJiraIntegrationLinkModel(); // AddOrUpdateJiraIntegrationLinkModel | + try { + IntegrationLinkModel result = apiInstance.jiraAddOrUpdateIntegrationLink(environmentId, settingId, key, addOrUpdateJiraIntegrationLinkModel); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IntegrationLinksApi#jiraAddOrUpdateIntegrationLink"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **environmentId** | **UUID**| The identifier of the Environment. | | +| **settingId** | **Integer**| The id of the Setting. | | +| **key** | **String**| The key of the integration link. | | +| **addOrUpdateJiraIntegrationLinkModel** | [**AddOrUpdateJiraIntegrationLinkModel**](AddOrUpdateJiraIntegrationLinkModel.md)| | [optional] | + +### Return type + +[**IntegrationLinkModel**](IntegrationLinkModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When everything is ok, the integration link data returned. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **jiraConnect** +> jiraConnect(connectRequest) + + + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.IntegrationLinksApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + IntegrationLinksApi apiInstance = new IntegrationLinksApi(defaultClient); + ConnectRequest connectRequest = new ConnectRequest(); // ConnectRequest | + try { + apiInstance.jiraConnect(connectRequest); + } catch (ApiException e) { + System.err.println("Exception when calling IntegrationLinksApi#jiraConnect"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **connectRequest** | [**ConnectRequest**](ConnectRequest.md)| | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + diff --git a/docs/IntegrationModel.md b/docs/IntegrationModel.md new file mode 100644 index 0000000..ff0b970 --- /dev/null +++ b/docs/IntegrationModel.md @@ -0,0 +1,20 @@ + + +# IntegrationModel + +Details of the Integration. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**product** | [**ProductModel**](ProductModel.md) | | | +|**integrationId** | **UUID** | Identifier of the Integration. | | +|**name** | **String** | Name of the Integration. | | +|**integrationType** | **IntegrationType** | | | +|**parameters** | **Map<String, String>** | Parameters of the Integration. | | +|**environmentIds** | **List<UUID>** | List of Environment IDs that are connected with this Integration. If the list is empty, all of the Environments are connected. | | +|**configIds** | **List<UUID>** | List of Config IDs that are connected with this Integration. If the list is empty, all of the Configs are connected. | | + + + diff --git a/docs/IntegrationType.md b/docs/IntegrationType.md new file mode 100644 index 0000000..534f4ce --- /dev/null +++ b/docs/IntegrationType.md @@ -0,0 +1,21 @@ + + +# IntegrationType + +## Enum + + +* `DATA_DOG` (value: `"dataDog"`) + +* `SLACK` (value: `"slack"`) + +* `AMPLITUDE` (value: `"amplitude"`) + +* `MIX_PANEL` (value: `"mixPanel"`) + +* `SEGMENT` (value: `"segment"`) + +* `PUB_NUB` (value: `"pubNub"`) + + + diff --git a/docs/IntegrationsApi.md b/docs/IntegrationsApi.md new file mode 100644 index 0000000..c072e4d --- /dev/null +++ b/docs/IntegrationsApi.md @@ -0,0 +1,371 @@ +# IntegrationsApi + +All URIs are relative to *https://api.configcat.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createIntegration**](IntegrationsApi.md#createIntegration) | **POST** /v1/products/{productId}/integrations | Create Integration | +| [**deleteIntegration**](IntegrationsApi.md#deleteIntegration) | **DELETE** /v1/integrations/{integrationId} | Delete Integration | +| [**getIntegration**](IntegrationsApi.md#getIntegration) | **GET** /v1/integrations/{integrationId} | Get Integration | +| [**getIntegrations**](IntegrationsApi.md#getIntegrations) | **GET** /v1/products/{productId}/integrations | List Integrations | +| [**updateIntegration**](IntegrationsApi.md#updateIntegration) | **PUT** /v1/integrations/{integrationId} | Update Integration | + + + +# **createIntegration** +> IntegrationModel createIntegration(productId, createIntegrationModel) + +Create Integration + +This endpoint creates a new Integration in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. The Parameters dictionary differs for each IntegrationType: - Datadog - `apikey`: Required. Datadog API key. - `site`: Datadog site. Available values: `Us`, `Eu`, `Us1Fed`, `Us3`, `Us5`. Default: `Us`. - Slack Connecting the Slack integration through the Public Management API will not post messages with the ConfigCat Feature Flags Slack app but with an incoming webhook. - `incoming_webhook.url`: Required. The [incoming webhook URL](https://api.slack.com/messaging/webhooks) where the integration should post messages. - Amplitude - `apiKey`: Required. Amplitude API Key. - `secretKey`: Required. Amplitude Secret Key. - Mixpanel - `serviceAccountUserName`: Required. Mixpanel Service Account Username. - `serviceAccountSecret`: Required. Mixpanel Service Account Secret. - `projectId`: Required. Mixpanel Project ID. - `server`: Mixpanel Server. Available values: `StandardServer`, `EUResidencyServer`. Default: `StandardServer`. - Twilio Segment - `writeKey`: Required. Twilio Segment Write Key. - `server`: Twilio Segment Server. Available values: `Us`, `Eu`. Default: `Us`. - PubNub (work in progress) + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.IntegrationsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + IntegrationsApi apiInstance = new IntegrationsApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + CreateIntegrationModel createIntegrationModel = new CreateIntegrationModel(); // CreateIntegrationModel | + try { + IntegrationModel result = apiInstance.createIntegration(productId, createIntegrationModel); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IntegrationsApi#createIntegration"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | +| **createIntegrationModel** | [**CreateIntegrationModel**](CreateIntegrationModel.md)| | | + +### Return type + +[**IntegrationModel**](IntegrationModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | When the creation was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **deleteIntegration** +> deleteIntegration(integrationId) + +Delete Integration + +This endpoint removes a Integration identified by the `integrationId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.IntegrationsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + IntegrationsApi apiInstance = new IntegrationsApi(defaultClient); + UUID integrationId = UUID.randomUUID(); // UUID | The identifier of the Integration. + try { + apiInstance.deleteIntegration(integrationId); + } catch (ApiException e) { + System.err.println("Exception when calling IntegrationsApi#deleteIntegration"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **integrationId** | **UUID**| The identifier of the Integration. | | + +### Return type + +null (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | When the delete was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getIntegration** +> IntegrationModel getIntegration(integrationId) + +Get Integration + +This endpoint returns the metadata of an Integration identified by the `integrationId`. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.IntegrationsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + IntegrationsApi apiInstance = new IntegrationsApi(defaultClient); + UUID integrationId = UUID.randomUUID(); // UUID | The identifier of the Integration. + try { + IntegrationModel result = apiInstance.getIntegration(integrationId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IntegrationsApi#getIntegration"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **integrationId** | **UUID**| The identifier of the Integration. | | + +### Return type + +[**IntegrationModel**](IntegrationModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When everything is ok, the integration data returned. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getIntegrations** +> IntegrationsModel getIntegrations(productId) + +List Integrations + +This endpoint returns the list of the Integrations that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.IntegrationsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + IntegrationsApi apiInstance = new IntegrationsApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + try { + IntegrationsModel result = apiInstance.getIntegrations(productId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IntegrationsApi#getIntegrations"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | + +### Return type + +[**IntegrationsModel**](IntegrationsModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **updateIntegration** +> IntegrationModel updateIntegration(integrationId, modifyIntegrationRequest) + +Update Integration + +This endpoint updates a Config identified by the `integrationId` parameter. The Parameters dictionary differs for each IntegrationType: - Datadog - `apikey`: Required. Datadog API key. - `site`: Datadog site. Available values: `Us`, `Eu`, `Us1Fed`, `Us3`, `Us5`. Default: `Us`. - Slack Connecting the Slack integration through the Public Management API will not post messages with the ConfigCat Feature Flags Slack app but with an incoming webhook. - `incoming_webhook.url`: Required. The [incoming webhook URL](https://api.slack.com/messaging/webhooks) where the integration should post messages. - Amplitude - `apiKey`: Required. Amplitude API Key. - `secretKey`: Required. Amplitude Secret Key. - Mixpanel - `serviceAccountUserName`: Required. Mixpanel Service Account Username. - `serviceAccountSecret`: Required. Mixpanel Service Account Secret. - `projectId`: Required. Mixpanel Project ID. - `server`: Mixpanel Server. Available values: `StandardServer`, `EUResidencyServer`. Default: `StandardServer`. - Twilio Segment - `writeKey`: Required. Twilio Segment Write Key. - `server`: Twilio Segment Server. Available values: `Us`, `Eu`. Default: `Us`. - PubNub (work in progress) + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.IntegrationsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + IntegrationsApi apiInstance = new IntegrationsApi(defaultClient); + UUID integrationId = UUID.randomUUID(); // UUID | The identifier of the Integration. + ModifyIntegrationRequest modifyIntegrationRequest = new ModifyIntegrationRequest(); // ModifyIntegrationRequest | + try { + IntegrationModel result = apiInstance.updateIntegration(integrationId, modifyIntegrationRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IntegrationsApi#updateIntegration"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **integrationId** | **UUID**| The identifier of the Integration. | | +| **modifyIntegrationRequest** | [**ModifyIntegrationRequest**](ModifyIntegrationRequest.md)| | | + +### Return type + +[**IntegrationModel**](IntegrationModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + diff --git a/docs/IntegrationsModel.md b/docs/IntegrationsModel.md new file mode 100644 index 0000000..eb2e055 --- /dev/null +++ b/docs/IntegrationsModel.md @@ -0,0 +1,13 @@ + + +# IntegrationsModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**integrations** | [**List<IntegrationModel>**](IntegrationModel.md) | The Integrations of the Product. | | + + + diff --git a/docs/InvitationModel.md b/docs/InvitationModel.md new file mode 100644 index 0000000..ecfaa8b --- /dev/null +++ b/docs/InvitationModel.md @@ -0,0 +1,17 @@ + + +# InvitationModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**invitationId** | **UUID** | The identifier of the Invitation. | | +|**email** | **String** | The invited user's email address. | | +|**permissionGroupId** | **Long** | The identifier of the Permission Group the user was invited to. | | +|**createdAt** | **OffsetDateTime** | Creation time of the Invitation. | | +|**expired** | **Boolean** | Determines whether the Invitation is expired. | | + + + diff --git a/docs/InviteMembersRequest.md b/docs/InviteMembersRequest.md new file mode 100644 index 0000000..eef8258 --- /dev/null +++ b/docs/InviteMembersRequest.md @@ -0,0 +1,14 @@ + + +# InviteMembersRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**emails** | **List<String>** | List of email addresses to invite. | | +|**permissionGroupId** | **Long** | Identifier of the Permission Group to where the invited users should be added. | | + + + diff --git a/docs/JsonPatchOperation.md b/docs/JsonPatchOperation.md new file mode 100644 index 0000000..cf7d095 --- /dev/null +++ b/docs/JsonPatchOperation.md @@ -0,0 +1,16 @@ + + +# JsonPatchOperation + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**op** | **OperationType** | | | +|**path** | **String** | The source path. | | +|**from** | **String** | The target path. | [optional] | +|**value** | **Object** | The discrete value. | [optional] | + + + diff --git a/docs/KeyGenerationMode.md b/docs/KeyGenerationMode.md new file mode 100644 index 0000000..93ad49c --- /dev/null +++ b/docs/KeyGenerationMode.md @@ -0,0 +1,19 @@ + + +# KeyGenerationMode + +## Enum + + +* `CAMEL_CASE` (value: `"camelCase"`) + +* `LOWER_CASE` (value: `"lowerCase"`) + +* `UPPER_CASE` (value: `"upperCase"`) + +* `PASCAL_CASE` (value: `"pascalCase"`) + +* `KEBAB_CASE` (value: `"kebabCase"`) + + + diff --git a/docs/MeApi.md b/docs/MeApi.md new file mode 100644 index 0000000..ede15ee --- /dev/null +++ b/docs/MeApi.md @@ -0,0 +1,74 @@ +# MeApi + +All URIs are relative to *https://api.configcat.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getMe**](MeApi.md#getMe) | **GET** /v1/me | Get authenticated user details | + + + +# **getMe** +> MeModel getMe() + +Get authenticated user details + + + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.MeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + MeApi apiInstance = new MeApi(defaultClient); + try { + MeModel result = apiInstance.getMe(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MeApi#getMe"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**MeModel**](MeModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + diff --git a/docs/MeModel.md b/docs/MeModel.md new file mode 100644 index 0000000..67b3010 --- /dev/null +++ b/docs/MeModel.md @@ -0,0 +1,14 @@ + + +# MeModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**email** | **String** | | [readonly] | +|**fullName** | **String** | | [readonly] | + + + diff --git a/docs/MemberModel.md b/docs/MemberModel.md new file mode 100644 index 0000000..3ce1fac --- /dev/null +++ b/docs/MemberModel.md @@ -0,0 +1,17 @@ + + +# MemberModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userId** | **String** | Identifier of the Member. | | +|**productId** | **UUID** | Identifier of the Product where the Member has access. | | +|**permissionGroupId** | **Long** | Identifier of the Member's Permission Group. | | +|**fullName** | **String** | Name of the Member. | | +|**email** | **String** | Email of the Member. | | + + + diff --git a/docs/MembersApi.md b/docs/MembersApi.md new file mode 100644 index 0000000..28bbb68 --- /dev/null +++ b/docs/MembersApi.md @@ -0,0 +1,733 @@ +# MembersApi + +All URIs are relative to *https://api.configcat.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addMemberToGroup**](MembersApi.md#addMemberToGroup) | **POST** /v1/organizations/{organizationId}/members/{userId} | Update Member Permissions | +| [**deleteInvitation**](MembersApi.md#deleteInvitation) | **DELETE** /v1/invitations/{invitationId} | Delete Invitation | +| [**deleteOrganizationMember**](MembersApi.md#deleteOrganizationMember) | **DELETE** /v1/organizations/{organizationId}/members/{userId} | Delete Member from Organization | +| [**deleteProductMember**](MembersApi.md#deleteProductMember) | **DELETE** /v1/products/{productId}/members/{userId} | Delete Member from Product | +| [**getOrganizationMembers**](MembersApi.md#getOrganizationMembers) | **GET** /v1/organizations/{organizationId}/members | List Organization Members | +| [**getOrganizationMembersV2**](MembersApi.md#getOrganizationMembersV2) | **GET** /v2/organizations/{organizationId}/members | List Organization Members | +| [**getPendingInvitations**](MembersApi.md#getPendingInvitations) | **GET** /v1/products/{productId}/invitations | List Pending Invitations in Product | +| [**getPendingInvitationsOrg**](MembersApi.md#getPendingInvitationsOrg) | **GET** /v1/organizations/{organizationId}/invitations | List Pending Invitations in Organization | +| [**getProductMembers**](MembersApi.md#getProductMembers) | **GET** /v1/products/{productId}/members | List Product Members | +| [**inviteMember**](MembersApi.md#inviteMember) | **POST** /v1/products/{productId}/members/invite | Invite Member | + + + +# **addMemberToGroup** +> addMemberToGroup(organizationId, userId, updateMemberPermissionsRequest) + +Update Member Permissions + +This endpoint updates the permissions of a Member identified by the `userId`. This endpoint can also be used to move a Member between Permission Groups within a Product. Only a single Permission Group can be set per Product. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.MembersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + MembersApi apiInstance = new MembersApi(defaultClient); + UUID organizationId = UUID.randomUUID(); // UUID | The identifier of the Organization. + String userId = "userId_example"; // String | The identifier of the Member. + UpdateMemberPermissionsRequest updateMemberPermissionsRequest = new UpdateMemberPermissionsRequest(); // UpdateMemberPermissionsRequest | + try { + apiInstance.addMemberToGroup(organizationId, userId, updateMemberPermissionsRequest); + } catch (ApiException e) { + System.err.println("Exception when calling MembersApi#addMemberToGroup"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **organizationId** | **UUID**| The identifier of the Organization. | | +| **userId** | **String**| The identifier of the Member. | | +| **updateMemberPermissionsRequest** | [**UpdateMemberPermissionsRequest**](UpdateMemberPermissionsRequest.md)| | | + +### Return type + +null (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When the update was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **deleteInvitation** +> deleteInvitation(invitationId) + +Delete Invitation + +This endpoint removes an Invitation identified by the `invitationId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.MembersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + MembersApi apiInstance = new MembersApi(defaultClient); + UUID invitationId = UUID.randomUUID(); // UUID | The identifier of the Invitation. + try { + apiInstance.deleteInvitation(invitationId); + } catch (ApiException e) { + System.err.println("Exception when calling MembersApi#deleteInvitation"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **invitationId** | **UUID**| The identifier of the Invitation. | | + +### Return type + +null (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | When the delete was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **deleteOrganizationMember** +> deleteOrganizationMember(organizationId, userId) + +Delete Member from Organization + +This endpoint removes a Member identified by the `userId` from the given Organization identified by the `organizationId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.MembersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + MembersApi apiInstance = new MembersApi(defaultClient); + UUID organizationId = UUID.randomUUID(); // UUID | The identifier of the Organization. + String userId = "userId_example"; // String | The identifier of the Member. + try { + apiInstance.deleteOrganizationMember(organizationId, userId); + } catch (ApiException e) { + System.err.println("Exception when calling MembersApi#deleteOrganizationMember"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **organizationId** | **UUID**| The identifier of the Organization. | | +| **userId** | **String**| The identifier of the Member. | | + +### Return type + +null (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | When the delete was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **deleteProductMember** +> deleteProductMember(productId, userId) + +Delete Member from Product + +This endpoint removes a Member identified by the `userId` from the given Product identified by the `productId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.MembersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + MembersApi apiInstance = new MembersApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + String userId = "userId_example"; // String | The identifier of the Member. + try { + apiInstance.deleteProductMember(productId, userId); + } catch (ApiException e) { + System.err.println("Exception when calling MembersApi#deleteProductMember"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | +| **userId** | **String**| The identifier of the Member. | | + +### Return type + +null (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | When the delete was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getOrganizationMembers** +> List<UserModel> getOrganizationMembers(organizationId) + +List Organization Members + +This endpoint returns the list of Members that belongs to the given Organization, identified by the `organizationId` parameter. The results may vary based on the access level of the user who calls the endpoint: - When it's called with Organization Admin privileges, the result will contain each member in the Organization. - When it's called without Organization Admin privileges, the result will contain each Organization Admin along with members of those products where the caller has `Team members and permission groups` (`canManageMembers`) permission. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.MembersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + MembersApi apiInstance = new MembersApi(defaultClient); + UUID organizationId = UUID.randomUUID(); // UUID | The identifier of the Organization. + try { + List result = apiInstance.getOrganizationMembers(organizationId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MembersApi#getOrganizationMembers"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **organizationId** | **UUID**| The identifier of the Organization. | | + +### Return type + +[**List<UserModel>**](UserModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getOrganizationMembersV2** +> OrganizationMembersModel getOrganizationMembersV2(organizationId) + +List Organization Members + +This endpoint returns the list of Members that belongs to the given Organization, identified by the `organizationId` parameter. The results may vary based on the access level of the user who calls the endpoint: - When it's called with Organization Admin privileges, the result will contain each member in the Organization. - When it's called without Organization Admin privileges, the result will contain each Organization Admin along with members of those products where the caller has `Team members and permission groups` (`canManageMembers`) permission. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.MembersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + MembersApi apiInstance = new MembersApi(defaultClient); + UUID organizationId = UUID.randomUUID(); // UUID | The identifier of the Organization. + try { + OrganizationMembersModel result = apiInstance.getOrganizationMembersV2(organizationId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MembersApi#getOrganizationMembersV2"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **organizationId** | **UUID**| The identifier of the Organization. | | + +### Return type + +[**OrganizationMembersModel**](OrganizationMembersModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getPendingInvitations** +> List<InvitationModel> getPendingInvitations(productId) + +List Pending Invitations in Product + +This endpoint returns the list of pending invitations within the given Product identified by the `productId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.MembersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + MembersApi apiInstance = new MembersApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + try { + List result = apiInstance.getPendingInvitations(productId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MembersApi#getPendingInvitations"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | + +### Return type + +[**List<InvitationModel>**](InvitationModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getPendingInvitationsOrg** +> List<OrganizationInvitationModel> getPendingInvitationsOrg(organizationId) + +List Pending Invitations in Organization + +This endpoint returns the list of pending invitations within the given Organization identified by the `organizationId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.MembersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + MembersApi apiInstance = new MembersApi(defaultClient); + UUID organizationId = UUID.randomUUID(); // UUID | The identifier of the Organization. + try { + List result = apiInstance.getPendingInvitationsOrg(organizationId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MembersApi#getPendingInvitationsOrg"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **organizationId** | **UUID**| The identifier of the Organization. | | + +### Return type + +[**List<OrganizationInvitationModel>**](OrganizationInvitationModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getProductMembers** +> List<MemberModel> getProductMembers(productId) + +List Product Members + +This endpoint returns the list of Members that belongs to the given Product, identified by the `productId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.MembersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + MembersApi apiInstance = new MembersApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + try { + List result = apiInstance.getProductMembers(productId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MembersApi#getProductMembers"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | + +### Return type + +[**List<MemberModel>**](MemberModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **inviteMember** +> inviteMember(productId, inviteMembersRequest) + +Invite Member + +This endpoint invites a Member into the given Product identified by the `productId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.MembersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + MembersApi apiInstance = new MembersApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + InviteMembersRequest inviteMembersRequest = new InviteMembersRequest(); // InviteMembersRequest | + try { + apiInstance.inviteMember(productId, inviteMembersRequest); + } catch (ApiException e) { + System.err.println("Exception when calling MembersApi#inviteMember"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | +| **inviteMembersRequest** | [**InviteMembersRequest**](InviteMembersRequest.md)| | | + +### Return type + +null (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When the invite was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + diff --git a/docs/ModifyIntegrationRequest.md b/docs/ModifyIntegrationRequest.md new file mode 100644 index 0000000..9710ef7 --- /dev/null +++ b/docs/ModifyIntegrationRequest.md @@ -0,0 +1,16 @@ + + +# ModifyIntegrationRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Name of the Integration. | | +|**parameters** | **Map<String, String>** | Parameters of the Integration. | | +|**environmentIds** | **List<UUID>** | List of Environment IDs that are connected with this Integration. If the list is empty, all of the Environments are connected. | | +|**configIds** | **List<UUID>** | List of Config IDs that are connected with this Integration. If the list is empty, all of the Configs are connected. | | + + + diff --git a/docs/OperationType.md b/docs/OperationType.md new file mode 100644 index 0000000..23dc720 --- /dev/null +++ b/docs/OperationType.md @@ -0,0 +1,23 @@ + + +# OperationType + +## Enum + + +* `UNKNOWN` (value: `"unknown"`) + +* `ADD` (value: `"add"`) + +* `REMOVE` (value: `"remove"`) + +* `REPLACE` (value: `"replace"`) + +* `MOVE` (value: `"move"`) + +* `COPY` (value: `"copy"`) + +* `TEST` (value: `"test"`) + + + diff --git a/docs/OrganizationAdminModel.md b/docs/OrganizationAdminModel.md new file mode 100644 index 0000000..cf5b569 --- /dev/null +++ b/docs/OrganizationAdminModel.md @@ -0,0 +1,17 @@ + + +# OrganizationAdminModel + +Describes an Organization Admin. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userId** | **String** | Identifier of the Organization Admin. | | +|**fullName** | **String** | Name of the Organization Admin. | | +|**email** | **String** | Email of the OrganizationAdmin. | | +|**twoFactorEnabled** | **Boolean** | Determines whether 2FA is enabled for the Organization Admin. | | + + + diff --git a/docs/OrganizationInvitationModel.md b/docs/OrganizationInvitationModel.md new file mode 100644 index 0000000..af2d4f6 --- /dev/null +++ b/docs/OrganizationInvitationModel.md @@ -0,0 +1,20 @@ + + +# OrganizationInvitationModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**invitationId** | **UUID** | The identifier of the Invitation. | | +|**email** | **String** | The invited user's email address. | | +|**productId** | **UUID** | The identifier of the Product the user was invited to. | | +|**productName** | **String** | The name of the Product the user was invited to. | | +|**permissionGroupId** | **Long** | The identifier of the Permission Group the user was invited to. | | +|**createdAt** | **OffsetDateTime** | Creation time of the Invitation. | | +|**expired** | **Boolean** | Determines whether the Invitation is expired. | | +|**expires** | **OffsetDateTime** | Expiration time of the Invitation. | | + + + diff --git a/docs/OrganizationMemberModel.md b/docs/OrganizationMemberModel.md new file mode 100644 index 0000000..39549eb --- /dev/null +++ b/docs/OrganizationMemberModel.md @@ -0,0 +1,18 @@ + + +# OrganizationMemberModel + +Describes an Organization Member. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userId** | **String** | Identifier of the Organization Admin. | | +|**fullName** | **String** | Name of the Organization Admin. | | +|**email** | **String** | Email of the OrganizationAdmin. | | +|**twoFactorEnabled** | **Boolean** | Determines whether 2FA is enabled for the Organization Admin. | | +|**permissions** | [**List<OrganizationPermissionModel>**](OrganizationPermissionModel.md) | The permissions of the Member. | | + + + diff --git a/docs/OrganizationMembersModel.md b/docs/OrganizationMembersModel.md new file mode 100644 index 0000000..54da36b --- /dev/null +++ b/docs/OrganizationMembersModel.md @@ -0,0 +1,15 @@ + + +# OrganizationMembersModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**admins** | [**List<OrganizationAdminModel>**](OrganizationAdminModel.md) | List of Organization Admins. | | +|**billingManagers** | [**List<OrganizationAdminModel>**](OrganizationAdminModel.md) | List of Billing Managers. | | +|**members** | [**List<OrganizationMemberModel>**](OrganizationMemberModel.md) | List of Organization Members. | | + + + diff --git a/docs/OrganizationModel.md b/docs/OrganizationModel.md new file mode 100644 index 0000000..be6ef21 --- /dev/null +++ b/docs/OrganizationModel.md @@ -0,0 +1,15 @@ + + +# OrganizationModel + +Details of the Organization. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**organizationId** | **UUID** | Identifier of the Organization. | | +|**name** | **String** | Name of the Organization. | | + + + diff --git a/docs/OrganizationPermissionGroupModel.md b/docs/OrganizationPermissionGroupModel.md new file mode 100644 index 0000000..bf8cf08 --- /dev/null +++ b/docs/OrganizationPermissionGroupModel.md @@ -0,0 +1,15 @@ + + +# OrganizationPermissionGroupModel + +Describes the Member's Permission Group within a Product. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**permissionGroupId** | **Long** | Identifier of the Member's Permission Group. | | +|**name** | **String** | Name of the Member's Permission Group. | | + + + diff --git a/docs/OrganizationPermissionModel.md b/docs/OrganizationPermissionModel.md new file mode 100644 index 0000000..dc16fbc --- /dev/null +++ b/docs/OrganizationPermissionModel.md @@ -0,0 +1,15 @@ + + +# OrganizationPermissionModel + +Describes the Member's permission. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**product** | [**OrganizationProductModel**](OrganizationProductModel.md) | | | +|**permissionGroup** | [**OrganizationPermissionGroupModel**](OrganizationPermissionGroupModel.md) | | | + + + diff --git a/docs/OrganizationProductModel.md b/docs/OrganizationProductModel.md new file mode 100644 index 0000000..a6743d0 --- /dev/null +++ b/docs/OrganizationProductModel.md @@ -0,0 +1,15 @@ + + +# OrganizationProductModel + +Describes the Member's Product. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**productId** | **UUID** | Identifier of the Member's Product. | | +|**name** | **String** | Name of the Member's Product. | | + + + diff --git a/docs/OrganizationsApi.md b/docs/OrganizationsApi.md new file mode 100644 index 0000000..17c722b --- /dev/null +++ b/docs/OrganizationsApi.md @@ -0,0 +1,74 @@ +# OrganizationsApi + +All URIs are relative to *https://api.configcat.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getOrganizations**](OrganizationsApi.md#getOrganizations) | **GET** /v1/organizations | List Organizations | + + + +# **getOrganizations** +> List<OrganizationModel> getOrganizations() + +List Organizations + +This endpoint returns the list of the Organizations that belongs to the user. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.OrganizationsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + OrganizationsApi apiInstance = new OrganizationsApi(defaultClient); + try { + List result = apiInstance.getOrganizations(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationsApi#getOrganizations"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List<OrganizationModel>**](OrganizationModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + diff --git a/docs/PercentageOptionModel.md b/docs/PercentageOptionModel.md new file mode 100644 index 0000000..6511953 --- /dev/null +++ b/docs/PercentageOptionModel.md @@ -0,0 +1,14 @@ + + +# PercentageOptionModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**percentage** | **Integer** | A number between 0 and 100 that represents a randomly allocated fraction of the users. | | +|**value** | [**ValueModel**](ValueModel.md) | | | + + + diff --git a/docs/PermissionGroupModel.md b/docs/PermissionGroupModel.md new file mode 100644 index 0000000..727e740 --- /dev/null +++ b/docs/PermissionGroupModel.md @@ -0,0 +1,39 @@ + + +# PermissionGroupModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**permissionGroupId** | **Long** | Identifier of the Permission Group. | | +|**name** | **String** | Name of the Permission Group. | | +|**canManageMembers** | **Boolean** | Group members can manage team members. | | +|**canCreateOrUpdateConfig** | **Boolean** | Group members can create/update Configs. | | +|**canDeleteConfig** | **Boolean** | Group members can delete Configs. | | +|**canCreateOrUpdateEnvironment** | **Boolean** | Group members can create/update Environments. | | +|**canDeleteEnvironment** | **Boolean** | Group members can delete Environments. | | +|**canCreateOrUpdateSetting** | **Boolean** | Group members can create/update Feature Flags and Settings. | | +|**canTagSetting** | **Boolean** | Group members can attach/detach Tags to Feature Flags and Settings. | | +|**canDeleteSetting** | **Boolean** | Group members can delete Feature Flags and Settings. | | +|**canCreateOrUpdateTag** | **Boolean** | Group members can create/update Tags. | | +|**canDeleteTag** | **Boolean** | Group members can delete Tags. | | +|**canManageWebhook** | **Boolean** | Group members can create/update/delete Webhooks. | | +|**canUseExportImport** | **Boolean** | Group members can use the export/import feature. | | +|**canManageProductPreferences** | **Boolean** | Group members can update Product preferences. | | +|**canManageIntegrations** | **Boolean** | Group members can add and configure integrations. | | +|**canViewSdkKey** | **Boolean** | Group members has access to SDK keys. | | +|**canRotateSdkKey** | **Boolean** | Group members can rotate SDK keys. | | +|**canCreateOrUpdateSegments** | **Boolean** | Group members can create/update Segments. | | +|**canDeleteSegments** | **Boolean** | Group members can delete Segments. | | +|**canViewProductAuditLog** | **Boolean** | Group members has access to audit logs. | | +|**canViewProductStatistics** | **Boolean** | Group members has access to product statistics. | | +|**canDisable2FA** | **Boolean** | Group members can disable two-factor authentication for other members. | | +|**accessType** | **AccessType** | | | +|**newEnvironmentAccessType** | **EnvironmentAccessType** | | | +|**environmentAccesses** | [**List<EnvironmentAccessModel>**](EnvironmentAccessModel.md) | List of environment specific permissions. | | +|**product** | [**ProductModel**](ProductModel.md) | | | + + + diff --git a/docs/PermissionGroupsApi.md b/docs/PermissionGroupsApi.md new file mode 100644 index 0000000..581fccb --- /dev/null +++ b/docs/PermissionGroupsApi.md @@ -0,0 +1,371 @@ +# PermissionGroupsApi + +All URIs are relative to *https://api.configcat.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createPermissionGroup**](PermissionGroupsApi.md#createPermissionGroup) | **POST** /v1/products/{productId}/permissions | Create Permission Group | +| [**deletePermissionGroup**](PermissionGroupsApi.md#deletePermissionGroup) | **DELETE** /v1/permissions/{permissionGroupId} | Delete Permission Group | +| [**getPermissionGroup**](PermissionGroupsApi.md#getPermissionGroup) | **GET** /v1/permissions/{permissionGroupId} | Get Permission Group | +| [**getPermissionGroups**](PermissionGroupsApi.md#getPermissionGroups) | **GET** /v1/products/{productId}/permissions | List Permission Groups | +| [**updatePermissionGroup**](PermissionGroupsApi.md#updatePermissionGroup) | **PUT** /v1/permissions/{permissionGroupId} | Update Permission Group | + + + +# **createPermissionGroup** +> PermissionGroupModel createPermissionGroup(productId, createPermissionGroupRequest) + +Create Permission Group + +This endpoint creates a new Permission Group in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.PermissionGroupsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + PermissionGroupsApi apiInstance = new PermissionGroupsApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + CreatePermissionGroupRequest createPermissionGroupRequest = new CreatePermissionGroupRequest(); // CreatePermissionGroupRequest | + try { + PermissionGroupModel result = apiInstance.createPermissionGroup(productId, createPermissionGroupRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionGroupsApi#createPermissionGroup"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | +| **createPermissionGroupRequest** | [**CreatePermissionGroupRequest**](CreatePermissionGroupRequest.md)| | | + +### Return type + +[**PermissionGroupModel**](PermissionGroupModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | When the creation was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **deletePermissionGroup** +> deletePermissionGroup(permissionGroupId) + +Delete Permission Group + +This endpoint removes a Permission Group identified by the `permissionGroupId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.PermissionGroupsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + PermissionGroupsApi apiInstance = new PermissionGroupsApi(defaultClient); + Long permissionGroupId = 56L; // Long | The identifier of the Permission Group. + try { + apiInstance.deletePermissionGroup(permissionGroupId); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionGroupsApi#deletePermissionGroup"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **permissionGroupId** | **Long**| The identifier of the Permission Group. | | + +### Return type + +null (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | When the delete was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getPermissionGroup** +> PermissionGroupModel getPermissionGroup(permissionGroupId) + +Get Permission Group + +This endpoint returns the metadata of a Permission Group identified by the `permissionGroupId`. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.PermissionGroupsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + PermissionGroupsApi apiInstance = new PermissionGroupsApi(defaultClient); + Long permissionGroupId = 56L; // Long | The identifier of the Permission Group. + try { + PermissionGroupModel result = apiInstance.getPermissionGroup(permissionGroupId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionGroupsApi#getPermissionGroup"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **permissionGroupId** | **Long**| The identifier of the Permission Group. | | + +### Return type + +[**PermissionGroupModel**](PermissionGroupModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When everything is ok, the permission group data returned. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getPermissionGroups** +> List<PermissionGroupModel> getPermissionGroups(productId) + +List Permission Groups + +This endpoint returns the list of the Permission Groups that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.PermissionGroupsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + PermissionGroupsApi apiInstance = new PermissionGroupsApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + try { + List result = apiInstance.getPermissionGroups(productId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionGroupsApi#getPermissionGroups"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | + +### Return type + +[**List<PermissionGroupModel>**](PermissionGroupModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **updatePermissionGroup** +> PermissionGroupModel updatePermissionGroup(permissionGroupId, updatePermissionGroupRequest) + +Update Permission Group + +This endpoint updates a Permission Group identified by the `permissionGroupId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.PermissionGroupsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + PermissionGroupsApi apiInstance = new PermissionGroupsApi(defaultClient); + Long permissionGroupId = 56L; // Long | The identifier of the Permission Group. + UpdatePermissionGroupRequest updatePermissionGroupRequest = new UpdatePermissionGroupRequest(); // UpdatePermissionGroupRequest | + try { + PermissionGroupModel result = apiInstance.updatePermissionGroup(permissionGroupId, updatePermissionGroupRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionGroupsApi#updatePermissionGroup"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **permissionGroupId** | **Long**| The identifier of the Permission Group. | | +| **updatePermissionGroupRequest** | [**UpdatePermissionGroupRequest**](UpdatePermissionGroupRequest.md)| | | + +### Return type + +[**PermissionGroupModel**](PermissionGroupModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + diff --git a/docs/PreferencesModel.md b/docs/PreferencesModel.md new file mode 100644 index 0000000..d0b580b --- /dev/null +++ b/docs/PreferencesModel.md @@ -0,0 +1,17 @@ + + +# PreferencesModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**reasonRequired** | **Boolean** | Indicates that a mandatory note required for saving and publishing. | | +|**keyGenerationMode** | **KeyGenerationMode** | | | +|**showVariationId** | **Boolean** | Indicates whether a variation ID's must be shown on the ConfigCat Dashboard. | | +|**reasonRequiredEnvironments** | [**List<ReasonRequiredEnvironmentModel>**](ReasonRequiredEnvironmentModel.md) | List of Environments where mandatory note must be set before saving and publishing. | | +|**mandatorySettingHint** | **Boolean** | Indicates whether Feature flags and Settings must have a hint. | | + + + diff --git a/docs/PrerequisiteComparator.md b/docs/PrerequisiteComparator.md new file mode 100644 index 0000000..1761aa2 --- /dev/null +++ b/docs/PrerequisiteComparator.md @@ -0,0 +1,13 @@ + + +# PrerequisiteComparator + +## Enum + + +* `EQUALS` (value: `"equals"`) + +* `DOES_NOT_EQUAL` (value: `"doesNotEqual"`) + + + diff --git a/docs/PrerequisiteFlagConditionModel.md b/docs/PrerequisiteFlagConditionModel.md new file mode 100644 index 0000000..b4c3d45 --- /dev/null +++ b/docs/PrerequisiteFlagConditionModel.md @@ -0,0 +1,16 @@ + + +# PrerequisiteFlagConditionModel + +Describes a condition that is based on a prerequisite flag. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**prerequisiteSettingId** | **Integer** | The prerequisite flag's identifier. | | +|**comparator** | **PrerequisiteComparator** | | | +|**prerequisiteComparisonValue** | [**ValueModel**](ValueModel.md) | | | + + + diff --git a/docs/ProductModel.md b/docs/ProductModel.md new file mode 100644 index 0000000..f7f5537 --- /dev/null +++ b/docs/ProductModel.md @@ -0,0 +1,19 @@ + + +# ProductModel + +Details of the Product. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**organization** | [**OrganizationModel**](OrganizationModel.md) | | | +|**productId** | **UUID** | Identifier of the Product. | | +|**name** | **String** | Name of the Product. | | +|**description** | **String** | Description of the Product. | | +|**order** | **Integer** | The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | | +|**reasonRequired** | **Boolean** | Determines whether a mandatory reason must be given every time when the Feature Flags or Settings within a Product are saved. | | + + + diff --git a/docs/ProductsApi.md b/docs/ProductsApi.md new file mode 100644 index 0000000..4686b05 --- /dev/null +++ b/docs/ProductsApi.md @@ -0,0 +1,511 @@ +# ProductsApi + +All URIs are relative to *https://api.configcat.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createProduct**](ProductsApi.md#createProduct) | **POST** /v1/organizations/{organizationId}/products | Create Product | +| [**deleteProduct**](ProductsApi.md#deleteProduct) | **DELETE** /v1/products/{productId} | Delete Product | +| [**getProduct**](ProductsApi.md#getProduct) | **GET** /v1/products/{productId} | Get Product | +| [**getProductPreferences**](ProductsApi.md#getProductPreferences) | **GET** /v1/products/{productId}/preferences | Get Product Preferences | +| [**getProducts**](ProductsApi.md#getProducts) | **GET** /v1/products | List Products | +| [**updateProduct**](ProductsApi.md#updateProduct) | **PUT** /v1/products/{productId} | Update Product | +| [**updateProductPreferences**](ProductsApi.md#updateProductPreferences) | **POST** /v1/products/{productId}/preferences | Update Product Preferences | + + + +# **createProduct** +> ProductModel createProduct(organizationId, createProductRequest) + +Create Product + +This endpoint creates a new Product in a specified Organization identified by the `organizationId` parameter, which can be obtained from the [List Organizations](#operation/get-organizations) endpoint. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.ProductsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + ProductsApi apiInstance = new ProductsApi(defaultClient); + UUID organizationId = UUID.randomUUID(); // UUID | The identifier of the Organization. + CreateProductRequest createProductRequest = new CreateProductRequest(); // CreateProductRequest | + try { + ProductModel result = apiInstance.createProduct(organizationId, createProductRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ProductsApi#createProduct"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **organizationId** | **UUID**| The identifier of the Organization. | | +| **createProductRequest** | [**CreateProductRequest**](CreateProductRequest.md)| | | + +### Return type + +[**ProductModel**](ProductModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | When the creation was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **deleteProduct** +> deleteProduct(productId) + +Delete Product + +This endpoint removes a Product identified by the `productId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.ProductsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + ProductsApi apiInstance = new ProductsApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + try { + apiInstance.deleteProduct(productId); + } catch (ApiException e) { + System.err.println("Exception when calling ProductsApi#deleteProduct"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | + +### Return type + +null (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | When the delete was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getProduct** +> ProductModel getProduct(productId) + +Get Product + +This endpoint returns the metadata of a Product identified by the `productId`. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.ProductsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + ProductsApi apiInstance = new ProductsApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + try { + ProductModel result = apiInstance.getProduct(productId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ProductsApi#getProduct"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | + +### Return type + +[**ProductModel**](ProductModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When everything is ok, the product data is returned. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getProductPreferences** +> PreferencesModel getProductPreferences(productId) + +Get Product Preferences + +This endpoint returns the preferences of a Product identified by the `productId`. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.ProductsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + ProductsApi apiInstance = new ProductsApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + try { + PreferencesModel result = apiInstance.getProductPreferences(productId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ProductsApi#getProductPreferences"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | + +### Return type + +[**PreferencesModel**](PreferencesModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When everything is ok, the product preferences data is returned. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getProducts** +> List<ProductModel> getProducts() + +List Products + +This endpoint returns the list of the Products that belongs to the user. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.ProductsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + ProductsApi apiInstance = new ProductsApi(defaultClient); + try { + List result = apiInstance.getProducts(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ProductsApi#getProducts"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List<ProductModel>**](ProductModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **updateProduct** +> ProductModel updateProduct(productId, updateProductRequest) + +Update Product + +This endpoint updates a Product identified by the `productId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.ProductsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + ProductsApi apiInstance = new ProductsApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + UpdateProductRequest updateProductRequest = new UpdateProductRequest(); // UpdateProductRequest | + try { + ProductModel result = apiInstance.updateProduct(productId, updateProductRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ProductsApi#updateProduct"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | +| **updateProductRequest** | [**UpdateProductRequest**](UpdateProductRequest.md)| | | + +### Return type + +[**ProductModel**](ProductModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **updateProductPreferences** +> PreferencesModel updateProductPreferences(productId, updatePreferencesRequest) + +Update Product Preferences + +This endpoint updates the preferences of a Product identified by the `productId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.ProductsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + ProductsApi apiInstance = new ProductsApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + UpdatePreferencesRequest updatePreferencesRequest = new UpdatePreferencesRequest(); // UpdatePreferencesRequest | + try { + PreferencesModel result = apiInstance.updateProductPreferences(productId, updatePreferencesRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ProductsApi#updateProductPreferences"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | +| **updatePreferencesRequest** | [**UpdatePreferencesRequest**](UpdatePreferencesRequest.md)| | | + +### Return type + +[**PreferencesModel**](PreferencesModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When the update was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + diff --git a/docs/ReasonRequiredEnvironmentModel.md b/docs/ReasonRequiredEnvironmentModel.md new file mode 100644 index 0000000..4acabcd --- /dev/null +++ b/docs/ReasonRequiredEnvironmentModel.md @@ -0,0 +1,15 @@ + + +# ReasonRequiredEnvironmentModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**environmentId** | **UUID** | Identifier of the Environment. | | +|**reasonRequired** | **Boolean** | Indicates that a mandatory note is required in this Environment for saving and publishing. | | +|**environmentName** | **String** | Name of the Environment. | | + + + diff --git a/docs/ReferenceLineModel.md b/docs/ReferenceLineModel.md new file mode 100644 index 0000000..9b2b06b --- /dev/null +++ b/docs/ReferenceLineModel.md @@ -0,0 +1,15 @@ + + +# ReferenceLineModel + +Determines a code reference line. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**lineText** | **String** | The content of the reference line. | | +|**lineNumber** | **Integer** | The line number. | | + + + diff --git a/docs/ReferenceLineRequest.md b/docs/ReferenceLineRequest.md new file mode 100644 index 0000000..7acc786 --- /dev/null +++ b/docs/ReferenceLineRequest.md @@ -0,0 +1,15 @@ + + +# ReferenceLineRequest + +Determines a code reference line. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**lineText** | **String** | The content of the reference line. | [optional] | +|**lineNumber** | **Integer** | The line number. | | + + + diff --git a/docs/ReferenceLinesModel.md b/docs/ReferenceLinesModel.md new file mode 100644 index 0000000..aecf04e --- /dev/null +++ b/docs/ReferenceLinesModel.md @@ -0,0 +1,17 @@ + + +# ReferenceLinesModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_file** | **String** | The file's name in where the code reference has been found. (Appears on the ConfigCat Dashboard) | | +|**fileUrl** | **String** | The file's url. (Used to point to the file on the repository's website) | | +|**preLines** | [**List<ReferenceLineModel>**](ReferenceLineModel.md) | The lines before the actual reference line. | | +|**postLines** | [**List<ReferenceLineModel>**](ReferenceLineModel.md) | The lines after the actual reference line. | | +|**referenceLine** | [**ReferenceLineModel**](ReferenceLineModel.md) | | | + + + diff --git a/docs/ReferenceLinesRequest.md b/docs/ReferenceLinesRequest.md new file mode 100644 index 0000000..af8a65a --- /dev/null +++ b/docs/ReferenceLinesRequest.md @@ -0,0 +1,17 @@ + + +# ReferenceLinesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_file** | **String** | The file's name in where the code reference has been found. (Appears on the ConfigCat Dashboard) | | +|**fileUrl** | **String** | The file's url. (Used to point to the file on the repository's website) | [optional] | +|**preLines** | [**List<ReferenceLineRequest>**](ReferenceLineRequest.md) | The lines before the actual reference line. | [optional] | +|**postLines** | [**List<ReferenceLineRequest>**](ReferenceLineRequest.md) | The lines after the actual reference line. | [optional] | +|**referenceLine** | [**ReferenceLineRequest**](ReferenceLineRequest.md) | | | + + + diff --git a/docs/ReplaceSettingModel.md b/docs/ReplaceSettingModel.md new file mode 100644 index 0000000..62425a8 --- /dev/null +++ b/docs/ReplaceSettingModel.md @@ -0,0 +1,16 @@ + + +# ReplaceSettingModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**hint** | **String** | A short description for the setting, shown on the Dashboard UI. | [optional] | +|**tags** | **List<Long>** | The IDs of the tags which are attached to the setting. | [optional] | +|**order** | **Integer** | The order of the Setting represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | +|**name** | **String** | The name of the Feature Flag or Setting. | [optional] | + + + diff --git a/docs/RolloutPercentageItemModel.md b/docs/RolloutPercentageItemModel.md new file mode 100644 index 0000000..d822f8b --- /dev/null +++ b/docs/RolloutPercentageItemModel.md @@ -0,0 +1,14 @@ + + +# RolloutPercentageItemModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**percentage** | **Long** | The percentage value for the rule. | | +|**value** | [**SettingValueType**](SettingValueType.md) | The value to serve when the user falls in the percentage rule. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. | | + + + diff --git a/docs/RolloutRuleComparator.md b/docs/RolloutRuleComparator.md new file mode 100644 index 0000000..0f489a9 --- /dev/null +++ b/docs/RolloutRuleComparator.md @@ -0,0 +1,45 @@ + + +# RolloutRuleComparator + +## Enum + + +* `IS_ONE_OF` (value: `"isOneOf"`) + +* `IS_NOT_ONE_OF` (value: `"isNotOneOf"`) + +* `CONTAINS` (value: `"contains"`) + +* `DOES_NOT_CONTAIN` (value: `"doesNotContain"`) + +* `SEM_VER_IS_ONE_OF` (value: `"semVerIsOneOf"`) + +* `SEM_VER_IS_NOT_ONE_OF` (value: `"semVerIsNotOneOf"`) + +* `SEM_VER_LESS` (value: `"semVerLess"`) + +* `SEM_VER_LESS_OR_EQUALS` (value: `"semVerLessOrEquals"`) + +* `SEM_VER_GREATER` (value: `"semVerGreater"`) + +* `SEM_VER_GREATER_OR_EQUALS` (value: `"semVerGreaterOrEquals"`) + +* `NUMBER_EQUALS` (value: `"numberEquals"`) + +* `NUMBER_DOES_NOT_EQUAL` (value: `"numberDoesNotEqual"`) + +* `NUMBER_LESS` (value: `"numberLess"`) + +* `NUMBER_LESS_OR_EQUALS` (value: `"numberLessOrEquals"`) + +* `NUMBER_GREATER` (value: `"numberGreater"`) + +* `NUMBER_GREATER_OR_EQUALS` (value: `"numberGreaterOrEquals"`) + +* `SENSITIVE_IS_ONE_OF` (value: `"sensitiveIsOneOf"`) + +* `SENSITIVE_IS_NOT_ONE_OF` (value: `"sensitiveIsNotOneOf"`) + + + diff --git a/docs/RolloutRuleModel.md b/docs/RolloutRuleModel.md new file mode 100644 index 0000000..abc3216 --- /dev/null +++ b/docs/RolloutRuleModel.md @@ -0,0 +1,18 @@ + + +# RolloutRuleModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**comparisonAttribute** | **String** | The user attribute to compare. | | +|**comparator** | **RolloutRuleComparator** | | | +|**comparisonValue** | **String** | The value to compare against. | | +|**value** | [**SettingValueType**](SettingValueType.md) | The value to serve when the comparison matches. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. | | +|**segmentComparator** | **SegmentComparator** | | | +|**segmentId** | **UUID** | The segment to compare against. | | + + + diff --git a/docs/SdkKeysApi.md b/docs/SdkKeysApi.md new file mode 100644 index 0000000..33dc9d2 --- /dev/null +++ b/docs/SdkKeysApi.md @@ -0,0 +1,82 @@ +# SdkKeysApi + +All URIs are relative to *https://api.configcat.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getSdkKeys**](SdkKeysApi.md#getSdkKeys) | **GET** /v1/configs/{configId}/environments/{environmentId} | Get SDK Key | + + + +# **getSdkKeys** +> SdkKeysModel getSdkKeys(configId, environmentId) + +Get SDK Key + +This endpoint returns the SDK Key for your Config in a specified Environment. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.SdkKeysApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + SdkKeysApi apiInstance = new SdkKeysApi(defaultClient); + UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. + UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. + try { + SdkKeysModel result = apiInstance.getSdkKeys(configId, environmentId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SdkKeysApi#getSdkKeys"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **configId** | **UUID**| The identifier of the Config. | | +| **environmentId** | **UUID**| The identifier of the Environment. | | + +### Return type + +[**SdkKeysModel**](SdkKeysModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + diff --git a/docs/SdkKeysModel.md b/docs/SdkKeysModel.md new file mode 100644 index 0000000..8c6e57e --- /dev/null +++ b/docs/SdkKeysModel.md @@ -0,0 +1,14 @@ + + +# SdkKeysModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**primary** | **String** | The primary SDK key. | | +|**secondary** | **String** | The secondary SDK key. | | + + + diff --git a/docs/SegmentComparator.md b/docs/SegmentComparator.md new file mode 100644 index 0000000..1649f44 --- /dev/null +++ b/docs/SegmentComparator.md @@ -0,0 +1,13 @@ + + +# SegmentComparator + +## Enum + + +* `IS_IN` (value: `"isIn"`) + +* `IS_NOT_IN` (value: `"isNotIn"`) + + + diff --git a/docs/SegmentConditionModel.md b/docs/SegmentConditionModel.md new file mode 100644 index 0000000..4a0a1a2 --- /dev/null +++ b/docs/SegmentConditionModel.md @@ -0,0 +1,15 @@ + + +# SegmentConditionModel + +Describes a condition that is based on a segment. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**segmentId** | **UUID** | The segment's identifier. | | +|**comparator** | **SegmentComparator** | | | + + + diff --git a/docs/SegmentListModel.md b/docs/SegmentListModel.md new file mode 100644 index 0000000..6a18b0f --- /dev/null +++ b/docs/SegmentListModel.md @@ -0,0 +1,23 @@ + + +# SegmentListModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**product** | [**ProductModel**](ProductModel.md) | | | +|**segmentId** | **UUID** | Identifier of the Segment. | | +|**name** | **String** | Name of the Segment. | | +|**description** | **String** | Description of the Segment. | | +|**creatorEmail** | **String** | The email of the user who created the Segment. | | +|**creatorFullName** | **String** | The name of the user who created the Segment. | | +|**createdAt** | **OffsetDateTime** | The date and time when the Segment was created. | | +|**lastUpdaterEmail** | **String** | The email of the user who last updated the Segment. | | +|**lastUpdaterFullName** | **String** | The name of the user who last updated the Segment. | | +|**updatedAt** | **OffsetDateTime** | The date and time when the Segment was last updated. | | +|**usage** | **Integer** | Determines how many Feature Flags and Settings are using the Segment. | | + + + diff --git a/docs/SegmentModel.md b/docs/SegmentModel.md new file mode 100644 index 0000000..0c71af8 --- /dev/null +++ b/docs/SegmentModel.md @@ -0,0 +1,25 @@ + + +# SegmentModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**product** | [**ProductModel**](ProductModel.md) | | | +|**segmentId** | **UUID** | Identifier of the Segment. | | +|**name** | **String** | Name of the Segment. | | +|**description** | **String** | Description of the Segment. | | +|**creatorEmail** | **String** | The email of the user who created the Segment. | | +|**creatorFullName** | **String** | The name of the user who created the Segment. | | +|**createdAt** | **OffsetDateTime** | The date and time when the Segment was created. | | +|**lastUpdaterEmail** | **String** | The email of the user who last updated the Segment. | | +|**lastUpdaterFullName** | **String** | The name of the user who last updated the Segment. | | +|**updatedAt** | **OffsetDateTime** | The date and time when the Segment was last updated. | | +|**comparisonAttribute** | **String** | The user's attribute the evaluation process must take into account. | | +|**comparator** | **RolloutRuleComparator** | | | +|**comparisonValue** | **String** | The value to compare with the given user attribute's value. | | + + + diff --git a/docs/SegmentsApi.md b/docs/SegmentsApi.md new file mode 100644 index 0000000..5c64623 --- /dev/null +++ b/docs/SegmentsApi.md @@ -0,0 +1,371 @@ +# SegmentsApi + +All URIs are relative to *https://api.configcat.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createSegment**](SegmentsApi.md#createSegment) | **POST** /v1/products/{productId}/segments | Create Segment | +| [**deleteSegment**](SegmentsApi.md#deleteSegment) | **DELETE** /v1/segments/{segmentId} | Delete Segment | +| [**getSegment**](SegmentsApi.md#getSegment) | **GET** /v1/segments/{segmentId} | Get Segment | +| [**getSegments**](SegmentsApi.md#getSegments) | **GET** /v1/products/{productId}/segments | List Segments | +| [**updateSegment**](SegmentsApi.md#updateSegment) | **PUT** /v1/segments/{segmentId} | Update Segment | + + + +# **createSegment** +> SegmentModel createSegment(productId, createSegmentModel) + +Create Segment + +This endpoint creates a new Segment in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.SegmentsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + SegmentsApi apiInstance = new SegmentsApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + CreateSegmentModel createSegmentModel = new CreateSegmentModel(); // CreateSegmentModel | + try { + SegmentModel result = apiInstance.createSegment(productId, createSegmentModel); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SegmentsApi#createSegment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | +| **createSegmentModel** | [**CreateSegmentModel**](CreateSegmentModel.md)| | | + +### Return type + +[**SegmentModel**](SegmentModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | When the creation was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **deleteSegment** +> deleteSegment(segmentId) + +Delete Segment + +This endpoint removes a Segment identified by the `segmentId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.SegmentsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + SegmentsApi apiInstance = new SegmentsApi(defaultClient); + UUID segmentId = UUID.randomUUID(); // UUID | The identifier of the Segment. + try { + apiInstance.deleteSegment(segmentId); + } catch (ApiException e) { + System.err.println("Exception when calling SegmentsApi#deleteSegment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **segmentId** | **UUID**| The identifier of the Segment. | | + +### Return type + +null (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | When the delete was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getSegment** +> SegmentModel getSegment(segmentId) + +Get Segment + +This endpoint returns the metadata of a Segment identified by the `segmentId`. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.SegmentsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + SegmentsApi apiInstance = new SegmentsApi(defaultClient); + UUID segmentId = UUID.randomUUID(); // UUID | The identifier of the Segment. + try { + SegmentModel result = apiInstance.getSegment(segmentId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SegmentsApi#getSegment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **segmentId** | **UUID**| The identifier of the Segment. | | + +### Return type + +[**SegmentModel**](SegmentModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When everything is ok, the config data returned. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getSegments** +> List<SegmentListModel> getSegments(productId) + +List Segments + +This endpoint returns the list of the Segments that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.SegmentsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + SegmentsApi apiInstance = new SegmentsApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + try { + List result = apiInstance.getSegments(productId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SegmentsApi#getSegments"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | + +### Return type + +[**List<SegmentListModel>**](SegmentListModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **updateSegment** +> SegmentModel updateSegment(segmentId, updateSegmentModel) + +Update Segment + +This endpoint updates a Segment identified by the `segmentId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.SegmentsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + SegmentsApi apiInstance = new SegmentsApi(defaultClient); + UUID segmentId = UUID.randomUUID(); // UUID | The identifier of the Segment. + UpdateSegmentModel updateSegmentModel = new UpdateSegmentModel(); // UpdateSegmentModel | + try { + SegmentModel result = apiInstance.updateSegment(segmentId, updateSegmentModel); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SegmentsApi#updateSegment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **segmentId** | **UUID**| The identifier of the Segment. | | +| **updateSegmentModel** | [**UpdateSegmentModel**](UpdateSegmentModel.md)| | | + +### Return type + +[**SegmentModel**](SegmentModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + diff --git a/docs/SettingDataModel.md b/docs/SettingDataModel.md new file mode 100644 index 0000000..8181e2d --- /dev/null +++ b/docs/SettingDataModel.md @@ -0,0 +1,23 @@ + + +# SettingDataModel + +Metadata of a Feature Flag or Setting. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**settingId** | **Integer** | Identifier of the Feature Flag or Setting. | | +|**key** | **String** | Key of the Feature Flag or Setting. | | +|**name** | **String** | Name of the Feature Flag or Setting. | | +|**hint** | **String** | Description of the Feature Flag or Setting. | | +|**settingType** | **SettingType** | | | +|**order** | **Integer** | The order of the Feature Flag or Setting represented on the ConfigCat Dashboard. | | +|**createdAt** | **OffsetDateTime** | The creation time of the Feature Flag or Setting. | | +|**creatorEmail** | **String** | The user's email address who created the Feature Flag or Setting. | | +|**creatorFullName** | **String** | The user's name who created the Feature Flag or Setting. | | +|**isWatching** | **Boolean** | | | + + + diff --git a/docs/SettingFormulaModel.md b/docs/SettingFormulaModel.md new file mode 100644 index 0000000..bd26365 --- /dev/null +++ b/docs/SettingFormulaModel.md @@ -0,0 +1,27 @@ + + +# SettingFormulaModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**lastVersionId** | **UUID** | | | +|**defaultValue** | [**ValueModel**](ValueModel.md) | | | +|**targetingRules** | [**List<TargetingRuleModel>**](TargetingRuleModel.md) | The targeting rules of the Feature Flag or Setting. | | +|**setting** | [**SettingDataModel**](SettingDataModel.md) | | | +|**updatedAt** | **OffsetDateTime** | The last updated date and time when the Feature Flag or Setting. | | +|**percentageEvaluationAttribute** | **String** | The user attribute used for percentage evaluation. If not set, it defaults to the `Identifier` user object attribute. | | +|**lastUpdaterUserEmail** | **String** | The email of the user who last updated the Feature Flag or Setting. | | +|**lastUpdaterUserFullName** | **String** | The name of the user who last updated the Feature Flag or Setting. | | +|**integrationLinks** | [**List<IntegrationLinkModel>**](IntegrationLinkModel.md) | The integration links attached to the Feature Flag or Setting. | | +|**settingTags** | [**List<SettingTagModel>**](SettingTagModel.md) | The tags attached to the Feature Flag or Setting. | | +|**settingIdsWherePrerequisite** | **List<Integer>** | List of Feature Flag and Setting IDs where the actual Feature Flag or Setting is prerequisite. | | +|**config** | [**ConfigModel**](ConfigModel.md) | | | +|**environment** | [**EnvironmentModel**](EnvironmentModel.md) | | | +|**readOnly** | **Boolean** | | | +|**featureFlagLimitations** | [**FeatureFlagLimitations**](FeatureFlagLimitations.md) | | | + + + diff --git a/docs/SettingModel.md b/docs/SettingModel.md new file mode 100644 index 0000000..5548de1 --- /dev/null +++ b/docs/SettingModel.md @@ -0,0 +1,23 @@ + + +# SettingModel + +Metadata of a Feature Flag or Setting. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**settingId** | **Integer** | Identifier of the Feature Flag or Setting. | | +|**key** | **String** | Key of the Feature Flag or Setting. | | +|**name** | **String** | Name of the Feature Flag or Setting. | | +|**hint** | **String** | Description of the Feature Flag or Setting. | | +|**order** | **Integer** | The order of the Feature Flag or Setting represented on the ConfigCat Dashboard. | | +|**settingType** | **SettingType** | | | +|**configId** | **UUID** | Identifier of the Feature Flag's Config. | | +|**configName** | **String** | Name of the Feature Flag's Config. | | +|**createdAt** | **OffsetDateTime** | The creation time of the Feature Flag or Setting. | | +|**tags** | [**List<TagModel>**](TagModel.md) | The tags attached to the Feature Flag or Setting. | | + + + diff --git a/docs/SettingTagModel.md b/docs/SettingTagModel.md new file mode 100644 index 0000000..8160ba0 --- /dev/null +++ b/docs/SettingTagModel.md @@ -0,0 +1,16 @@ + + +# SettingTagModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**settingTagId** | **Long** | | | +|**tagId** | **Long** | | | +|**name** | **String** | | | +|**color** | **String** | | | + + + diff --git a/docs/SettingType.md b/docs/SettingType.md new file mode 100644 index 0000000..6fa7dff --- /dev/null +++ b/docs/SettingType.md @@ -0,0 +1,17 @@ + + +# SettingType + +## Enum + + +* `BOOLEAN` (value: `"boolean"`) + +* `STRING` (value: `"string"`) + +* `INT` (value: `"int"`) + +* `DOUBLE` (value: `"double"`) + + + diff --git a/docs/SettingValueModel.md b/docs/SettingValueModel.md new file mode 100644 index 0000000..a76855e --- /dev/null +++ b/docs/SettingValueModel.md @@ -0,0 +1,25 @@ + + +# SettingValueModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**setting** | [**SettingDataModel**](SettingDataModel.md) | | | +|**updatedAt** | **OffsetDateTime** | The last updated date and time when the Feature Flag or Setting. | | +|**lastUpdaterUserEmail** | **String** | The email of the user who last updated the Feature Flag or Setting. | | +|**lastUpdaterUserFullName** | **String** | The name of the user who last updated the Feature Flag or Setting. | | +|**integrationLinks** | [**List<IntegrationLinkModel>**](IntegrationLinkModel.md) | The integration links attached to the Feature Flag or Setting. | | +|**settingTags** | [**List<SettingTagModel>**](SettingTagModel.md) | The tags attached to the Feature Flag or Setting. | | +|**rolloutRules** | [**List<RolloutRuleModel>**](RolloutRuleModel.md) | The targeting rule collection. | | +|**rolloutPercentageItems** | [**List<RolloutPercentageItemModel>**](RolloutPercentageItemModel.md) | The percentage rule collection. | | +|**value** | [**SettingValueType**](SettingValueType.md) | The value to serve. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. | | +|**config** | [**ConfigModel**](ConfigModel.md) | | | +|**environment** | [**EnvironmentModel**](EnvironmentModel.md) | | | +|**featureFlagLimitations** | [**FeatureFlagLimitations**](FeatureFlagLimitations.md) | | | +|**readOnly** | **Boolean** | | | + + + diff --git a/docs/SettingValueType.md b/docs/SettingValueType.md new file mode 100644 index 0000000..7f593b8 --- /dev/null +++ b/docs/SettingValueType.md @@ -0,0 +1,12 @@ + + +# SettingValueType + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| + + + diff --git a/docs/StaleFlagConfigModel.md b/docs/StaleFlagConfigModel.md new file mode 100644 index 0000000..6544b79 --- /dev/null +++ b/docs/StaleFlagConfigModel.md @@ -0,0 +1,17 @@ + + +# StaleFlagConfigModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**configId** | **UUID** | Identifier of the Config. | | +|**name** | **String** | Name of the Config. | | +|**evaluationVersion** | **EvaluationVersion** | | | +|**hasCodeReferences** | **Boolean** | Config has code references uploaded. | | +|**settings** | [**List<StaleFlagSettingModel>**](StaleFlagSettingModel.md) | Stale feature flags. | | + + + diff --git a/docs/StaleFlagEnvironmentModel.md b/docs/StaleFlagEnvironmentModel.md new file mode 100644 index 0000000..c7a0e48 --- /dev/null +++ b/docs/StaleFlagEnvironmentModel.md @@ -0,0 +1,14 @@ + + +# StaleFlagEnvironmentModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**environmentId** | **UUID** | Identifier of the Environment. | | +|**name** | **String** | Name of the Environment. | | + + + diff --git a/docs/StaleFlagProductModel.md b/docs/StaleFlagProductModel.md new file mode 100644 index 0000000..6b13bcc --- /dev/null +++ b/docs/StaleFlagProductModel.md @@ -0,0 +1,16 @@ + + +# StaleFlagProductModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**productId** | **UUID** | Identifier of the Product. | | +|**name** | **String** | Name of the Product. | | +|**configs** | [**List<StaleFlagConfigModel>**](StaleFlagConfigModel.md) | Configs that contain stale feature flags. | | +|**environments** | [**List<StaleFlagEnvironmentModel>**](StaleFlagEnvironmentModel.md) | Environment list. | | + + + diff --git a/docs/StaleFlagReminderScope.md b/docs/StaleFlagReminderScope.md new file mode 100644 index 0000000..7d3d6dc --- /dev/null +++ b/docs/StaleFlagReminderScope.md @@ -0,0 +1,13 @@ + + +# StaleFlagReminderScope + +## Enum + + +* `ALL` (value: `"all"`) + +* `WATCHED_BY_ME` (value: `"watchedByMe"`) + + + diff --git a/docs/StaleFlagSettingModel.md b/docs/StaleFlagSettingModel.md new file mode 100644 index 0000000..150323c --- /dev/null +++ b/docs/StaleFlagSettingModel.md @@ -0,0 +1,19 @@ + + +# StaleFlagSettingModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**settingId** | **Integer** | Identifier of the Feature Flag or Setting. | | +|**name** | **String** | Name of the Feature Flag or Setting. | | +|**key** | **String** | Key of the Feature Flag or Setting. | | +|**hint** | **String** | Description of the Feature Flag or Setting. | | +|**hasCodeReferences** | **Boolean** | Feature Flag or Setting has code references uploaded. | | +|**tags** | [**List<StaleFlagSettingTagModel>**](StaleFlagSettingTagModel.md) | The tags' identifiers attached to the Feature Flag or Setting. | | +|**settingValues** | [**List<StaleFlagSettingValueModel>**](StaleFlagSettingValueModel.md) | Environment level feature flag stale data. | | + + + diff --git a/docs/StaleFlagSettingTagModel.md b/docs/StaleFlagSettingTagModel.md new file mode 100644 index 0000000..2333f1b --- /dev/null +++ b/docs/StaleFlagSettingTagModel.md @@ -0,0 +1,14 @@ + + +# StaleFlagSettingTagModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**tagId** | **Long** | | | +|**settingTagId** | **Long** | | | + + + diff --git a/docs/StaleFlagSettingValueModel.md b/docs/StaleFlagSettingValueModel.md new file mode 100644 index 0000000..62d67cc --- /dev/null +++ b/docs/StaleFlagSettingValueModel.md @@ -0,0 +1,15 @@ + + +# StaleFlagSettingValueModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**environmentId** | **UUID** | Identifier of the Environment. | | +|**updatedAt** | **OffsetDateTime** | The last updated date and time when the Feature Flag or Setting. | | +|**isStale** | **Boolean** | Is the feature flag considered stale in the environment. | | + + + diff --git a/docs/StaleFlagStaleInEnvironmentsType.md b/docs/StaleFlagStaleInEnvironmentsType.md new file mode 100644 index 0000000..b006561 --- /dev/null +++ b/docs/StaleFlagStaleInEnvironmentsType.md @@ -0,0 +1,13 @@ + + +# StaleFlagStaleInEnvironmentsType + +## Enum + + +* `STALE_IN_ANY_ENVIRONMENTS` (value: `"staleInAnyEnvironments"`) + +* `STALE_IN_ALL_ENVIRONMENTS` (value: `"staleInAllEnvironments"`) + + + diff --git a/docs/TagModel.md b/docs/TagModel.md new file mode 100644 index 0000000..dac91eb --- /dev/null +++ b/docs/TagModel.md @@ -0,0 +1,16 @@ + + +# TagModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**product** | [**ProductModel**](ProductModel.md) | | | +|**tagId** | **Long** | Identifier of the Tag. | | +|**name** | **String** | Name of the Tag. | | +|**color** | **String** | The configured color of the Tag. | | + + + diff --git a/docs/TagsApi.md b/docs/TagsApi.md new file mode 100644 index 0000000..7bca966 --- /dev/null +++ b/docs/TagsApi.md @@ -0,0 +1,441 @@ +# TagsApi + +All URIs are relative to *https://api.configcat.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createTag**](TagsApi.md#createTag) | **POST** /v1/products/{productId}/tags | Create Tag | +| [**deleteTag**](TagsApi.md#deleteTag) | **DELETE** /v1/tags/{tagId} | Delete Tag | +| [**getSettingsByTag**](TagsApi.md#getSettingsByTag) | **GET** /v1/tags/{tagId}/settings | List Settings by Tag | +| [**getTag**](TagsApi.md#getTag) | **GET** /v1/tags/{tagId} | Get Tag | +| [**getTags**](TagsApi.md#getTags) | **GET** /v1/products/{productId}/tags | List Tags | +| [**updateTag**](TagsApi.md#updateTag) | **PUT** /v1/tags/{tagId} | Update Tag | + + + +# **createTag** +> TagModel createTag(productId, createTagModel) + +Create Tag + +This endpoint creates a new Tag in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.TagsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + TagsApi apiInstance = new TagsApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Organization. + CreateTagModel createTagModel = new CreateTagModel(); // CreateTagModel | + try { + TagModel result = apiInstance.createTag(productId, createTagModel); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TagsApi#createTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Organization. | | +| **createTagModel** | [**CreateTagModel**](CreateTagModel.md)| | | + +### Return type + +[**TagModel**](TagModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | When the creation was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **deleteTag** +> deleteTag(tagId) + +Delete Tag + +This endpoint deletes a Tag identified by the `tagId` parameter. To remove a Tag from a Feature Flag or Setting use the [Update Flag](#operation/update-setting) endpoint. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.TagsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + TagsApi apiInstance = new TagsApi(defaultClient); + Long tagId = 56L; // Long | The identifier of the Tag. + try { + apiInstance.deleteTag(tagId); + } catch (ApiException e) { + System.err.println("Exception when calling TagsApi#deleteTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tagId** | **Long**| The identifier of the Tag. | | + +### Return type + +null (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | When the delete was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getSettingsByTag** +> List<SettingModel> getSettingsByTag(tagId) + +List Settings by Tag + +This endpoint returns the list of the Settings that has the specified Tag, identified by the `tagId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.TagsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + TagsApi apiInstance = new TagsApi(defaultClient); + Long tagId = 56L; // Long | The identifier of the Tag. + try { + List result = apiInstance.getSettingsByTag(tagId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TagsApi#getSettingsByTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tagId** | **Long**| The identifier of the Tag. | | + +### Return type + +[**List<SettingModel>**](SettingModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When everything is ok, the settings data returned. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getTag** +> TagModel getTag(tagId) + +Get Tag + +This endpoint returns the metadata of a Tag identified by the `tagId`. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.TagsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + TagsApi apiInstance = new TagsApi(defaultClient); + Long tagId = 56L; // Long | The identifier of the Tag. + try { + TagModel result = apiInstance.getTag(tagId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TagsApi#getTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tagId** | **Long**| The identifier of the Tag. | | + +### Return type + +[**TagModel**](TagModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When everything is ok, the tag data returned. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getTags** +> List<TagModel> getTags(productId) + +List Tags + +This endpoint returns the list of the Tags in a specified Product, identified by the `productId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.TagsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + TagsApi apiInstance = new TagsApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + try { + List result = apiInstance.getTags(productId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TagsApi#getTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | + +### Return type + +[**List<TagModel>**](TagModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **updateTag** +> TagModel updateTag(tagId, updateTagModel) + +Update Tag + +This endpoint updates a Tag identified by the `tagId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.TagsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + TagsApi apiInstance = new TagsApi(defaultClient); + Long tagId = 56L; // Long | The identifier of the Tag. + UpdateTagModel updateTagModel = new UpdateTagModel(); // UpdateTagModel | + try { + TagModel result = apiInstance.updateTag(tagId, updateTagModel); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TagsApi#updateTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tagId** | **Long**| The identifier of the Tag. | | +| **updateTagModel** | [**UpdateTagModel**](UpdateTagModel.md)| | | + +### Return type + +[**TagModel**](TagModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + diff --git a/docs/TargetingRuleModel.md b/docs/TargetingRuleModel.md new file mode 100644 index 0000000..720d7f1 --- /dev/null +++ b/docs/TargetingRuleModel.md @@ -0,0 +1,15 @@ + + +# TargetingRuleModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**conditions** | [**List<ConditionModel>**](ConditionModel.md) | The list of conditions that are combined with logical AND operators. It can be one of the following: - User condition - Segment condition - Prerequisite flag condition | | +|**percentageOptions** | [**List<PercentageOptionModel>**](PercentageOptionModel.md) | The percentage options from where the evaluation process will choose a value based on the flag's percentage evaluation attribute. | | +|**value** | [**ValueModel**](ValueModel.md) | | | + + + diff --git a/docs/UpdateComparisonValueListModel.md b/docs/UpdateComparisonValueListModel.md new file mode 100644 index 0000000..4f92313 --- /dev/null +++ b/docs/UpdateComparisonValueListModel.md @@ -0,0 +1,14 @@ + + +# UpdateComparisonValueListModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**value** | **String** | The actual comparison value. | | +|**hint** | **String** | An optional hint for the comparison value. | [optional] | + + + diff --git a/docs/UpdateComparisonValueModel.md b/docs/UpdateComparisonValueModel.md new file mode 100644 index 0000000..77c687d --- /dev/null +++ b/docs/UpdateComparisonValueModel.md @@ -0,0 +1,16 @@ + + +# UpdateComparisonValueModel + +The value that the user object's attribute is compared to. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**stringValue** | **String** | The string representation of the comparison value. | [optional] | +|**doubleValue** | **Double** | The number representation of the comparison value. | [optional] | +|**listValue** | [**List<UpdateComparisonValueListModel>**](UpdateComparisonValueListModel.md) | The list representation of the comparison value. | [optional] | + + + diff --git a/docs/UpdateConditionModel.md b/docs/UpdateConditionModel.md new file mode 100644 index 0000000..caef729 --- /dev/null +++ b/docs/UpdateConditionModel.md @@ -0,0 +1,15 @@ + + +# UpdateConditionModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userCondition** | [**UpdateUserConditionModel**](UpdateUserConditionModel.md) | | [optional] | +|**segmentCondition** | [**UpdateSegmentConditionModel**](UpdateSegmentConditionModel.md) | | [optional] | +|**prerequisiteFlagCondition** | [**UpdatePrerequisiteFlagConditionModel**](UpdatePrerequisiteFlagConditionModel.md) | | [optional] | + + + diff --git a/docs/UpdateConfigRequest.md b/docs/UpdateConfigRequest.md new file mode 100644 index 0000000..574d98e --- /dev/null +++ b/docs/UpdateConfigRequest.md @@ -0,0 +1,15 @@ + + +# UpdateConfigRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The name of the Config. | [optional] | +|**description** | **String** | The description of the Config. | [optional] | +|**order** | **Integer** | The order of the Config represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | + + + diff --git a/docs/UpdateEnvironmentModel.md b/docs/UpdateEnvironmentModel.md new file mode 100644 index 0000000..3eb603e --- /dev/null +++ b/docs/UpdateEnvironmentModel.md @@ -0,0 +1,16 @@ + + +# UpdateEnvironmentModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The name of the Environment. | [optional] | +|**color** | **String** | The color of the Environment. RGB or HTML color codes are allowed. | [optional] | +|**description** | **String** | The description of the Environment. | [optional] | +|**order** | **Integer** | The order of the Environment represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | + + + diff --git a/docs/UpdateEvaluationFormulaModel.md b/docs/UpdateEvaluationFormulaModel.md new file mode 100644 index 0000000..b53cabd --- /dev/null +++ b/docs/UpdateEvaluationFormulaModel.md @@ -0,0 +1,15 @@ + + +# UpdateEvaluationFormulaModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**defaultValue** | [**UpdateValueModel**](UpdateValueModel.md) | | | +|**targetingRules** | [**List<UpdateTargetingRuleModel>**](UpdateTargetingRuleModel.md) | The targeting rules of the Feature Flag or Setting. | [optional] | +|**percentageEvaluationAttribute** | **String** | The user attribute used for percentage evaluation. If not set, it defaults to the `Identifier` user object attribute. | [optional] | + + + diff --git a/docs/UpdateEvaluationFormulaWithIdModel.md b/docs/UpdateEvaluationFormulaWithIdModel.md new file mode 100644 index 0000000..fb53285 --- /dev/null +++ b/docs/UpdateEvaluationFormulaWithIdModel.md @@ -0,0 +1,16 @@ + + +# UpdateEvaluationFormulaWithIdModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**defaultValue** | [**UpdateValueModel**](UpdateValueModel.md) | | | +|**targetingRules** | [**List<UpdateTargetingRuleModel>**](UpdateTargetingRuleModel.md) | The targeting rules of the Feature Flag or Setting. | [optional] | +|**percentageEvaluationAttribute** | **String** | The user attribute used for percentage evaluation. If not set, it defaults to the `Identifier` user object attribute. | [optional] | +|**settingId** | **Integer** | The identifier of the feature flag or setting. | [optional] | + + + diff --git a/docs/UpdateEvaluationFormulasModel.md b/docs/UpdateEvaluationFormulasModel.md new file mode 100644 index 0000000..4cfe0ab --- /dev/null +++ b/docs/UpdateEvaluationFormulasModel.md @@ -0,0 +1,13 @@ + + +# UpdateEvaluationFormulasModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**updateFormulas** | [**List<UpdateEvaluationFormulaWithIdModel>**](UpdateEvaluationFormulaWithIdModel.md) | Evaluation descriptors of each updated Feature Flag and Setting. | [optional] | + + + diff --git a/docs/UpdateMemberPermissionsRequest.md b/docs/UpdateMemberPermissionsRequest.md new file mode 100644 index 0000000..07ce20a --- /dev/null +++ b/docs/UpdateMemberPermissionsRequest.md @@ -0,0 +1,16 @@ + + +# UpdateMemberPermissionsRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**permissionGroupIds** | **List<Long>** | List of Permission Group identifiers to where the Member should be added. | [optional] | +|**isAdmin** | **Boolean** | Indicates that the member must be Organization Admin. | [optional] | +|**isBillingManager** | **Boolean** | Indicates that the member must be Billing Manager. | [optional] | +|**removeFromPermissionGroupsWhereIdNotSet** | **Boolean** | When `true`, the member will be removed from those Permission Groups that are not listed in the `permissionGroupIds` field. | [optional] | + + + diff --git a/docs/UpdatePercentageOptionModel.md b/docs/UpdatePercentageOptionModel.md new file mode 100644 index 0000000..69afbff --- /dev/null +++ b/docs/UpdatePercentageOptionModel.md @@ -0,0 +1,14 @@ + + +# UpdatePercentageOptionModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**percentage** | **Integer** | A number between 0 and 100 that represents a randomly allocated fraction of the users. | | +|**value** | [**UpdateValueModel**](UpdateValueModel.md) | | | + + + diff --git a/docs/UpdatePermissionGroupRequest.md b/docs/UpdatePermissionGroupRequest.md new file mode 100644 index 0000000..2d40ebf --- /dev/null +++ b/docs/UpdatePermissionGroupRequest.md @@ -0,0 +1,37 @@ + + +# UpdatePermissionGroupRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Name of the Permission Group. | [optional] | +|**canManageMembers** | **Boolean** | Group members can manage team members. | [optional] | +|**canCreateOrUpdateConfig** | **Boolean** | Group members can create/update Configs. | [optional] | +|**canDeleteConfig** | **Boolean** | Group members can delete Configs. | [optional] | +|**canCreateOrUpdateEnvironment** | **Boolean** | Group members can create/update Environments. | [optional] | +|**canDeleteEnvironment** | **Boolean** | Group members can delete Environments. | [optional] | +|**canCreateOrUpdateSetting** | **Boolean** | Group members can create/update Feature Flags and Settings. | [optional] | +|**canTagSetting** | **Boolean** | Group members can attach/detach Tags to Feature Flags and Settings. | [optional] | +|**canDeleteSetting** | **Boolean** | Group members can delete Feature Flags and Settings. | [optional] | +|**canCreateOrUpdateTag** | **Boolean** | Group members can create/update Tags. | [optional] | +|**canDeleteTag** | **Boolean** | Group members can delete Tags. | [optional] | +|**canManageWebhook** | **Boolean** | Group members can create/update/delete Webhooks. | [optional] | +|**canUseExportImport** | **Boolean** | Group members can use the export/import feature. | [optional] | +|**canManageProductPreferences** | **Boolean** | Group members can update Product preferences. | [optional] | +|**canManageIntegrations** | **Boolean** | Group members can add and configure integrations. | [optional] | +|**canViewSdkKey** | **Boolean** | Group members has access to SDK keys. | [optional] | +|**canRotateSdkKey** | **Boolean** | Group members can rotate SDK keys. | [optional] | +|**canCreateOrUpdateSegments** | **Boolean** | Group members can create/update Segments. | [optional] | +|**canDeleteSegments** | **Boolean** | Group members can delete Segments. | [optional] | +|**canViewProductAuditLog** | **Boolean** | Group members has access to audit logs. | [optional] | +|**canViewProductStatistics** | **Boolean** | Group members has access to product statistics. | [optional] | +|**canDisable2FA** | **Boolean** | Group members can disable two-factor authentication for other members. | [optional] | +|**accessType** | **AccessType** | | [optional] | +|**newEnvironmentAccessType** | **EnvironmentAccessType** | | [optional] | +|**environmentAccesses** | [**List<CreateOrUpdateEnvironmentAccessModel>**](CreateOrUpdateEnvironmentAccessModel.md) | List of environment specific permissions. | [optional] | + + + diff --git a/docs/UpdatePreferencesRequest.md b/docs/UpdatePreferencesRequest.md new file mode 100644 index 0000000..60ca221 --- /dev/null +++ b/docs/UpdatePreferencesRequest.md @@ -0,0 +1,17 @@ + + +# UpdatePreferencesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**reasonRequired** | **Boolean** | Indicates that a mandatory note is required for saving and publishing. | [optional] | +|**keyGenerationMode** | **KeyGenerationMode** | | [optional] | +|**showVariationId** | **Boolean** | Indicates whether a variation ID's must be shown on the ConfigCat Dashboard. | [optional] | +|**mandatorySettingHint** | **Boolean** | Indicates whether Feature flags and Settings must have a hint. | [optional] | +|**reasonRequiredEnvironments** | [**List<UpdateReasonRequiredEnvironmentModel>**](UpdateReasonRequiredEnvironmentModel.md) | List of Environments where mandatory note must be set before saving and publishing. | [optional] | + + + diff --git a/docs/UpdatePrerequisiteFlagConditionModel.md b/docs/UpdatePrerequisiteFlagConditionModel.md new file mode 100644 index 0000000..0c1ec5c --- /dev/null +++ b/docs/UpdatePrerequisiteFlagConditionModel.md @@ -0,0 +1,16 @@ + + +# UpdatePrerequisiteFlagConditionModel + +Describes a condition that is based on a prerequisite flag. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**prerequisiteSettingId** | **Integer** | The prerequisite flag's identifier. | | +|**comparator** | **PrerequisiteComparator** | | | +|**prerequisiteComparisonValue** | [**UpdateValueModel**](UpdateValueModel.md) | | | + + + diff --git a/docs/UpdateProductRequest.md b/docs/UpdateProductRequest.md new file mode 100644 index 0000000..64b5060 --- /dev/null +++ b/docs/UpdateProductRequest.md @@ -0,0 +1,15 @@ + + +# UpdateProductRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The name of the Product. | [optional] | +|**description** | **String** | The description of the Product. | [optional] | +|**order** | **Integer** | The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. | [optional] | + + + diff --git a/docs/UpdateReasonRequiredEnvironmentModel.md b/docs/UpdateReasonRequiredEnvironmentModel.md new file mode 100644 index 0000000..f28450d --- /dev/null +++ b/docs/UpdateReasonRequiredEnvironmentModel.md @@ -0,0 +1,14 @@ + + +# UpdateReasonRequiredEnvironmentModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**environmentId** | **UUID** | Identifier of the Environment. | [optional] | +|**reasonRequired** | **Boolean** | Indicates that a mandatory note is required in this Environment for saving and publishing. | [optional] | + + + diff --git a/docs/UpdateRolloutPercentageItemModel.md b/docs/UpdateRolloutPercentageItemModel.md new file mode 100644 index 0000000..a765c9f --- /dev/null +++ b/docs/UpdateRolloutPercentageItemModel.md @@ -0,0 +1,14 @@ + + +# UpdateRolloutPercentageItemModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**percentage** | **Long** | The percentage value for the rule. | | +|**value** | [**SettingValueType**](SettingValueType.md) | The value to serve when the user falls in the percentage rule. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. | | + + + diff --git a/docs/UpdateRolloutRuleModel.md b/docs/UpdateRolloutRuleModel.md new file mode 100644 index 0000000..177be9e --- /dev/null +++ b/docs/UpdateRolloutRuleModel.md @@ -0,0 +1,18 @@ + + +# UpdateRolloutRuleModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**comparisonAttribute** | **String** | The user attribute to compare. | [optional] | +|**comparator** | **RolloutRuleComparator** | | [optional] | +|**comparisonValue** | **String** | The value to compare against. | [optional] | +|**value** | [**SettingValueType**](SettingValueType.md) | The value to serve when the comparison matches. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. | | +|**segmentComparator** | **SegmentComparator** | | [optional] | +|**segmentId** | **UUID** | The segment to compare against. | [optional] | + + + diff --git a/docs/UpdateSegmentConditionModel.md b/docs/UpdateSegmentConditionModel.md new file mode 100644 index 0000000..5677d16 --- /dev/null +++ b/docs/UpdateSegmentConditionModel.md @@ -0,0 +1,15 @@ + + +# UpdateSegmentConditionModel + +Describes a condition that is based on a segment. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**segmentId** | **UUID** | The segment's identifier. | | +|**comparator** | **SegmentComparator** | | | + + + diff --git a/docs/UpdateSegmentModel.md b/docs/UpdateSegmentModel.md new file mode 100644 index 0000000..a5e0f9c --- /dev/null +++ b/docs/UpdateSegmentModel.md @@ -0,0 +1,17 @@ + + +# UpdateSegmentModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | [optional] | +|**description** | **String** | | [optional] | +|**comparisonAttribute** | **String** | | [optional] | +|**comparator** | **RolloutRuleComparator** | | [optional] | +|**comparisonValue** | **String** | | [optional] | + + + diff --git a/docs/UpdateSettingValueModel.md b/docs/UpdateSettingValueModel.md new file mode 100644 index 0000000..41416af --- /dev/null +++ b/docs/UpdateSettingValueModel.md @@ -0,0 +1,15 @@ + + +# UpdateSettingValueModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**rolloutRules** | [**List<UpdateRolloutRuleModel>**](UpdateRolloutRuleModel.md) | The targeting rule collection. | [optional] | +|**rolloutPercentageItems** | [**List<UpdateRolloutPercentageItemModel>**](UpdateRolloutPercentageItemModel.md) | The percentage rule collection. | [optional] | +|**value** | [**SettingValueType**](SettingValueType.md) | The value to serve. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. | | + + + diff --git a/docs/UpdateSettingValueWithSettingIdModel.md b/docs/UpdateSettingValueWithSettingIdModel.md new file mode 100644 index 0000000..56275db --- /dev/null +++ b/docs/UpdateSettingValueWithSettingIdModel.md @@ -0,0 +1,16 @@ + + +# UpdateSettingValueWithSettingIdModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**rolloutRules** | [**List<UpdateRolloutRuleModel>**](UpdateRolloutRuleModel.md) | The targeting rule collection. | [optional] | +|**rolloutPercentageItems** | [**List<UpdateRolloutPercentageItemModel>**](UpdateRolloutPercentageItemModel.md) | The percentage rule collection. | [optional] | +|**value** | [**SettingValueType**](SettingValueType.md) | The value to serve. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. | | +|**settingId** | **Integer** | The id of the Setting. | [optional] | + + + diff --git a/docs/UpdateSettingValuesWithIdModel.md b/docs/UpdateSettingValuesWithIdModel.md new file mode 100644 index 0000000..80eefbd --- /dev/null +++ b/docs/UpdateSettingValuesWithIdModel.md @@ -0,0 +1,13 @@ + + +# UpdateSettingValuesWithIdModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**settingValues** | [**List<UpdateSettingValueWithSettingIdModel>**](UpdateSettingValueWithSettingIdModel.md) | The values to update. | [optional] | + + + diff --git a/docs/UpdateTagModel.md b/docs/UpdateTagModel.md new file mode 100644 index 0000000..cdecff6 --- /dev/null +++ b/docs/UpdateTagModel.md @@ -0,0 +1,14 @@ + + +# UpdateTagModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Name of the Tag. | [optional] | +|**color** | **String** | Color of the Tag. Possible values: `panther`, `whale`, `salmon`, `lizard`, `canary`, `koala`, or any HTML color code. | [optional] | + + + diff --git a/docs/UpdateTargetingRuleModel.md b/docs/UpdateTargetingRuleModel.md new file mode 100644 index 0000000..1efb51a --- /dev/null +++ b/docs/UpdateTargetingRuleModel.md @@ -0,0 +1,15 @@ + + +# UpdateTargetingRuleModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**conditions** | [**List<UpdateConditionModel>**](UpdateConditionModel.md) | The list of conditions that are combined with logical AND operators. It can be one of the following: - User condition - Segment condition - Prerequisite flag condition | [optional] | +|**percentageOptions** | [**List<UpdatePercentageOptionModel>**](UpdatePercentageOptionModel.md) | The percentage options from where the evaluation process will choose a value based on the flag's percentage evaluation attribute. | [optional] | +|**value** | [**UpdateValueModel**](UpdateValueModel.md) | | [optional] | + + + diff --git a/docs/UpdateUserConditionModel.md b/docs/UpdateUserConditionModel.md new file mode 100644 index 0000000..72bb188 --- /dev/null +++ b/docs/UpdateUserConditionModel.md @@ -0,0 +1,16 @@ + + +# UpdateUserConditionModel + +Describes a condition that is based on user attributes. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**comparisonAttribute** | **String** | The User Object attribute that the condition is based on. Can be \"User ID\", \"Email\", \"Country\" or any custom attribute. | | +|**comparator** | **UserComparator** | | | +|**comparisonValue** | [**UpdateComparisonValueModel**](UpdateComparisonValueModel.md) | | | + + + diff --git a/docs/UpdateValueModel.md b/docs/UpdateValueModel.md new file mode 100644 index 0000000..074026c --- /dev/null +++ b/docs/UpdateValueModel.md @@ -0,0 +1,17 @@ + + +# UpdateValueModel + +Represents the value of a Feature Flag or Setting. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**boolValue** | **Boolean** | The served value in case of a boolean Feature Flag. | [optional] | +|**stringValue** | **String** | The served value in case of a text Setting. | [optional] | +|**intValue** | **Integer** | The served value in case of a whole number Setting. | [optional] | +|**doubleValue** | **Double** | The served value in case of a decimal number Setting. | [optional] | + + + diff --git a/docs/UserComparator.md b/docs/UserComparator.md new file mode 100644 index 0000000..05289e2 --- /dev/null +++ b/docs/UserComparator.md @@ -0,0 +1,81 @@ + + +# UserComparator + +## Enum + + +* `IS_ONE_OF` (value: `"isOneOf"`) + +* `IS_NOT_ONE_OF` (value: `"isNotOneOf"`) + +* `CONTAINS_ANY_OF` (value: `"containsAnyOf"`) + +* `DOES_NOT_CONTAIN_ANY_OF` (value: `"doesNotContainAnyOf"`) + +* `SEM_VER_IS_ONE_OF` (value: `"semVerIsOneOf"`) + +* `SEM_VER_IS_NOT_ONE_OF` (value: `"semVerIsNotOneOf"`) + +* `SEM_VER_LESS` (value: `"semVerLess"`) + +* `SEM_VER_LESS_OR_EQUALS` (value: `"semVerLessOrEquals"`) + +* `SEM_VER_GREATER` (value: `"semVerGreater"`) + +* `SEM_VER_GREATER_OR_EQUALS` (value: `"semVerGreaterOrEquals"`) + +* `NUMBER_EQUALS` (value: `"numberEquals"`) + +* `NUMBER_DOES_NOT_EQUAL` (value: `"numberDoesNotEqual"`) + +* `NUMBER_LESS` (value: `"numberLess"`) + +* `NUMBER_LESS_OR_EQUALS` (value: `"numberLessOrEquals"`) + +* `NUMBER_GREATER` (value: `"numberGreater"`) + +* `NUMBER_GREATER_OR_EQUALS` (value: `"numberGreaterOrEquals"`) + +* `SENSITIVE_IS_ONE_OF` (value: `"sensitiveIsOneOf"`) + +* `SENSITIVE_IS_NOT_ONE_OF` (value: `"sensitiveIsNotOneOf"`) + +* `DATE_TIME_BEFORE` (value: `"dateTimeBefore"`) + +* `DATE_TIME_AFTER` (value: `"dateTimeAfter"`) + +* `SENSITIVE_TEXT_EQUALS` (value: `"sensitiveTextEquals"`) + +* `SENSITIVE_TEXT_DOES_NOT_EQUAL` (value: `"sensitiveTextDoesNotEqual"`) + +* `SENSITIVE_TEXT_STARTS_WITH_ANY_OF` (value: `"sensitiveTextStartsWithAnyOf"`) + +* `SENSITIVE_TEXT_NOT_STARTS_WITH_ANY_OF` (value: `"sensitiveTextNotStartsWithAnyOf"`) + +* `SENSITIVE_TEXT_ENDS_WITH_ANY_OF` (value: `"sensitiveTextEndsWithAnyOf"`) + +* `SENSITIVE_TEXT_NOT_ENDS_WITH_ANY_OF` (value: `"sensitiveTextNotEndsWithAnyOf"`) + +* `SENSITIVE_ARRAY_CONTAINS_ANY_OF` (value: `"sensitiveArrayContainsAnyOf"`) + +* `SENSITIVE_ARRAY_DOES_NOT_CONTAIN_ANY_OF` (value: `"sensitiveArrayDoesNotContainAnyOf"`) + +* `TEXT_EQUALS` (value: `"textEquals"`) + +* `TEXT_DOES_NOT_EQUAL` (value: `"textDoesNotEqual"`) + +* `TEXT_STARTS_WITH_ANY_OF` (value: `"textStartsWithAnyOf"`) + +* `TEXT_NOT_STARTS_WITH_ANY_OF` (value: `"textNotStartsWithAnyOf"`) + +* `TEXT_ENDS_WITH_ANY_OF` (value: `"textEndsWithAnyOf"`) + +* `TEXT_NOT_ENDS_WITH_ANY_OF` (value: `"textNotEndsWithAnyOf"`) + +* `ARRAY_CONTAINS_ANY_OF` (value: `"arrayContainsAnyOf"`) + +* `ARRAY_DOES_NOT_CONTAIN_ANY_OF` (value: `"arrayDoesNotContainAnyOf"`) + + + diff --git a/docs/UserConditionModel.md b/docs/UserConditionModel.md new file mode 100644 index 0000000..4ae7a53 --- /dev/null +++ b/docs/UserConditionModel.md @@ -0,0 +1,16 @@ + + +# UserConditionModel + +Describes a condition that is based on user attributes. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**comparisonAttribute** | **String** | The User Object attribute that the condition is based on. Can be \"User ID\", \"Email\", \"Country\" or any custom attribute. | | +|**comparator** | **UserComparator** | | | +|**comparisonValue** | [**ComparisonValueModel**](ComparisonValueModel.md) | | | + + + diff --git a/docs/UserModel.md b/docs/UserModel.md new file mode 100644 index 0000000..baef0f4 --- /dev/null +++ b/docs/UserModel.md @@ -0,0 +1,16 @@ + + +# UserModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userId** | **String** | Identifier of the Member. | | +|**fullName** | **String** | Name of the Member. | | +|**email** | **String** | Email of the Member. | | +|**twoFactorEnabled** | **Boolean** | Determines whether 2FA is enabled for the Member. | | + + + diff --git a/docs/ValueModel.md b/docs/ValueModel.md new file mode 100644 index 0000000..61730f8 --- /dev/null +++ b/docs/ValueModel.md @@ -0,0 +1,17 @@ + + +# ValueModel + +Represents the value of a Feature Flag or Setting. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**boolValue** | **Boolean** | The served value in case of a boolean Feature Flag. | | +|**stringValue** | **String** | The served value in case of a text Setting. | | +|**intValue** | **Integer** | The served value in case of a whole number Setting. | | +|**doubleValue** | **Double** | The served value in case of a decimal number Setting. | | + + + diff --git a/docs/WebHookHttpMethod.md b/docs/WebHookHttpMethod.md new file mode 100644 index 0000000..07d3160 --- /dev/null +++ b/docs/WebHookHttpMethod.md @@ -0,0 +1,13 @@ + + +# WebHookHttpMethod + +## Enum + + +* `GET` (value: `"get"`) + +* `POST` (value: `"post"`) + + + diff --git a/docs/WebHookRequestModel.md b/docs/WebHookRequestModel.md new file mode 100644 index 0000000..b382789 --- /dev/null +++ b/docs/WebHookRequestModel.md @@ -0,0 +1,16 @@ + + +# WebHookRequestModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**url** | **String** | The URL of the Webhook. | | +|**content** | **String** | The HTTP body content. | [optional] | +|**httpMethod** | **WebHookHttpMethod** | | [optional] | +|**webHookHeaders** | [**List<WebhookHeaderModel>**](WebhookHeaderModel.md) | List of HTTP headers. | [optional] | + + + diff --git a/docs/WebhookConfig.md b/docs/WebhookConfig.md new file mode 100644 index 0000000..2199136 --- /dev/null +++ b/docs/WebhookConfig.md @@ -0,0 +1,15 @@ + + +# WebhookConfig + +The Config where the applied changes will invoke the Webhook. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The Config's name. | | +|**configId** | **UUID** | The Config's identifier. | | + + + diff --git a/docs/WebhookEnvironment.md b/docs/WebhookEnvironment.md new file mode 100644 index 0000000..3a40a29 --- /dev/null +++ b/docs/WebhookEnvironment.md @@ -0,0 +1,15 @@ + + +# WebhookEnvironment + +The Environment where the applied changes will invoke the Webhook. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The Environment's name. | | +|**environmentId** | **UUID** | The Environment's identifier. | | + + + diff --git a/docs/WebhookHeaderModel.md b/docs/WebhookHeaderModel.md new file mode 100644 index 0000000..a9ea39d --- /dev/null +++ b/docs/WebhookHeaderModel.md @@ -0,0 +1,15 @@ + + +# WebhookHeaderModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**key** | **String** | The HTTP header key. | | +|**value** | **String** | The HTTP header value. | | +|**isSecure** | **Boolean** | Indicates whether the header value is sensitive. | [optional] | + + + diff --git a/docs/WebhookHeaderResponseModel.md b/docs/WebhookHeaderResponseModel.md new file mode 100644 index 0000000..ce1771c --- /dev/null +++ b/docs/WebhookHeaderResponseModel.md @@ -0,0 +1,15 @@ + + +# WebhookHeaderResponseModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**key** | **String** | The HTTP header key. | | +|**value** | **String** | The HTTP header value. | | +|**isSecure** | **Boolean** | Indicates whether the header value is sensitive. | | + + + diff --git a/docs/WebhookResponseModel.md b/docs/WebhookResponseModel.md new file mode 100644 index 0000000..b2bde53 --- /dev/null +++ b/docs/WebhookResponseModel.md @@ -0,0 +1,19 @@ + + +# WebhookResponseModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**webhookId** | **Integer** | The identifier of the Webhook. | | +|**url** | **String** | The URL of the Webhook. | | +|**httpMethod** | **WebHookHttpMethod** | | | +|**content** | **String** | The HTTP body content. | | +|**webHookHeaders** | [**List<WebhookHeaderResponseModel>**](WebhookHeaderResponseModel.md) | List of HTTP headers that the Webhook must send. | | +|**config** | [**WebhookConfig**](WebhookConfig.md) | | | +|**environment** | [**WebhookEnvironment**](WebhookEnvironment.md) | | | + + + diff --git a/docs/WebhookSigningKeysModel.md b/docs/WebhookSigningKeysModel.md new file mode 100644 index 0000000..80b1273 --- /dev/null +++ b/docs/WebhookSigningKeysModel.md @@ -0,0 +1,14 @@ + + +# WebhookSigningKeysModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**key1** | **String** | The first signing key. | | +|**key2** | **String** | The second signing key. | | + + + diff --git a/docs/WebhooksApi.md b/docs/WebhooksApi.md new file mode 100644 index 0000000..1643e63 --- /dev/null +++ b/docs/WebhooksApi.md @@ -0,0 +1,517 @@ +# WebhooksApi + +All URIs are relative to *https://api.configcat.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createWebhook**](WebhooksApi.md#createWebhook) | **POST** /v1/configs/{configId}/environments/{environmentId}/webhooks | Create Webhook | +| [**deleteWebhook**](WebhooksApi.md#deleteWebhook) | **DELETE** /v1/webhooks/{webhookId} | Delete Webhook | +| [**getWebhook**](WebhooksApi.md#getWebhook) | **GET** /v1/webhooks/{webhookId} | Get Webhook | +| [**getWebhookSigningKeys**](WebhooksApi.md#getWebhookSigningKeys) | **GET** /v1/webhooks/{webhookId}/keys | Get Webhook Signing Keys | +| [**getWebhooks**](WebhooksApi.md#getWebhooks) | **GET** /v1/products/{productId}/webhooks | List Webhooks | +| [**replaceWebhook**](WebhooksApi.md#replaceWebhook) | **PUT** /v1/webhooks/{webhookId} | Replace Webhook | +| [**updateWebhook**](WebhooksApi.md#updateWebhook) | **PATCH** /v1/webhooks/{webhookId} | Update Webhook | + + + +# **createWebhook** +> WebhookResponseModel createWebhook(configId, environmentId, webHookRequestModel) + +Create Webhook + +This endpoint creates a new Webhook in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.WebhooksApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + WebhooksApi apiInstance = new WebhooksApi(defaultClient); + UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config. + UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment. + WebHookRequestModel webHookRequestModel = new WebHookRequestModel(); // WebHookRequestModel | + try { + WebhookResponseModel result = apiInstance.createWebhook(configId, environmentId, webHookRequestModel); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling WebhooksApi#createWebhook"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **configId** | **UUID**| The identifier of the Config. | | +| **environmentId** | **UUID**| The identifier of the Environment. | | +| **webHookRequestModel** | [**WebHookRequestModel**](WebHookRequestModel.md)| | | + +### Return type + +[**WebhookResponseModel**](WebhookResponseModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | When the creation was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **deleteWebhook** +> deleteWebhook(webhookId) + +Delete Webhook + +This endpoint removes a Webhook identified by the `webhookId` parameter. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.WebhooksApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + WebhooksApi apiInstance = new WebhooksApi(defaultClient); + Integer webhookId = 56; // Integer | The identifier of the Webhook. + try { + apiInstance.deleteWebhook(webhookId); + } catch (ApiException e) { + System.err.println("Exception when calling WebhooksApi#deleteWebhook"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **webhookId** | **Integer**| The identifier of the Webhook. | | + +### Return type + +null (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | When the delete was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getWebhook** +> WebhookResponseModel getWebhook(webhookId) + +Get Webhook + +This endpoint returns the metadata of a Webhook identified by the `webhookId`. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.WebhooksApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + WebhooksApi apiInstance = new WebhooksApi(defaultClient); + Integer webhookId = 56; // Integer | The identifier of the Webhook. + try { + WebhookResponseModel result = apiInstance.getWebhook(webhookId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling WebhooksApi#getWebhook"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **webhookId** | **Integer**| The identifier of the Webhook. | | + +### Return type + +[**WebhookResponseModel**](WebhookResponseModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When everything is ok, the webhook data is returned. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getWebhookSigningKeys** +> WebhookSigningKeysModel getWebhookSigningKeys(webhookId) + +Get Webhook Signing Keys + +This endpoint returns the signing keys of a Webhook identified by the `webhookId`. Signing keys are used for ensuring the Webhook requests you receive are actually sent by ConfigCat. <a href=\"https://configcat.com/docs/advanced/notifications-webhooks/#verifying-webhook-requests\" target=\"_blank\" rel=\"noopener noreferrer\">Here</a> you can read more about Webhook request verification. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.WebhooksApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + WebhooksApi apiInstance = new WebhooksApi(defaultClient); + Integer webhookId = 56; // Integer | The identifier of the Webhook. + try { + WebhookSigningKeysModel result = apiInstance.getWebhookSigningKeys(webhookId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling WebhooksApi#getWebhookSigningKeys"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **webhookId** | **Integer**| The identifier of the Webhook. | | + +### Return type + +[**WebhookSigningKeysModel**](WebhookSigningKeysModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When everything is ok, the webhook signing keys are returned. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **getWebhooks** +> List<WebhookResponseModel> getWebhooks(productId) + +List Webhooks + +This endpoint returns the list of the Webhooks that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.WebhooksApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + WebhooksApi apiInstance = new WebhooksApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + try { + List result = apiInstance.getWebhooks(productId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling WebhooksApi#getWebhooks"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | + +### Return type + +[**List<WebhookResponseModel>**](WebhookResponseModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **replaceWebhook** +> WebhookResponseModel replaceWebhook(webhookId, webHookRequestModel) + +Replace Webhook + +This endpoint replaces the whole value of a Webhook identified by the `webhookId` parameter. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.WebhooksApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + WebhooksApi apiInstance = new WebhooksApi(defaultClient); + Integer webhookId = 56; // Integer | The identifier of the Webhook. + WebHookRequestModel webHookRequestModel = new WebHookRequestModel(); // WebHookRequestModel | + try { + WebhookResponseModel result = apiInstance.replaceWebhook(webhookId, webHookRequestModel); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling WebhooksApi#replaceWebhook"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **webhookId** | **Integer**| The identifier of the Webhook. | | +| **webHookRequestModel** | [**WebHookRequestModel**](WebHookRequestModel.md)| | | + +### Return type + +[**WebhookResponseModel**](WebhookResponseModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When the replace was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + + +# **updateWebhook** +> WebhookResponseModel updateWebhook(webhookId, jsonPatchOperation) + +Update Webhook + +This endpoint updates a Webhook identified by the `webhookId` parameter with a collection of [JSON Patch](https://jsonpatch.com) operations. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. For example: We have the following resource. ```json { \"webhookId\": 6, \"url\": \"https://example.com/hook\", \"httpMethod\": \"post\", \"content\": \"null\", \"webHookHeaders\": [] } ``` If we send an update request body as below (it changes the `content` field and adds a new HTTP header): ```json [ { \"op\": \"replace\", \"path\": \"/content\", \"value\": \"Some webhook content.\" }, { \"op\": \"add\", \"path\": \"/webHookHeaders/-\", \"value\": { \"key\": \"X-Custom-Header\", \"value\": \"Custom header value\" } } ] ``` Only the `content` and `webHookHeaders` are updated and all the other attributes remain unchanged. So we get a response like this: ```json { \"webhookId\": 6, \"url\": \"https://example.com/hook\", \"httpMethod\": \"post\", \"content\": \"Some webhook content.\", \"webHookHeaders\": [ { \"key\": \"X-Custom-Header\", \"value\": \"Custom header value\", \"isSecure\": false } ] } ``` + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.WebhooksApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + WebhooksApi apiInstance = new WebhooksApi(defaultClient); + Integer webhookId = 56; // Integer | The identifier of the Webhook. + List jsonPatchOperation = Arrays.asList(); // List | + try { + WebhookResponseModel result = apiInstance.updateWebhook(webhookId, jsonPatchOperation); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling WebhooksApi#updateWebhook"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **webhookId** | **Integer**| The identifier of the Webhook. | | +| **jsonPatchOperation** | [**List<JsonPatchOperation>**](JsonPatchOperation.md)| | | + +### Return type + +[**WebhookResponseModel**](WebhookResponseModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | When the update was successful. | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + diff --git a/docs/ZombieStaleFlagsApi.md b/docs/ZombieStaleFlagsApi.md new file mode 100644 index 0000000..0d194cc --- /dev/null +++ b/docs/ZombieStaleFlagsApi.md @@ -0,0 +1,90 @@ +# ZombieStaleFlagsApi + +All URIs are relative to *https://api.configcat.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getStaleflags**](ZombieStaleFlagsApi.md#getStaleflags) | **GET** /v1/products/{productId}/staleflags | List Zombie (stale) flags for Product | + + + +# **getStaleflags** +> StaleFlagProductModel getStaleflags(productId, scope, staleFlagAgeDays, staleFlagStaleInEnvironmentsType, ignoredEnvironmentIds, ignoredTagIds) + +List Zombie (stale) flags for Product + +This endpoint returns the list of Zombie (stale) flags for a given Product and the result can be optionally filtered by various parameters. + +### Example +```java +// Import classes: +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.auth.*; +import com.configcat.publicapi.java.client.models.*; +import com.configcat.publicapi.java.client.api.ZombieStaleFlagsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.configcat.com"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + ZombieStaleFlagsApi apiInstance = new ZombieStaleFlagsApi(defaultClient); + UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product. + StaleFlagReminderScope scope = StaleFlagReminderScope.fromValue("all"); // StaleFlagReminderScope | The scope of the report. + Integer staleFlagAgeDays = 56; // Integer | The inactivity in days after a feature flag should be considered stale. + StaleFlagStaleInEnvironmentsType staleFlagStaleInEnvironmentsType = StaleFlagStaleInEnvironmentsType.fromValue("staleInAnyEnvironments"); // StaleFlagStaleInEnvironmentsType | Consider a feature flag as stale if the feature flag is stale in all/any of the environments. + List ignoredEnvironmentIds = Arrays.asList(); // List | Ignore environment identifiers from the report. + List ignoredTagIds = Arrays.asList(); // List | Ignore feature flags from the report based on their tag identifiers. + try { + StaleFlagProductModel result = apiInstance.getStaleflags(productId, scope, staleFlagAgeDays, staleFlagStaleInEnvironmentsType, ignoredEnvironmentIds, ignoredTagIds); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ZombieStaleFlagsApi#getStaleflags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **UUID**| The identifier of the Product. | | +| **scope** | [**StaleFlagReminderScope**](.md)| The scope of the report. | [optional] [enum: all, watchedByMe] | +| **staleFlagAgeDays** | **Integer**| The inactivity in days after a feature flag should be considered stale. | [optional] | +| **staleFlagStaleInEnvironmentsType** | [**StaleFlagStaleInEnvironmentsType**](.md)| Consider a feature flag as stale if the feature flag is stale in all/any of the environments. | [optional] [enum: staleInAnyEnvironments, staleInAllEnvironments] | +| **ignoredEnvironmentIds** | [**List<UUID>**](UUID.md)| Ignore environment identifiers from the report. | [optional] | +| **ignoredTagIds** | [**List<Long>**](Long.md)| Ignore feature flags from the report based on their tag identifiers. | [optional] | + +### Return type + +[**StaleFlagProductModel**](StaleFlagProductModel.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad request. | - | +| **404** | Not found. | - | +| **429** | Too many requests. In case of the request rate exceeds the rate limits. | - | + diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml new file mode 100644 index 0000000..f38cedc --- /dev/null +++ b/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/src/main/java/com/configcat/publicapi/java/client/ApiCallback.java b/src/main/java/com/configcat/publicapi/java/client/ApiCallback.java new file mode 100644 index 0000000..244fd5b --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/src/main/java/com/configcat/publicapi/java/client/ApiClient.java b/src/main/java/com/configcat/publicapi/java/client/ApiClient.java new file mode 100644 index 0000000..d5fee4b --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/ApiClient.java @@ -0,0 +1,1566 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import com.configcat.publicapi.java.client.auth.Authentication; +import com.configcat.publicapi.java.client.auth.HttpBasicAuth; +import com.configcat.publicapi.java.client.auth.HttpBearerAuth; +import com.configcat.publicapi.java.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

+ */ +public class ApiClient { + + private String basePath = "https://api.configcat.com"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "https://api.configcat.com", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("Basic", new HttpBasicAuth()); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Basic constructor with custom OkHttpClient + * + * @param client a {@link okhttp3.OkHttpClient} object + */ + public ApiClient(OkHttpClient client) { + init(); + + httpClient = client; + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("Basic", new HttpBasicAuth()); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/v1/java"); + + authentications = new HashMap(); + } + + /** + * Get base path + * + * @return Base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set base path + * + * @param basePath Base path of the URL (e.g https://api.configcat.com + * @return An instance of OkHttpClient + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + this.serverIndex = null; + return this; + } + + public List getServers() { + return servers; + } + + public ApiClient setServers(List servers) { + this.servers = servers; + return this; + } + + public Integer getServerIndex() { + return serverIndex; + } + + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + return this; + } + + public Map getServerVariables() { + return serverVariables; + } + + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; + return this; + } + + /** + * Get HTTP client + * + * @return An instance of OkHttpClient + */ + public OkHttpClient getHttpClient() { + return httpClient; + } + + /** + * Set HTTP client, which must never be null. + * + * @param newHttpClient An instance of OkHttpClient + * @return Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

Getter for the field keyManagers.

+ * + * @return an array of {@link javax.net.ssl.KeyManager} objects + */ + public KeyManager[] getKeyManagers() { + return keyManagers; + } + + /** + * Configure client keys to use for authorization in an SSL session. + * Use null to reset to default. + * + * @param managers The KeyManagers to use + * @return ApiClient + */ + public ApiClient setKeyManagers(KeyManager[] managers) { + this.keyManagers = managers; + applySslSettings(); + return this; + } + + /** + *

Getter for the field dateFormat.

+ * + * @return a {@link java.text.DateFormat} object + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + *

Setter for the field dateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link com.configcat.publicapi.java.client.ApiClient} object + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + JSON.setDateFormat(dateFormat); + return this; + } + + /** + *

Set SqlDateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link com.configcat.publicapi.java.client.ApiClient} object + */ + public ApiClient setSqlDateFormat(DateFormat dateFormat) { + JSON.setSqlDateFormat(dateFormat); + return this; + } + + /** + *

Set OffsetDateTimeFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link com.configcat.publicapi.java.client.ApiClient} object + */ + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + JSON.setOffsetDateTimeFormat(dateFormat); + return this; + } + + /** + *

Set LocalDateFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link com.configcat.publicapi.java.client.ApiClient} object + */ + public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { + JSON.setLocalDateFormat(dateFormat); + return this; + } + + /** + *

Set LenientOnJson.

+ * + * @param lenientOnJson a boolean + * @return a {@link com.configcat.publicapi.java.client.ApiClient} object + */ + public ApiClient setLenientOnJson(boolean lenientOnJson) { + JSON.setLenientOnJson(lenientOnJson); + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication objects + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username Username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set access token for the first OAuth2 authentication. + * + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) { + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param sessionToken Session Token + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent HTTP request's user agent + * @return ApiClient + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return ApiClient + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return ApiClient + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is enabled, false otherwise. + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return ApiClient + */ + public ApiClient setDebugging(boolean debugging) { + if (debugging != this.debugging) { + if (debugging) { + loggingInterceptor = new HttpLoggingInterceptor(); + loggingInterceptor.setLevel(Level.BODY); + httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); + } else { + final OkHttpClient.Builder builder = httpClient.newBuilder(); + builder.interceptors().remove(loggingInterceptor); + httpClient = builder.build(); + loggingInterceptor = null; + } + } + this.debugging = debugging; + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default temporary folder. + * + * @see createTempFile + * @return Temporary folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set the temporary folder path (for downloading files) + * + * @param tempFolderPath Temporary folder path + * @return ApiClient + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getConnectTimeout() { + return httpClient.connectTimeoutMillis(); + } + + /** + * Sets the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param connectionTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get read timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getReadTimeout() { + return httpClient.readTimeoutMillis(); + } + + /** + * Sets the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param readTimeout read timeout in milliseconds + * @return Api client + */ + public ApiClient setReadTimeout(int readTimeout) { + httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get write timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getWriteTimeout() { + return httpClient.writeTimeoutMillis(); + } + + /** + * Sets the write timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param writeTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setWriteTimeout(int writeTimeout) { + httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + + /** + * Format the given parameter object into string. + * + * @param param Parameter + * @return String representation of the parameter + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { + //Serialize to json string and remove the " enclosing characters + String jsonStr = JSON.serialize(param); + return jsonStr.substring(1, jsonStr.length() - 1); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection) param) { + if (b.length() > 0) { + b.append(","); + } + b.append(o); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Formats the specified query parameter to a list containing a single {@code Pair} object. + * + * Note that {@code value} must not be a collection. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list containing a single {@code Pair} object. + */ + public List parameterToPair(String name, Object value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value instanceof Collection) { + return params; + } + + params.add(new Pair(name, parameterToString(value))); + return params; + } + + /** + * Formats the specified collection query parameters to a list of {@code Pair} objects. + * + * Note that the values of each of the returned Pair objects are percent-encoded. + * + * @param collectionFormat The collection format of the parameter. + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list of {@code Pair} objects. + */ + public List parameterToPairs(String collectionFormat, String name, Collection value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { + return params; + } + + // create the params based on the collection format + if ("multi".equals(collectionFormat)) { + for (Object item : value) { + params.add(new Pair(name, escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if ("ssv".equals(collectionFormat)) { + delimiter = escapeString(" "); + } else if ("tsv".equals(collectionFormat)) { + delimiter = escapeString("\t"); + } else if ("pipes".equals(collectionFormat)) { + delimiter = escapeString("|"); + } + + StringBuilder sb = new StringBuilder(); + for (Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); + } + + params.add(new Pair(name, sb.substring(delimiter.length()))); + + return params; + } + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param Type + * @param response HTTP response + * @param returnType The type of the Java object + * @return The deserialized Java object + * @throws com.configcat.publicapi.java.client.ApiException If fail to deserialize response body, i.e. cannot read response body + * or the Content-Type of the response is not supported. + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, Type returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + try { + return (T) response.body().bytes(); + } catch (IOException e) { + throw new ApiException(e); + } + } else if (returnType.equals(File.class)) { + // Handle file downloading. + return (T) downloadFileFromResponse(response); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws com.configcat.publicapi.java.client.ApiException If fail to serialize the given object + */ + public RequestBody serialize(Object obj, String contentType) throws ApiException { + if (obj instanceof byte[]) { + // Binary (byte array) body parameter support. + return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); + } else if (obj instanceof File) { + // File body parameter support. + return RequestBody.create((File) obj, MediaType.parse(contentType)); + } else if ("text/plain".equals(contentType) && obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else if (isJsonMime(contentType)) { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + return RequestBody.create(content, MediaType.parse(contentType)); + } else if (obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else { + throw new ApiException("Content type \"" + contentType + "\" is not supported"); + } + } + + /** + * Download file from the given response. + * + * @param response An instance of the Response object + * @throws com.configcat.publicapi.java.client.ApiException If fail to read file content from response and write to disk + * @return Downloaded file + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + BufferedSink sink = Okio.buffer(Okio.sink(file)); + sink.writeAll(response.body().source()); + sink.close(); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Prepare file for download + * + * @param response An instance of the Response object + * @return Prepared file for the download + * @throws java.io.IOException If fail to prepare file for download + */ + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = response.header("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) { + filename = sanitizeFilename(matcher.group(1)); + } + } + + String prefix = null; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf("."); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // Files.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return Files.createTempFile(prefix, suffix).toFile(); + else + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } + + /** + * {@link #execute(Call, Type)} + * + * @param Type + * @param call An instance of the Call object + * @return ApiResponse<T> + * @throws com.configcat.publicapi.java.client.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call) throws ApiException { + return execute(call, null); + } + + /** + * Execute HTTP call and deserialize the HTTP response body into the given return type. + * + * @param returnType The return type used to deserialize HTTP response body + * @param The return type corresponding to (same with) returnType + * @param call Call + * @return ApiResponse object containing response status, headers and + * data, which is a Java object deserialized from response body and would be null + * when returnType is null. + * @throws com.configcat.publicapi.java.client.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call, Type returnType) throws ApiException { + try { + Response response = call.execute(); + T data = handleResponse(response, returnType); + return new ApiResponse(response.code(), response.headers().toMultimap(), data); + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * {@link #executeAsync(Call, Type, ApiCallback)} + * + * @param Type + * @param call An instance of the Call object + * @param callback ApiCallback<T> + */ + public void executeAsync(Call call, ApiCallback callback) { + executeAsync(call, null, callback); + } + + /** + * Execute HTTP call asynchronously. + * + * @param Type + * @param call The callback to be executed when the API call finishes + * @param returnType Return type + * @param callback ApiCallback + * @see #execute(Call, Type) + */ + @SuppressWarnings("unchecked") + public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, IOException e) { + callback.onFailure(new ApiException(e), 0, null); + } + + @Override + public void onResponse(Call call, Response response) throws IOException { + T result; + try { + result = (T) handleResponse(response, returnType); + } catch (ApiException e) { + callback.onFailure(e, response.code(), response.headers().toMultimap()); + return; + } catch (Exception e) { + callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); + return; + } + callback.onSuccess(result, response.code(), response.headers().toMultimap()); + } + }); + } + + /** + * Handle the given response, return the deserialized object when the response is successful. + * + * @param Type + * @param response Response + * @param returnType Return type + * @return Type + * @throws com.configcat.publicapi.java.client.ApiException If the response has an unsuccessful status code or + * fail to deserialize the response body + */ + public T handleResponse(Response response, Type returnType) throws ApiException { + if (response.isSuccessful()) { + if (returnType == null || response.code() == 204) { + // returning null if the returnType is not defined, + // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (Exception e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + return null; + } else { + return deserialize(response, returnType); + } + } else { + String respBody = null; + if (response.body() != null) { + try { + respBody = response.body().string(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); + } + } + + /** + * Build HTTP call with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP call + * @throws com.configcat.publicapi.java.client.ApiException If fail to serialize the request body object + */ + public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP request + * @throws com.configcat.publicapi.java.client.ApiException If fail to serialize the request body object + */ + public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + String contentTypePure = contentType; + if (contentTypePure != null && contentTypePure.contains(";")) { + contentTypePure = contentType.substring(0, contentType.indexOf(";")); + } + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentTypePure)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentTypePure)) { + reqBody = buildRequestBodyMultipart(formParams); + } else if (body == null) { + if ("DELETE".equals(method)) { + // allow calling DELETE without sending a request body + reqBody = null; + } else { + // use an empty request body (for POST, PUT and PATCH) + reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType)); + } + } else { + reqBody = serialize(body, contentType); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); + + // Associate callback with request (if not null) so interceptor can + // access it when creating ProgressResponseBody + reqBuilder.tag(callback); + + Request request = null; + + if (callback != null && reqBody != null) { + ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); + request = reqBuilder.method(method, progressRequestBody).build(); + } else { + request = reqBuilder.method(method, reqBody).build(); + } + + return request; + } + + /** + * Build full URL by concatenating base path, the given sub path and query parameters. + * + * @param baseUrl The base URL + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @return The full URL + */ + public String buildUrl(String baseUrl, String path, List queryParams, List collectionQueryParams) { + final StringBuilder url = new StringBuilder(); + if (baseUrl != null) { + url.append(baseUrl).append(path); + } else { + String baseURL; + if (serverIndex != null) { + if (serverIndex < 0 || serverIndex >= servers.size()) { + throw new ArrayIndexOutOfBoundsException(String.format( + "Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size() + )); + } + baseURL = servers.get(serverIndex).URL(serverVariables); + } else { + baseURL = basePath; + } + url.append(baseURL).append(path); + } + + if (queryParams != null && !queryParams.isEmpty()) { + // support (constant) query string in `path`, e.g. "/posts?draft=1" + String prefix = path.contains("?") ? "&" : "?"; + for (Pair param : queryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + } + } + } + + if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { + String prefix = url.toString().contains("?") ? "&" : "?"; + for (Pair param : collectionQueryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // collection query parameter value already escaped as part of parameterToPairs + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + return url.toString(); + } + + /** + * Set header parameters to the request builder, including default headers. + * + * @param headerParams Header parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { + for (Entry param : headerParams.entrySet()) { + reqBuilder.header(param.getKey(), parameterToString(param.getValue())); + } + for (Entry header : defaultHeaderMap.entrySet()) { + if (!headerParams.containsKey(header.getKey())) { + reqBuilder.header(header.getKey(), parameterToString(header.getValue())); + } + } + } + + /** + * Set cookie parameters to the request builder, including default cookies. + * + * @param cookieParams Cookie parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { + for (Entry param : cookieParams.entrySet()) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws com.configcat.publicapi.java.client.ApiException If fails to update the parameters + */ + public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, + Map cookieParams, String payload, String method, URI uri) throws ApiException { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RuntimeException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); + } + } + + /** + * Build a form-encoding request body with the given form parameters. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyFormEncoding(Map formParams) { + okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); + for (Entry param : formParams.entrySet()) { + formBuilder.add(param.getKey(), parameterToString(param.getValue())); + } + return formBuilder.build(); + } + + /** + * Build a multipart (file uploading) request body with the given form parameters, + * which could contain text fields and file fields. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyMultipart(Map formParams) { + MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + for (Entry param : formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + List list = (List) param.getValue(); + for (Object item: list) { + if (item instanceof File) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + return mpBuilder.build(); + } + + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + public String guessContentTypeFromFile(File file) { + String contentType = URLConnection.guessContentTypeFromName(file.getName()); + if (contentType == null) { + return "application/octet-stream"; + } else { + return contentType; + } + } + + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws com.configcat.publicapi.java.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/ApiException.java b/src/main/java/com/configcat/publicapi/java/client/ApiException.java new file mode 100644 index 0000000..36ddb79 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/ApiException.java @@ -0,0 +1,167 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client; + +import java.util.Map; +import java.util.List; + + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ApiException extends RuntimeException { + private static final long serialVersionUID = 1L; + + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

+ */ + public ApiException() {} + + /** + *

Constructor for ApiException.

+ * + * @param throwable a {@link java.lang.Throwable} object + */ + public ApiException(Throwable throwable) { + super(throwable); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + */ + public ApiException(String message) { + super(message); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, Map> responseHeaders, String responseBody) { + this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message a {@link java.lang.String} object + */ + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/ApiResponse.java b/src/main/java/com/configcat/publicapi/java/client/ApiResponse.java new file mode 100644 index 0000000..47d753e --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

+ * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + *

Constructor for ApiResponse.

+ * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + /** + *

Get the status code.

+ * + * @return the status code + */ + public int getStatusCode() { + return statusCode; + } + + /** + *

Get the headers.

+ * + * @return a {@link java.util.Map} of headers + */ + public Map> getHeaders() { + return headers; + } + + /** + *

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/Configuration.java b/src/main/java/com/configcat/publicapi/java/client/Configuration.java new file mode 100644 index 0000000..7c60a8c --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class Configuration { + public static final String VERSION = "v1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/GzipRequestInterceptor.java b/src/main/java/com/configcat/publicapi/java/client/GzipRequestInterceptor.java new file mode 100644 index 0000000..1d17be4 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/JSON.java b/src/main/java/com/configcat/publicapi/java/client/JSON.java new file mode 100644 index 0000000..305ac6f --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/JSON.java @@ -0,0 +1,517 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + static { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.AddOrUpdateIntegrationLinkModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.AddOrUpdateJiraIntegrationLinkModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.AuditLogItemModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.CodeReferenceModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.CodeReferenceRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ComparisonValueListModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ComparisonValueModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ConditionModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ConfigModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ConfigSettingFormulaModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ConfigSettingFormulasModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ConfigSettingValueModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ConfigSettingValuesModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ConnectRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.CreateConfigRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.CreateEnvironmentModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.CreateIntegrationModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.CreateOrUpdateEnvironmentAccessModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.CreatePermissionGroupRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.CreateProductRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.CreateSegmentModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.CreateSettingInitialValues.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.CreateTagModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.DeleteIntegrationLinkModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.DeleteRepositoryReportsRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.DeletedSettingModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.EnvironmentAccessModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.EnvironmentModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.FeatureFlagLimitations.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.FlagReference.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.InitialValue.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.IntegrationLinkDetail.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.IntegrationLinkDetailsModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.IntegrationLinkModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.IntegrationModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.IntegrationsModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.InvitationModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.InviteMembersRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.JsonPatchOperation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.MeModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.MemberModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ModifyIntegrationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.OrganizationAdminModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.OrganizationInvitationModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.OrganizationMemberModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.OrganizationMembersModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.OrganizationModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.OrganizationPermissionGroupModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.OrganizationPermissionModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.OrganizationProductModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.PercentageOptionModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.PermissionGroupModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.PreferencesModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.PrerequisiteFlagConditionModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ProductModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ReasonRequiredEnvironmentModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ReferenceLineModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ReferenceLineRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ReferenceLinesModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ReferenceLinesRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ReplaceSettingModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.RolloutPercentageItemModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.RolloutRuleModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.SdkKeysModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.SegmentConditionModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.SegmentListModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.SegmentModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.SettingDataModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.SettingFormulaModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.SettingModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.SettingTagModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.SettingValueModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.SettingValueType.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.StaleFlagConfigModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.StaleFlagEnvironmentModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.StaleFlagProductModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.StaleFlagSettingModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.StaleFlagSettingTagModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.StaleFlagSettingValueModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.TagModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.TargetingRuleModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateComparisonValueListModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateComparisonValueModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateConditionModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateConfigRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateEnvironmentModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateEvaluationFormulaModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateEvaluationFormulaWithIdModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateEvaluationFormulasModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateMemberPermissionsRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdatePercentageOptionModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdatePermissionGroupRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdatePreferencesRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdatePrerequisiteFlagConditionModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateProductRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateReasonRequiredEnvironmentModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateRolloutPercentageItemModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateRolloutRuleModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateSegmentConditionModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateSegmentModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateSettingValueModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateSettingValueWithSettingIdModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateSettingValuesWithIdModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateTagModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateTargetingRuleModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateUserConditionModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UpdateValueModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UserConditionModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.UserModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.ValueModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.WebHookRequestModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.WebhookConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.WebhookEnvironment.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.WebhookHeaderModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.WebhookHeaderResponseModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.WebhookResponseModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.configcat.publicapi.java.client.model.WebhookSigningKeysModel.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/Pair.java b/src/main/java/com/configcat/publicapi/java/client/Pair.java new file mode 100644 index 0000000..e46360b --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/Pair.java @@ -0,0 +1,57 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/ProgressRequestBody.java b/src/main/java/com/configcat/publicapi/java/client/ProgressRequestBody.java new file mode 100644 index 0000000..fa0316d --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/ProgressResponseBody.java b/src/main/java/com/configcat/publicapi/java/client/ProgressResponseBody.java new file mode 100644 index 0000000..6fb85b3 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/ServerConfiguration.java b/src/main/java/com/configcat/publicapi/java/client/ServerConfiguration.java new file mode 100644 index 0000000..75073ca --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/ServerConfiguration.java @@ -0,0 +1,59 @@ +package com.configcat.publicapi.java.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/ServerVariable.java b/src/main/java/com/configcat/publicapi/java/client/ServerVariable.java new file mode 100644 index 0000000..ea17331 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/ServerVariable.java @@ -0,0 +1,24 @@ +package com.configcat.publicapi.java.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/StringUtil.java b/src/main/java/com/configcat/publicapi/java/client/StringUtil.java new file mode 100644 index 0000000..bee1164 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/AuditLogsApi.java b/src/main/java/com/configcat/publicapi/java/client/api/AuditLogsApi.java new file mode 100644 index 0000000..e6a8aec --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/api/AuditLogsApi.java @@ -0,0 +1,572 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.api; + +import com.configcat.publicapi.java.client.ApiCallback; +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.ApiResponse; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ProgressRequestBody; +import com.configcat.publicapi.java.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.configcat.publicapi.java.client.model.AuditLogItemModel; +import com.configcat.publicapi.java.client.model.AuditLogType; +import com.configcat.publicapi.java.client.model.DeletedSettingModel; +import java.time.OffsetDateTime; +import java.util.UUID; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AuditLogsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public AuditLogsApi() { + this(Configuration.getDefaultApiClient()); + } + + public AuditLogsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getAuditlogs + * @param productId The identifier of the Product. (required) + * @param configId The identifier of the Config. (optional) + * @param environmentId The identifier of the Environment. (optional) + * @param auditLogType Filter Audit logs by Audit log type. (optional) + * @param fromUtcDateTime Filter Audit logs by starting UTC date. (optional) + * @param toUtcDateTime Filter Audit logs by ending UTC date. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getAuditlogsCall(UUID productId, UUID configId, UUID environmentId, AuditLogType auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/products/{productId}/auditlogs" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (configId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("configId", configId)); + } + + if (environmentId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("environmentId", environmentId)); + } + + if (auditLogType != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("auditLogType", auditLogType)); + } + + if (fromUtcDateTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fromUtcDateTime", fromUtcDateTime)); + } + + if (toUtcDateTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("toUtcDateTime", toUtcDateTime)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAuditlogsValidateBeforeCall(UUID productId, UUID configId, UUID environmentId, AuditLogType auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling getAuditlogs(Async)"); + } + + return getAuditlogsCall(productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime, _callback); + + } + + /** + * List Audit log items for Product + * This endpoint returns the list of Audit log items for a given Product and the result can be optionally filtered by Config and/or Environment. If neither `fromUtcDateTime` nor `toUtcDateTime` is set, the audit logs for the **last 7 days** will be returned. The distance between `fromUtcDateTime` and `toUtcDateTime` cannot exceed **30 days**. + * @param productId The identifier of the Product. (required) + * @param configId The identifier of the Config. (optional) + * @param environmentId The identifier of the Environment. (optional) + * @param auditLogType Filter Audit logs by Audit log type. (optional) + * @param fromUtcDateTime Filter Audit logs by starting UTC date. (optional) + * @param toUtcDateTime Filter Audit logs by ending UTC date. (optional) + * @return List<AuditLogItemModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public List getAuditlogs(UUID productId, UUID configId, UUID environmentId, AuditLogType auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime) throws ApiException { + ApiResponse> localVarResp = getAuditlogsWithHttpInfo(productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime); + return localVarResp.getData(); + } + + /** + * List Audit log items for Product + * This endpoint returns the list of Audit log items for a given Product and the result can be optionally filtered by Config and/or Environment. If neither `fromUtcDateTime` nor `toUtcDateTime` is set, the audit logs for the **last 7 days** will be returned. The distance between `fromUtcDateTime` and `toUtcDateTime` cannot exceed **30 days**. + * @param productId The identifier of the Product. (required) + * @param configId The identifier of the Config. (optional) + * @param environmentId The identifier of the Environment. (optional) + * @param auditLogType Filter Audit logs by Audit log type. (optional) + * @param fromUtcDateTime Filter Audit logs by starting UTC date. (optional) + * @param toUtcDateTime Filter Audit logs by ending UTC date. (optional) + * @return ApiResponse<List<AuditLogItemModel>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse> getAuditlogsWithHttpInfo(UUID productId, UUID configId, UUID environmentId, AuditLogType auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime) throws ApiException { + okhttp3.Call localVarCall = getAuditlogsValidateBeforeCall(productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Audit log items for Product (asynchronously) + * This endpoint returns the list of Audit log items for a given Product and the result can be optionally filtered by Config and/or Environment. If neither `fromUtcDateTime` nor `toUtcDateTime` is set, the audit logs for the **last 7 days** will be returned. The distance between `fromUtcDateTime` and `toUtcDateTime` cannot exceed **30 days**. + * @param productId The identifier of the Product. (required) + * @param configId The identifier of the Config. (optional) + * @param environmentId The identifier of the Environment. (optional) + * @param auditLogType Filter Audit logs by Audit log type. (optional) + * @param fromUtcDateTime Filter Audit logs by starting UTC date. (optional) + * @param toUtcDateTime Filter Audit logs by ending UTC date. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getAuditlogsAsync(UUID productId, UUID configId, UUID environmentId, AuditLogType auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAuditlogsValidateBeforeCall(productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getDeletedSettings + * @param configId The identifier of the Config. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getDeletedSettingsCall(UUID configId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/configs/{configId}/deleted-settings" + .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getDeletedSettingsValidateBeforeCall(UUID configId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'configId' is set + if (configId == null) { + throw new ApiException("Missing the required parameter 'configId' when calling getDeletedSettings(Async)"); + } + + return getDeletedSettingsCall(configId, _callback); + + } + + /** + * List Deleted Settings + * This endpoint returns the list of Feature Flags and Settings that were deleted from the given Config. + * @param configId The identifier of the Config. (required) + * @return List<DeletedSettingModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public List getDeletedSettings(UUID configId) throws ApiException { + ApiResponse> localVarResp = getDeletedSettingsWithHttpInfo(configId); + return localVarResp.getData(); + } + + /** + * List Deleted Settings + * This endpoint returns the list of Feature Flags and Settings that were deleted from the given Config. + * @param configId The identifier of the Config. (required) + * @return ApiResponse<List<DeletedSettingModel>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse> getDeletedSettingsWithHttpInfo(UUID configId) throws ApiException { + okhttp3.Call localVarCall = getDeletedSettingsValidateBeforeCall(configId, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Deleted Settings (asynchronously) + * This endpoint returns the list of Feature Flags and Settings that were deleted from the given Config. + * @param configId The identifier of the Config. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getDeletedSettingsAsync(UUID configId, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getDeletedSettingsValidateBeforeCall(configId, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOrganizationAuditlogs + * @param organizationId The identifier of the Organization. (required) + * @param productId The identifier of the Product. (optional) + * @param configId The identifier of the Config. (optional) + * @param environmentId The identifier of the Environment. (optional) + * @param auditLogType Filter Audit logs by Audit log type. (optional) + * @param fromUtcDateTime Filter Audit logs by starting UTC date. (optional) + * @param toUtcDateTime Filter Audit logs by ending UTC date. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getOrganizationAuditlogsCall(UUID organizationId, UUID productId, UUID configId, UUID environmentId, AuditLogType auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/organizations/{organizationId}/auditlogs" + .replace("{" + "organizationId" + "}", localVarApiClient.escapeString(organizationId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (productId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("productId", productId)); + } + + if (configId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("configId", configId)); + } + + if (environmentId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("environmentId", environmentId)); + } + + if (auditLogType != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("auditLogType", auditLogType)); + } + + if (fromUtcDateTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fromUtcDateTime", fromUtcDateTime)); + } + + if (toUtcDateTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("toUtcDateTime", toUtcDateTime)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOrganizationAuditlogsValidateBeforeCall(UUID organizationId, UUID productId, UUID configId, UUID environmentId, AuditLogType auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { + throw new ApiException("Missing the required parameter 'organizationId' when calling getOrganizationAuditlogs(Async)"); + } + + return getOrganizationAuditlogsCall(organizationId, productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime, _callback); + + } + + /** + * List Audit log items for Organization + * This endpoint returns the list of Audit log items for a given Organization and the result can be optionally filtered by Product and/or Config and/or Environment. If neither `fromUtcDateTime` nor `toUtcDateTime` is set, the audit logs for the **last 7 days** will be returned. The distance between `fromUtcDateTime` and `toUtcDateTime` cannot exceed **30 days**. + * @param organizationId The identifier of the Organization. (required) + * @param productId The identifier of the Product. (optional) + * @param configId The identifier of the Config. (optional) + * @param environmentId The identifier of the Environment. (optional) + * @param auditLogType Filter Audit logs by Audit log type. (optional) + * @param fromUtcDateTime Filter Audit logs by starting UTC date. (optional) + * @param toUtcDateTime Filter Audit logs by ending UTC date. (optional) + * @return List<AuditLogItemModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public List getOrganizationAuditlogs(UUID organizationId, UUID productId, UUID configId, UUID environmentId, AuditLogType auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime) throws ApiException { + ApiResponse> localVarResp = getOrganizationAuditlogsWithHttpInfo(organizationId, productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime); + return localVarResp.getData(); + } + + /** + * List Audit log items for Organization + * This endpoint returns the list of Audit log items for a given Organization and the result can be optionally filtered by Product and/or Config and/or Environment. If neither `fromUtcDateTime` nor `toUtcDateTime` is set, the audit logs for the **last 7 days** will be returned. The distance between `fromUtcDateTime` and `toUtcDateTime` cannot exceed **30 days**. + * @param organizationId The identifier of the Organization. (required) + * @param productId The identifier of the Product. (optional) + * @param configId The identifier of the Config. (optional) + * @param environmentId The identifier of the Environment. (optional) + * @param auditLogType Filter Audit logs by Audit log type. (optional) + * @param fromUtcDateTime Filter Audit logs by starting UTC date. (optional) + * @param toUtcDateTime Filter Audit logs by ending UTC date. (optional) + * @return ApiResponse<List<AuditLogItemModel>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse> getOrganizationAuditlogsWithHttpInfo(UUID organizationId, UUID productId, UUID configId, UUID environmentId, AuditLogType auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime) throws ApiException { + okhttp3.Call localVarCall = getOrganizationAuditlogsValidateBeforeCall(organizationId, productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Audit log items for Organization (asynchronously) + * This endpoint returns the list of Audit log items for a given Organization and the result can be optionally filtered by Product and/or Config and/or Environment. If neither `fromUtcDateTime` nor `toUtcDateTime` is set, the audit logs for the **last 7 days** will be returned. The distance between `fromUtcDateTime` and `toUtcDateTime` cannot exceed **30 days**. + * @param organizationId The identifier of the Organization. (required) + * @param productId The identifier of the Product. (optional) + * @param configId The identifier of the Config. (optional) + * @param environmentId The identifier of the Environment. (optional) + * @param auditLogType Filter Audit logs by Audit log type. (optional) + * @param fromUtcDateTime Filter Audit logs by starting UTC date. (optional) + * @param toUtcDateTime Filter Audit logs by ending UTC date. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getOrganizationAuditlogsAsync(UUID organizationId, UUID productId, UUID configId, UUID environmentId, AuditLogType auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getOrganizationAuditlogsValidateBeforeCall(organizationId, productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/CodeReferencesApi.java b/src/main/java/com/configcat/publicapi/java/client/api/CodeReferencesApi.java new file mode 100644 index 0000000..22e4524 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/api/CodeReferencesApi.java @@ -0,0 +1,476 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.api; + +import com.configcat.publicapi.java.client.ApiCallback; +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.ApiResponse; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ProgressRequestBody; +import com.configcat.publicapi.java.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.configcat.publicapi.java.client.model.CodeReferenceModel; +import com.configcat.publicapi.java.client.model.CodeReferenceRequest; +import com.configcat.publicapi.java.client.model.DeleteRepositoryReportsRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class CodeReferencesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public CodeReferencesApi() { + this(Configuration.getDefaultApiClient()); + } + + public CodeReferencesApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for v1CodeReferencesDeleteReportsPost + * @param deleteRepositoryReportsRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call v1CodeReferencesDeleteReportsPostCall(DeleteRepositoryReportsRequest deleteRepositoryReportsRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deleteRepositoryReportsRequest; + + // create path and map variables + String localVarPath = "/v1/code-references/delete-reports"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call v1CodeReferencesDeleteReportsPostValidateBeforeCall(DeleteRepositoryReportsRequest deleteRepositoryReportsRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'deleteRepositoryReportsRequest' is set + if (deleteRepositoryReportsRequest == null) { + throw new ApiException("Missing the required parameter 'deleteRepositoryReportsRequest' when calling v1CodeReferencesDeleteReportsPost(Async)"); + } + + return v1CodeReferencesDeleteReportsPostCall(deleteRepositoryReportsRequest, _callback); + + } + + /** + * Delete Reference reports + * + * @param deleteRepositoryReportsRequest (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public void v1CodeReferencesDeleteReportsPost(DeleteRepositoryReportsRequest deleteRepositoryReportsRequest) throws ApiException { + v1CodeReferencesDeleteReportsPostWithHttpInfo(deleteRepositoryReportsRequest); + } + + /** + * Delete Reference reports + * + * @param deleteRepositoryReportsRequest (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse v1CodeReferencesDeleteReportsPostWithHttpInfo(DeleteRepositoryReportsRequest deleteRepositoryReportsRequest) throws ApiException { + okhttp3.Call localVarCall = v1CodeReferencesDeleteReportsPostValidateBeforeCall(deleteRepositoryReportsRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete Reference reports (asynchronously) + * + * @param deleteRepositoryReportsRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call v1CodeReferencesDeleteReportsPostAsync(DeleteRepositoryReportsRequest deleteRepositoryReportsRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v1CodeReferencesDeleteReportsPostValidateBeforeCall(deleteRepositoryReportsRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for v1CodeReferencesPost + * @param codeReferenceRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call v1CodeReferencesPostCall(CodeReferenceRequest codeReferenceRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = codeReferenceRequest; + + // create path and map variables + String localVarPath = "/v1/code-references"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call v1CodeReferencesPostValidateBeforeCall(CodeReferenceRequest codeReferenceRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'codeReferenceRequest' is set + if (codeReferenceRequest == null) { + throw new ApiException("Missing the required parameter 'codeReferenceRequest' when calling v1CodeReferencesPost(Async)"); + } + + return v1CodeReferencesPostCall(codeReferenceRequest, _callback); + + } + + /** + * Upload References + * + * @param codeReferenceRequest (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public void v1CodeReferencesPost(CodeReferenceRequest codeReferenceRequest) throws ApiException { + v1CodeReferencesPostWithHttpInfo(codeReferenceRequest); + } + + /** + * Upload References + * + * @param codeReferenceRequest (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse v1CodeReferencesPostWithHttpInfo(CodeReferenceRequest codeReferenceRequest) throws ApiException { + okhttp3.Call localVarCall = v1CodeReferencesPostValidateBeforeCall(codeReferenceRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Upload References (asynchronously) + * + * @param codeReferenceRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call v1CodeReferencesPostAsync(CodeReferenceRequest codeReferenceRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v1CodeReferencesPostValidateBeforeCall(codeReferenceRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for v1SettingsSettingIdCodeReferencesGet + * @param settingId The identifier of the Feature Flag or Setting. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call v1SettingsSettingIdCodeReferencesGetCall(Integer settingId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/settings/{settingId}/code-references" + .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call v1SettingsSettingIdCodeReferencesGetValidateBeforeCall(Integer settingId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settingId' is set + if (settingId == null) { + throw new ApiException("Missing the required parameter 'settingId' when calling v1SettingsSettingIdCodeReferencesGet(Async)"); + } + + return v1SettingsSettingIdCodeReferencesGetCall(settingId, _callback); + + } + + /** + * Get References for Feature Flag or Setting + * + * @param settingId The identifier of the Feature Flag or Setting. (required) + * @return List<CodeReferenceModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public List v1SettingsSettingIdCodeReferencesGet(Integer settingId) throws ApiException { + ApiResponse> localVarResp = v1SettingsSettingIdCodeReferencesGetWithHttpInfo(settingId); + return localVarResp.getData(); + } + + /** + * Get References for Feature Flag or Setting + * + * @param settingId The identifier of the Feature Flag or Setting. (required) + * @return ApiResponse<List<CodeReferenceModel>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse> v1SettingsSettingIdCodeReferencesGetWithHttpInfo(Integer settingId) throws ApiException { + okhttp3.Call localVarCall = v1SettingsSettingIdCodeReferencesGetValidateBeforeCall(settingId, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get References for Feature Flag or Setting (asynchronously) + * + * @param settingId The identifier of the Feature Flag or Setting. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call v1SettingsSettingIdCodeReferencesGetAsync(Integer settingId, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = v1SettingsSettingIdCodeReferencesGetValidateBeforeCall(settingId, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/ConfigsApi.java b/src/main/java/com/configcat/publicapi/java/client/api/ConfigsApi.java new file mode 100644 index 0000000..d664bcb --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/api/ConfigsApi.java @@ -0,0 +1,772 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.api; + +import com.configcat.publicapi.java.client.ApiCallback; +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.ApiResponse; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ProgressRequestBody; +import com.configcat.publicapi.java.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.configcat.publicapi.java.client.model.ConfigModel; +import com.configcat.publicapi.java.client.model.CreateConfigRequest; +import java.util.UUID; +import com.configcat.publicapi.java.client.model.UpdateConfigRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ConfigsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ConfigsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ConfigsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createConfig + * @param productId The identifier of the Product. (required) + * @param createConfigRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call createConfigCall(UUID productId, CreateConfigRequest createConfigRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createConfigRequest; + + // create path and map variables + String localVarPath = "/v1/products/{productId}/configs" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createConfigValidateBeforeCall(UUID productId, CreateConfigRequest createConfigRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling createConfig(Async)"); + } + + // verify the required parameter 'createConfigRequest' is set + if (createConfigRequest == null) { + throw new ApiException("Missing the required parameter 'createConfigRequest' when calling createConfig(Async)"); + } + + return createConfigCall(productId, createConfigRequest, _callback); + + } + + /** + * Create Config + * This endpoint creates a new Config in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @param createConfigRequest (required) + * @return ConfigModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ConfigModel createConfig(UUID productId, CreateConfigRequest createConfigRequest) throws ApiException { + ApiResponse localVarResp = createConfigWithHttpInfo(productId, createConfigRequest); + return localVarResp.getData(); + } + + /** + * Create Config + * This endpoint creates a new Config in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @param createConfigRequest (required) + * @return ApiResponse<ConfigModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse createConfigWithHttpInfo(UUID productId, CreateConfigRequest createConfigRequest) throws ApiException { + okhttp3.Call localVarCall = createConfigValidateBeforeCall(productId, createConfigRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Config (asynchronously) + * This endpoint creates a new Config in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @param createConfigRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call createConfigAsync(UUID productId, CreateConfigRequest createConfigRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createConfigValidateBeforeCall(productId, createConfigRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteConfig + * @param configId The identifier of the Config. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteConfigCall(UUID configId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/configs/{configId}" + .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteConfigValidateBeforeCall(UUID configId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'configId' is set + if (configId == null) { + throw new ApiException("Missing the required parameter 'configId' when calling deleteConfig(Async)"); + } + + return deleteConfigCall(configId, _callback); + + } + + /** + * Delete Config + * This endpoint removes a Config identified by the `configId` parameter. + * @param configId The identifier of the Config. (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public void deleteConfig(UUID configId) throws ApiException { + deleteConfigWithHttpInfo(configId); + } + + /** + * Delete Config + * This endpoint removes a Config identified by the `configId` parameter. + * @param configId The identifier of the Config. (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse deleteConfigWithHttpInfo(UUID configId) throws ApiException { + okhttp3.Call localVarCall = deleteConfigValidateBeforeCall(configId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete Config (asynchronously) + * This endpoint removes a Config identified by the `configId` parameter. + * @param configId The identifier of the Config. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteConfigAsync(UUID configId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteConfigValidateBeforeCall(configId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getConfig + * @param configId The identifier of the Config. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the config data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getConfigCall(UUID configId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/configs/{configId}" + .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getConfigValidateBeforeCall(UUID configId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'configId' is set + if (configId == null) { + throw new ApiException("Missing the required parameter 'configId' when calling getConfig(Async)"); + } + + return getConfigCall(configId, _callback); + + } + + /** + * Get Config + * This endpoint returns the metadata of a Config identified by the `configId`. + * @param configId The identifier of the Config. (required) + * @return ConfigModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the config data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ConfigModel getConfig(UUID configId) throws ApiException { + ApiResponse localVarResp = getConfigWithHttpInfo(configId); + return localVarResp.getData(); + } + + /** + * Get Config + * This endpoint returns the metadata of a Config identified by the `configId`. + * @param configId The identifier of the Config. (required) + * @return ApiResponse<ConfigModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the config data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getConfigWithHttpInfo(UUID configId) throws ApiException { + okhttp3.Call localVarCall = getConfigValidateBeforeCall(configId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Config (asynchronously) + * This endpoint returns the metadata of a Config identified by the `configId`. + * @param configId The identifier of the Config. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the config data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getConfigAsync(UUID configId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getConfigValidateBeforeCall(configId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getConfigs + * @param productId The identifier of the Product. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getConfigsCall(UUID productId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/products/{productId}/configs" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getConfigsValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling getConfigs(Async)"); + } + + return getConfigsCall(productId, _callback); + + } + + /** + * List Configs + * This endpoint returns the list of the Configs that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @return List<ConfigModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public List getConfigs(UUID productId) throws ApiException { + ApiResponse> localVarResp = getConfigsWithHttpInfo(productId); + return localVarResp.getData(); + } + + /** + * List Configs + * This endpoint returns the list of the Configs that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @return ApiResponse<List<ConfigModel>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse> getConfigsWithHttpInfo(UUID productId) throws ApiException { + okhttp3.Call localVarCall = getConfigsValidateBeforeCall(productId, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Configs (asynchronously) + * This endpoint returns the list of the Configs that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getConfigsAsync(UUID productId, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getConfigsValidateBeforeCall(productId, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateConfig + * @param configId The identifier of the Config. (required) + * @param updateConfigRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateConfigCall(UUID configId, UpdateConfigRequest updateConfigRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateConfigRequest; + + // create path and map variables + String localVarPath = "/v1/configs/{configId}" + .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateConfigValidateBeforeCall(UUID configId, UpdateConfigRequest updateConfigRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'configId' is set + if (configId == null) { + throw new ApiException("Missing the required parameter 'configId' when calling updateConfig(Async)"); + } + + // verify the required parameter 'updateConfigRequest' is set + if (updateConfigRequest == null) { + throw new ApiException("Missing the required parameter 'updateConfigRequest' when calling updateConfig(Async)"); + } + + return updateConfigCall(configId, updateConfigRequest, _callback); + + } + + /** + * Update Config + * This endpoint updates a Config identified by the `configId` parameter. + * @param configId The identifier of the Config. (required) + * @param updateConfigRequest (required) + * @return ConfigModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ConfigModel updateConfig(UUID configId, UpdateConfigRequest updateConfigRequest) throws ApiException { + ApiResponse localVarResp = updateConfigWithHttpInfo(configId, updateConfigRequest); + return localVarResp.getData(); + } + + /** + * Update Config + * This endpoint updates a Config identified by the `configId` parameter. + * @param configId The identifier of the Config. (required) + * @param updateConfigRequest (required) + * @return ApiResponse<ConfigModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse updateConfigWithHttpInfo(UUID configId, UpdateConfigRequest updateConfigRequest) throws ApiException { + okhttp3.Call localVarCall = updateConfigValidateBeforeCall(configId, updateConfigRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Config (asynchronously) + * This endpoint updates a Config identified by the `configId` parameter. + * @param configId The identifier of the Config. (required) + * @param updateConfigRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateConfigAsync(UUID configId, UpdateConfigRequest updateConfigRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateConfigValidateBeforeCall(configId, updateConfigRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/EnvironmentsApi.java b/src/main/java/com/configcat/publicapi/java/client/api/EnvironmentsApi.java new file mode 100644 index 0000000..0ef5b52 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/api/EnvironmentsApi.java @@ -0,0 +1,780 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.api; + +import com.configcat.publicapi.java.client.ApiCallback; +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.ApiResponse; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ProgressRequestBody; +import com.configcat.publicapi.java.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.configcat.publicapi.java.client.model.CreateEnvironmentModel; +import com.configcat.publicapi.java.client.model.EnvironmentModel; +import java.util.UUID; +import com.configcat.publicapi.java.client.model.UpdateEnvironmentModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class EnvironmentsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public EnvironmentsApi() { + this(Configuration.getDefaultApiClient()); + } + + public EnvironmentsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createEnvironment + * @param productId The identifier of the Product. (required) + * @param createEnvironmentModel (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call createEnvironmentCall(UUID productId, CreateEnvironmentModel createEnvironmentModel, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createEnvironmentModel; + + // create path and map variables + String localVarPath = "/v1/products/{productId}/environments" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createEnvironmentValidateBeforeCall(UUID productId, CreateEnvironmentModel createEnvironmentModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling createEnvironment(Async)"); + } + + // verify the required parameter 'createEnvironmentModel' is set + if (createEnvironmentModel == null) { + throw new ApiException("Missing the required parameter 'createEnvironmentModel' when calling createEnvironment(Async)"); + } + + return createEnvironmentCall(productId, createEnvironmentModel, _callback); + + } + + /** + * Create Environment + * This endpoint creates a new Environment in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @param createEnvironmentModel (required) + * @return EnvironmentModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public EnvironmentModel createEnvironment(UUID productId, CreateEnvironmentModel createEnvironmentModel) throws ApiException { + ApiResponse localVarResp = createEnvironmentWithHttpInfo(productId, createEnvironmentModel); + return localVarResp.getData(); + } + + /** + * Create Environment + * This endpoint creates a new Environment in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @param createEnvironmentModel (required) + * @return ApiResponse<EnvironmentModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse createEnvironmentWithHttpInfo(UUID productId, CreateEnvironmentModel createEnvironmentModel) throws ApiException { + okhttp3.Call localVarCall = createEnvironmentValidateBeforeCall(productId, createEnvironmentModel, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Environment (asynchronously) + * This endpoint creates a new Environment in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @param createEnvironmentModel (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call createEnvironmentAsync(UUID productId, CreateEnvironmentModel createEnvironmentModel, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createEnvironmentValidateBeforeCall(productId, createEnvironmentModel, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteEnvironment + * @param environmentId The identifier of the Environment. (required) + * @param cleanupAuditLogs An optional flag which indicates whether the audit log records related to the environment should be deleted or not. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteEnvironmentCall(UUID environmentId, Boolean cleanupAuditLogs, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/environments/{environmentId}" + .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (cleanupAuditLogs != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("cleanupAuditLogs", cleanupAuditLogs)); + } + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteEnvironmentValidateBeforeCall(UUID environmentId, Boolean cleanupAuditLogs, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'environmentId' is set + if (environmentId == null) { + throw new ApiException("Missing the required parameter 'environmentId' when calling deleteEnvironment(Async)"); + } + + return deleteEnvironmentCall(environmentId, cleanupAuditLogs, _callback); + + } + + /** + * Delete Environment + * This endpoint removes an Environment identified by the `environmentId` parameter. If the `cleanupAuditLogs` flag is set to true, it also deletes the audit log records related to the environment (except for the `Created a new environment` and `Deleted an environment` records). + * @param environmentId The identifier of the Environment. (required) + * @param cleanupAuditLogs An optional flag which indicates whether the audit log records related to the environment should be deleted or not. (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public void deleteEnvironment(UUID environmentId, Boolean cleanupAuditLogs) throws ApiException { + deleteEnvironmentWithHttpInfo(environmentId, cleanupAuditLogs); + } + + /** + * Delete Environment + * This endpoint removes an Environment identified by the `environmentId` parameter. If the `cleanupAuditLogs` flag is set to true, it also deletes the audit log records related to the environment (except for the `Created a new environment` and `Deleted an environment` records). + * @param environmentId The identifier of the Environment. (required) + * @param cleanupAuditLogs An optional flag which indicates whether the audit log records related to the environment should be deleted or not. (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse deleteEnvironmentWithHttpInfo(UUID environmentId, Boolean cleanupAuditLogs) throws ApiException { + okhttp3.Call localVarCall = deleteEnvironmentValidateBeforeCall(environmentId, cleanupAuditLogs, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete Environment (asynchronously) + * This endpoint removes an Environment identified by the `environmentId` parameter. If the `cleanupAuditLogs` flag is set to true, it also deletes the audit log records related to the environment (except for the `Created a new environment` and `Deleted an environment` records). + * @param environmentId The identifier of the Environment. (required) + * @param cleanupAuditLogs An optional flag which indicates whether the audit log records related to the environment should be deleted or not. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteEnvironmentAsync(UUID environmentId, Boolean cleanupAuditLogs, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteEnvironmentValidateBeforeCall(environmentId, cleanupAuditLogs, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getEnvironment + * @param environmentId The identifier of the Environment. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the environment data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getEnvironmentCall(UUID environmentId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/environments/{environmentId}" + .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getEnvironmentValidateBeforeCall(UUID environmentId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'environmentId' is set + if (environmentId == null) { + throw new ApiException("Missing the required parameter 'environmentId' when calling getEnvironment(Async)"); + } + + return getEnvironmentCall(environmentId, _callback); + + } + + /** + * Get Environment + * This endpoint returns the metadata of an Environment identified by the `environmentId`. + * @param environmentId The identifier of the Environment. (required) + * @return EnvironmentModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the environment data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public EnvironmentModel getEnvironment(UUID environmentId) throws ApiException { + ApiResponse localVarResp = getEnvironmentWithHttpInfo(environmentId); + return localVarResp.getData(); + } + + /** + * Get Environment + * This endpoint returns the metadata of an Environment identified by the `environmentId`. + * @param environmentId The identifier of the Environment. (required) + * @return ApiResponse<EnvironmentModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the environment data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getEnvironmentWithHttpInfo(UUID environmentId) throws ApiException { + okhttp3.Call localVarCall = getEnvironmentValidateBeforeCall(environmentId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Environment (asynchronously) + * This endpoint returns the metadata of an Environment identified by the `environmentId`. + * @param environmentId The identifier of the Environment. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the environment data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getEnvironmentAsync(UUID environmentId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getEnvironmentValidateBeforeCall(environmentId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getEnvironments + * @param productId The identifier of the Product. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getEnvironmentsCall(UUID productId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/products/{productId}/environments" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getEnvironmentsValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling getEnvironments(Async)"); + } + + return getEnvironmentsCall(productId, _callback); + + } + + /** + * List Environments + * This endpoint returns the list of the Environments that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @return List<EnvironmentModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public List getEnvironments(UUID productId) throws ApiException { + ApiResponse> localVarResp = getEnvironmentsWithHttpInfo(productId); + return localVarResp.getData(); + } + + /** + * List Environments + * This endpoint returns the list of the Environments that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @return ApiResponse<List<EnvironmentModel>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse> getEnvironmentsWithHttpInfo(UUID productId) throws ApiException { + okhttp3.Call localVarCall = getEnvironmentsValidateBeforeCall(productId, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Environments (asynchronously) + * This endpoint returns the list of the Environments that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getEnvironmentsAsync(UUID productId, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getEnvironmentsValidateBeforeCall(productId, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateEnvironment + * @param environmentId The identifier of the Environment. (required) + * @param updateEnvironmentModel (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateEnvironmentCall(UUID environmentId, UpdateEnvironmentModel updateEnvironmentModel, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateEnvironmentModel; + + // create path and map variables + String localVarPath = "/v1/environments/{environmentId}" + .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateEnvironmentValidateBeforeCall(UUID environmentId, UpdateEnvironmentModel updateEnvironmentModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'environmentId' is set + if (environmentId == null) { + throw new ApiException("Missing the required parameter 'environmentId' when calling updateEnvironment(Async)"); + } + + // verify the required parameter 'updateEnvironmentModel' is set + if (updateEnvironmentModel == null) { + throw new ApiException("Missing the required parameter 'updateEnvironmentModel' when calling updateEnvironment(Async)"); + } + + return updateEnvironmentCall(environmentId, updateEnvironmentModel, _callback); + + } + + /** + * Update Environment + * This endpoint updates an Environment identified by the `environmentId` parameter. + * @param environmentId The identifier of the Environment. (required) + * @param updateEnvironmentModel (required) + * @return EnvironmentModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public EnvironmentModel updateEnvironment(UUID environmentId, UpdateEnvironmentModel updateEnvironmentModel) throws ApiException { + ApiResponse localVarResp = updateEnvironmentWithHttpInfo(environmentId, updateEnvironmentModel); + return localVarResp.getData(); + } + + /** + * Update Environment + * This endpoint updates an Environment identified by the `environmentId` parameter. + * @param environmentId The identifier of the Environment. (required) + * @param updateEnvironmentModel (required) + * @return ApiResponse<EnvironmentModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse updateEnvironmentWithHttpInfo(UUID environmentId, UpdateEnvironmentModel updateEnvironmentModel) throws ApiException { + okhttp3.Call localVarCall = updateEnvironmentValidateBeforeCall(environmentId, updateEnvironmentModel, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Environment (asynchronously) + * This endpoint updates an Environment identified by the `environmentId` parameter. + * @param environmentId The identifier of the Environment. (required) + * @param updateEnvironmentModel (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateEnvironmentAsync(UUID environmentId, UpdateEnvironmentModel updateEnvironmentModel, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateEnvironmentValidateBeforeCall(environmentId, updateEnvironmentModel, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesApi.java b/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesApi.java new file mode 100644 index 0000000..d44dd5a --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesApi.java @@ -0,0 +1,869 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.api; + +import com.configcat.publicapi.java.client.ApiCallback; +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.ApiResponse; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ProgressRequestBody; +import com.configcat.publicapi.java.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.configcat.publicapi.java.client.model.ConfigSettingValuesModel; +import com.configcat.publicapi.java.client.model.JsonPatchOperation; +import com.configcat.publicapi.java.client.model.SettingValueModel; +import java.util.UUID; +import com.configcat.publicapi.java.client.model.UpdateSettingValueModel; +import com.configcat.publicapi.java.client.model.UpdateSettingValuesWithIdModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class FeatureFlagSettingValuesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public FeatureFlagSettingValuesApi() { + this(Configuration.getDefaultApiClient()); + } + + public FeatureFlagSettingValuesApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getSettingValue + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the setting value data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSettingValueCall(UUID environmentId, Integer settingId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/environments/{environmentId}/settings/{settingId}/value" + .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())) + .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSettingValueValidateBeforeCall(UUID environmentId, Integer settingId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'environmentId' is set + if (environmentId == null) { + throw new ApiException("Missing the required parameter 'environmentId' when calling getSettingValue(Async)"); + } + + // verify the required parameter 'settingId' is set + if (settingId == null) { + throw new ApiException("Missing the required parameter 'settingId' when calling getSettingValue(Async)"); + } + + return getSettingValueCall(environmentId, settingId, _callback); + + } + + /** + * Get value + * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the `environmentId` parameter. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview). + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @return SettingValueModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the setting value data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public SettingValueModel getSettingValue(UUID environmentId, Integer settingId) throws ApiException { + ApiResponse localVarResp = getSettingValueWithHttpInfo(environmentId, settingId); + return localVarResp.getData(); + } + + /** + * Get value + * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the `environmentId` parameter. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview). + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @return ApiResponse<SettingValueModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the setting value data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getSettingValueWithHttpInfo(UUID environmentId, Integer settingId) throws ApiException { + okhttp3.Call localVarCall = getSettingValueValidateBeforeCall(environmentId, settingId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get value (asynchronously) + * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the `environmentId` parameter. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview). + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the setting value data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSettingValueAsync(UUID environmentId, Integer settingId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getSettingValueValidateBeforeCall(environmentId, settingId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getSettingValues + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSettingValuesCall(UUID configId, UUID environmentId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/configs/{configId}/environments/{environmentId}/values" + .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())) + .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSettingValuesValidateBeforeCall(UUID configId, UUID environmentId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'configId' is set + if (configId == null) { + throw new ApiException("Missing the required parameter 'configId' when calling getSettingValues(Async)"); + } + + // verify the required parameter 'environmentId' is set + if (environmentId == null) { + throw new ApiException("Missing the required parameter 'environmentId' when calling getSettingValues(Async)"); + } + + return getSettingValuesCall(configId, environmentId, _callback); + + } + + /** + * Get values + * This endpoint returns the value of a specified Config's Feature Flags or Settings identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @return ConfigSettingValuesModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ConfigSettingValuesModel getSettingValues(UUID configId, UUID environmentId) throws ApiException { + ApiResponse localVarResp = getSettingValuesWithHttpInfo(configId, environmentId); + return localVarResp.getData(); + } + + /** + * Get values + * This endpoint returns the value of a specified Config's Feature Flags or Settings identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @return ApiResponse<ConfigSettingValuesModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getSettingValuesWithHttpInfo(UUID configId, UUID environmentId) throws ApiException { + okhttp3.Call localVarCall = getSettingValuesValidateBeforeCall(configId, environmentId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get values (asynchronously) + * This endpoint returns the value of a specified Config's Feature Flags or Settings identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSettingValuesAsync(UUID configId, UUID environmentId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getSettingValuesValidateBeforeCall(configId, environmentId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for postSettingValues + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @param updateSettingValuesWithIdModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the updated setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call postSettingValuesCall(UUID configId, UUID environmentId, UpdateSettingValuesWithIdModel updateSettingValuesWithIdModel, String reason, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateSettingValuesWithIdModel; + + // create path and map variables + String localVarPath = "/v1/configs/{configId}/environments/{environmentId}/values" + .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())) + .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (reason != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call postSettingValuesValidateBeforeCall(UUID configId, UUID environmentId, UpdateSettingValuesWithIdModel updateSettingValuesWithIdModel, String reason, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'configId' is set + if (configId == null) { + throw new ApiException("Missing the required parameter 'configId' when calling postSettingValues(Async)"); + } + + // verify the required parameter 'environmentId' is set + if (environmentId == null) { + throw new ApiException("Missing the required parameter 'environmentId' when calling postSettingValues(Async)"); + } + + // verify the required parameter 'updateSettingValuesWithIdModel' is set + if (updateSettingValuesWithIdModel == null) { + throw new ApiException("Missing the required parameter 'updateSettingValuesWithIdModel' when calling postSettingValues(Async)"); + } + + return postSettingValuesCall(configId, environmentId, updateSettingValuesWithIdModel, reason, _callback); + + } + + /** + * Post values + * This endpoint replaces the values of a specified Config's Feature Flags or Settings identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"settingValues\": [ { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false, \"settingId\": 1 } ] } ``` If we send a replace request body as below: ```json { \"settingValues\": [ { \"value\": true, \"settingId\": 1 } ] } ``` Then besides that the default value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"settingValues\": [ { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true, \"setting\": { \"settingId\": 1 } } ] } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @param updateSettingValuesWithIdModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @return ConfigSettingValuesModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the updated setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ConfigSettingValuesModel postSettingValues(UUID configId, UUID environmentId, UpdateSettingValuesWithIdModel updateSettingValuesWithIdModel, String reason) throws ApiException { + ApiResponse localVarResp = postSettingValuesWithHttpInfo(configId, environmentId, updateSettingValuesWithIdModel, reason); + return localVarResp.getData(); + } + + /** + * Post values + * This endpoint replaces the values of a specified Config's Feature Flags or Settings identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"settingValues\": [ { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false, \"settingId\": 1 } ] } ``` If we send a replace request body as below: ```json { \"settingValues\": [ { \"value\": true, \"settingId\": 1 } ] } ``` Then besides that the default value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"settingValues\": [ { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true, \"setting\": { \"settingId\": 1 } } ] } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @param updateSettingValuesWithIdModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @return ApiResponse<ConfigSettingValuesModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the updated setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse postSettingValuesWithHttpInfo(UUID configId, UUID environmentId, UpdateSettingValuesWithIdModel updateSettingValuesWithIdModel, String reason) throws ApiException { + okhttp3.Call localVarCall = postSettingValuesValidateBeforeCall(configId, environmentId, updateSettingValuesWithIdModel, reason, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Post values (asynchronously) + * This endpoint replaces the values of a specified Config's Feature Flags or Settings identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"settingValues\": [ { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false, \"settingId\": 1 } ] } ``` If we send a replace request body as below: ```json { \"settingValues\": [ { \"value\": true, \"settingId\": 1 } ] } ``` Then besides that the default value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"settingValues\": [ { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true, \"setting\": { \"settingId\": 1 } } ] } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @param updateSettingValuesWithIdModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the updated setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call postSettingValuesAsync(UUID configId, UUID environmentId, UpdateSettingValuesWithIdModel updateSettingValuesWithIdModel, String reason, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = postSettingValuesValidateBeforeCall(configId, environmentId, updateSettingValuesWithIdModel, reason, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for replaceSettingValue + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param updateSettingValueModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call replaceSettingValueCall(UUID environmentId, Integer settingId, UpdateSettingValueModel updateSettingValueModel, String reason, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateSettingValueModel; + + // create path and map variables + String localVarPath = "/v1/environments/{environmentId}/settings/{settingId}/value" + .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())) + .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (reason != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call replaceSettingValueValidateBeforeCall(UUID environmentId, Integer settingId, UpdateSettingValueModel updateSettingValueModel, String reason, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'environmentId' is set + if (environmentId == null) { + throw new ApiException("Missing the required parameter 'environmentId' when calling replaceSettingValue(Async)"); + } + + // verify the required parameter 'settingId' is set + if (settingId == null) { + throw new ApiException("Missing the required parameter 'settingId' when calling replaceSettingValue(Async)"); + } + + // verify the required parameter 'updateSettingValueModel' is set + if (updateSettingValueModel == null) { + throw new ApiException("Missing the required parameter 'updateSettingValueModel' when calling replaceSettingValue(Async)"); + } + + return replaceSettingValueCall(environmentId, settingId, updateSettingValueModel, reason, _callback); + + } + + /** + * Replace value + * This endpoint replaces the whole value of a Feature Flag or Setting in a specified Environment. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send a replace request body as below: ```json { \"value\": true } ``` Then besides that the default value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param updateSettingValueModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @return SettingValueModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public SettingValueModel replaceSettingValue(UUID environmentId, Integer settingId, UpdateSettingValueModel updateSettingValueModel, String reason) throws ApiException { + ApiResponse localVarResp = replaceSettingValueWithHttpInfo(environmentId, settingId, updateSettingValueModel, reason); + return localVarResp.getData(); + } + + /** + * Replace value + * This endpoint replaces the whole value of a Feature Flag or Setting in a specified Environment. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send a replace request body as below: ```json { \"value\": true } ``` Then besides that the default value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param updateSettingValueModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @return ApiResponse<SettingValueModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse replaceSettingValueWithHttpInfo(UUID environmentId, Integer settingId, UpdateSettingValueModel updateSettingValueModel, String reason) throws ApiException { + okhttp3.Call localVarCall = replaceSettingValueValidateBeforeCall(environmentId, settingId, updateSettingValueModel, reason, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Replace value (asynchronously) + * This endpoint replaces the whole value of a Feature Flag or Setting in a specified Environment. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send a replace request body as below: ```json { \"value\": true } ``` Then besides that the default value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param updateSettingValueModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call replaceSettingValueAsync(UUID environmentId, Integer settingId, UpdateSettingValueModel updateSettingValueModel, String reason, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = replaceSettingValueValidateBeforeCall(environmentId, settingId, updateSettingValueModel, reason, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateSettingValue + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param jsonPatchOperation (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 When the patch was successful. -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateSettingValueCall(UUID environmentId, Integer settingId, List jsonPatchOperation, String reason, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = jsonPatchOperation; + + // create path and map variables + String localVarPath = "/v1/environments/{environmentId}/settings/{settingId}/value" + .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())) + .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (reason != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateSettingValueValidateBeforeCall(UUID environmentId, Integer settingId, List jsonPatchOperation, String reason, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'environmentId' is set + if (environmentId == null) { + throw new ApiException("Missing the required parameter 'environmentId' when calling updateSettingValue(Async)"); + } + + // verify the required parameter 'settingId' is set + if (settingId == null) { + throw new ApiException("Missing the required parameter 'settingId' when calling updateSettingValue(Async)"); + } + + // verify the required parameter 'jsonPatchOperation' is set + if (jsonPatchOperation == null) { + throw new ApiException("Missing the required parameter 'jsonPatchOperation' when calling updateSettingValue(Async)"); + } + + return updateSettingValueCall(environmentId, settingId, jsonPatchOperation, reason, _callback); + + } + + /** + * Update value + * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/value\", \"value\": true } ] ``` Only the default value is going to be set to `true` and all the Percentage Rules are remaining unchanged. So we get a response like this: ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": true } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param jsonPatchOperation (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @return SettingValueModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 When the patch was successful. -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public SettingValueModel updateSettingValue(UUID environmentId, Integer settingId, List jsonPatchOperation, String reason) throws ApiException { + ApiResponse localVarResp = updateSettingValueWithHttpInfo(environmentId, settingId, jsonPatchOperation, reason); + return localVarResp.getData(); + } + + /** + * Update value + * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/value\", \"value\": true } ] ``` Only the default value is going to be set to `true` and all the Percentage Rules are remaining unchanged. So we get a response like this: ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": true } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param jsonPatchOperation (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @return ApiResponse<SettingValueModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 When the patch was successful. -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse updateSettingValueWithHttpInfo(UUID environmentId, Integer settingId, List jsonPatchOperation, String reason) throws ApiException { + okhttp3.Call localVarCall = updateSettingValueValidateBeforeCall(environmentId, settingId, jsonPatchOperation, reason, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update value (asynchronously) + * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/value\", \"value\": true } ] ``` Only the default value is going to be set to `true` and all the Percentage Rules are remaining unchanged. So we get a response like this: ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": true } ``` The `rolloutRules` property describes two types of rules: - **Targeting rules**: When you want to add or update a targeting rule, the `comparator`, `comparisonAttribute`, and `comparisonValue` members are required. - **Segment rules**: When you want to add add or update a segment rule, the `segmentId` which identifies the desired segment and the `segmentComparator` members are required. + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param jsonPatchOperation (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 When the patch was successful. -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateSettingValueAsync(UUID environmentId, Integer settingId, List jsonPatchOperation, String reason, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateSettingValueValidateBeforeCall(environmentId, settingId, jsonPatchOperation, reason, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyApi.java b/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyApi.java new file mode 100644 index 0000000..d77443d --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyApi.java @@ -0,0 +1,550 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.api; + +import com.configcat.publicapi.java.client.ApiCallback; +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.ApiResponse; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ProgressRequestBody; +import com.configcat.publicapi.java.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.configcat.publicapi.java.client.model.JsonPatchOperation; +import com.configcat.publicapi.java.client.model.SettingValueModel; +import com.configcat.publicapi.java.client.model.UpdateSettingValueModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class FeatureFlagSettingValuesUsingSdkKeyApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public FeatureFlagSettingValuesUsingSdkKeyApi() { + this(Configuration.getDefaultApiClient()); + } + + public FeatureFlagSettingValuesUsingSdkKeyApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getSettingValueBySdkkey + * @param settingKeyOrId The key or id of the Setting. (required) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSettingValueBySdkkeyCall(String settingKeyOrId, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/settings/{settingKeyOrId}/value" + .replace("{" + "settingKeyOrId" + "}", localVarApiClient.escapeString(settingKeyOrId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (X_CONFIGCAT_SDKKEY != null) { + localVarHeaderParams.put("X-CONFIGCAT-SDKKEY", localVarApiClient.parameterToString(X_CONFIGCAT_SDKKEY)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSettingValueBySdkkeyValidateBeforeCall(String settingKeyOrId, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settingKeyOrId' is set + if (settingKeyOrId == null) { + throw new ApiException("Missing the required parameter 'settingKeyOrId' when calling getSettingValueBySdkkey(Async)"); + } + + return getSettingValueBySdkkeyCall(settingKeyOrId, X_CONFIGCAT_SDKKEY, _callback); + + } + + /** + * Get value + * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). + * @param settingKeyOrId The key or id of the Setting. (required) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @return SettingValueModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public SettingValueModel getSettingValueBySdkkey(String settingKeyOrId, String X_CONFIGCAT_SDKKEY) throws ApiException { + ApiResponse localVarResp = getSettingValueBySdkkeyWithHttpInfo(settingKeyOrId, X_CONFIGCAT_SDKKEY); + return localVarResp.getData(); + } + + /** + * Get value + * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). + * @param settingKeyOrId The key or id of the Setting. (required) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @return ApiResponse<SettingValueModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getSettingValueBySdkkeyWithHttpInfo(String settingKeyOrId, String X_CONFIGCAT_SDKKEY) throws ApiException { + okhttp3.Call localVarCall = getSettingValueBySdkkeyValidateBeforeCall(settingKeyOrId, X_CONFIGCAT_SDKKEY, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get value (asynchronously) + * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). + * @param settingKeyOrId The key or id of the Setting. (required) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSettingValueBySdkkeyAsync(String settingKeyOrId, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getSettingValueBySdkkeyValidateBeforeCall(settingKeyOrId, X_CONFIGCAT_SDKKEY, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for replaceSettingValueBySdkkey + * @param settingKeyOrId The key or id of the Setting. (required) + * @param updateSettingValueModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call replaceSettingValueBySdkkeyCall(String settingKeyOrId, UpdateSettingValueModel updateSettingValueModel, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateSettingValueModel; + + // create path and map variables + String localVarPath = "/v1/settings/{settingKeyOrId}/value" + .replace("{" + "settingKeyOrId" + "}", localVarApiClient.escapeString(settingKeyOrId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (reason != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); + } + + if (X_CONFIGCAT_SDKKEY != null) { + localVarHeaderParams.put("X-CONFIGCAT-SDKKEY", localVarApiClient.parameterToString(X_CONFIGCAT_SDKKEY)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call replaceSettingValueBySdkkeyValidateBeforeCall(String settingKeyOrId, UpdateSettingValueModel updateSettingValueModel, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settingKeyOrId' is set + if (settingKeyOrId == null) { + throw new ApiException("Missing the required parameter 'settingKeyOrId' when calling replaceSettingValueBySdkkey(Async)"); + } + + // verify the required parameter 'updateSettingValueModel' is set + if (updateSettingValueModel == null) { + throw new ApiException("Missing the required parameter 'updateSettingValueModel' when calling replaceSettingValueBySdkkey(Async)"); + } + + return replaceSettingValueBySdkkeyCall(settingKeyOrId, updateSettingValueModel, reason, X_CONFIGCAT_SDKKEY, _callback); + + } + + /** + * Replace value + * This endpoint replaces the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send a replace request body as below: ```json { \"value\": true } ``` Then besides that the default served value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true } ``` + * @param settingKeyOrId The key or id of the Setting. (required) + * @param updateSettingValueModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @return SettingValueModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public SettingValueModel replaceSettingValueBySdkkey(String settingKeyOrId, UpdateSettingValueModel updateSettingValueModel, String reason, String X_CONFIGCAT_SDKKEY) throws ApiException { + ApiResponse localVarResp = replaceSettingValueBySdkkeyWithHttpInfo(settingKeyOrId, updateSettingValueModel, reason, X_CONFIGCAT_SDKKEY); + return localVarResp.getData(); + } + + /** + * Replace value + * This endpoint replaces the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send a replace request body as below: ```json { \"value\": true } ``` Then besides that the default served value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true } ``` + * @param settingKeyOrId The key or id of the Setting. (required) + * @param updateSettingValueModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @return ApiResponse<SettingValueModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse replaceSettingValueBySdkkeyWithHttpInfo(String settingKeyOrId, UpdateSettingValueModel updateSettingValueModel, String reason, String X_CONFIGCAT_SDKKEY) throws ApiException { + okhttp3.Call localVarCall = replaceSettingValueBySdkkeyValidateBeforeCall(settingKeyOrId, updateSettingValueModel, reason, X_CONFIGCAT_SDKKEY, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Replace value (asynchronously) + * This endpoint replaces the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send a replace request body as below: ```json { \"value\": true } ``` Then besides that the default served value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { \"rolloutPercentageItems\": [], \"rolloutRules\": [], \"value\": true } ``` + * @param settingKeyOrId The key or id of the Setting. (required) + * @param updateSettingValueModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call replaceSettingValueBySdkkeyAsync(String settingKeyOrId, UpdateSettingValueModel updateSettingValueModel, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = replaceSettingValueBySdkkeyValidateBeforeCall(settingKeyOrId, updateSettingValueModel, reason, X_CONFIGCAT_SDKKEY, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateSettingValueBySdkkey + * @param settingKeyOrId The key or id of the Setting. (required) + * @param jsonPatchOperation (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateSettingValueBySdkkeyCall(String settingKeyOrId, List jsonPatchOperation, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = jsonPatchOperation; + + // create path and map variables + String localVarPath = "/v1/settings/{settingKeyOrId}/value" + .replace("{" + "settingKeyOrId" + "}", localVarApiClient.escapeString(settingKeyOrId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (reason != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); + } + + if (X_CONFIGCAT_SDKKEY != null) { + localVarHeaderParams.put("X-CONFIGCAT-SDKKEY", localVarApiClient.parameterToString(X_CONFIGCAT_SDKKEY)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateSettingValueBySdkkeyValidateBeforeCall(String settingKeyOrId, List jsonPatchOperation, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settingKeyOrId' is set + if (settingKeyOrId == null) { + throw new ApiException("Missing the required parameter 'settingKeyOrId' when calling updateSettingValueBySdkkey(Async)"); + } + + // verify the required parameter 'jsonPatchOperation' is set + if (jsonPatchOperation == null) { + throw new ApiException("Missing the required parameter 'jsonPatchOperation' when calling updateSettingValueBySdkkey(Async)"); + } + + return updateSettingValueBySdkkeyCall(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY, _callback); + + } + + /** + * Update value + * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/value\", \"value\": true } ] ``` Only the default served value is going to be set to `true` and all the Percentage Rules are remaining unchanged. So we get a response like this: ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": true } ``` + * @param settingKeyOrId The key or id of the Setting. (required) + * @param jsonPatchOperation (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @return SettingValueModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public SettingValueModel updateSettingValueBySdkkey(String settingKeyOrId, List jsonPatchOperation, String reason, String X_CONFIGCAT_SDKKEY) throws ApiException { + ApiResponse localVarResp = updateSettingValueBySdkkeyWithHttpInfo(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY); + return localVarResp.getData(); + } + + /** + * Update value + * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/value\", \"value\": true } ] ``` Only the default served value is going to be set to `true` and all the Percentage Rules are remaining unchanged. So we get a response like this: ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": true } ``` + * @param settingKeyOrId The key or id of the Setting. (required) + * @param jsonPatchOperation (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @return ApiResponse<SettingValueModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse updateSettingValueBySdkkeyWithHttpInfo(String settingKeyOrId, List jsonPatchOperation, String reason, String X_CONFIGCAT_SDKKEY) throws ApiException { + okhttp3.Call localVarCall = updateSettingValueBySdkkeyValidateBeforeCall(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update value (asynchronously) + * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource. ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": false } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/value\", \"value\": true } ] ``` Only the default served value is going to be set to `true` and all the Percentage Rules are remaining unchanged. So we get a response like this: ```json { \"rolloutPercentageItems\": [ { \"percentage\": 30, \"value\": true }, { \"percentage\": 70, \"value\": false } ], \"rolloutRules\": [], \"value\": true } ``` + * @param settingKeyOrId The key or id of the Setting. (required) + * @param jsonPatchOperation (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateSettingValueBySdkkeyAsync(String settingKeyOrId, List jsonPatchOperation, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateSettingValueBySdkkeyValidateBeforeCall(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyV2Api.java b/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyV2Api.java new file mode 100644 index 0000000..85149f8 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyV2Api.java @@ -0,0 +1,550 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.api; + +import com.configcat.publicapi.java.client.ApiCallback; +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.ApiResponse; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ProgressRequestBody; +import com.configcat.publicapi.java.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.configcat.publicapi.java.client.model.JsonPatchOperation; +import com.configcat.publicapi.java.client.model.SettingFormulaModel; +import com.configcat.publicapi.java.client.model.UpdateEvaluationFormulaModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class FeatureFlagSettingValuesUsingSdkKeyV2Api { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public FeatureFlagSettingValuesUsingSdkKeyV2Api() { + this(Configuration.getDefaultApiClient()); + } + + public FeatureFlagSettingValuesUsingSdkKeyV2Api(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getSettingValueBySdkkeyV2 + * @param settingKeyOrId The key or id of the Setting. (required) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSettingValueBySdkkeyV2Call(String settingKeyOrId, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v2/settings/{settingKeyOrId}/value" + .replace("{" + "settingKeyOrId" + "}", localVarApiClient.escapeString(settingKeyOrId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (X_CONFIGCAT_SDKKEY != null) { + localVarHeaderParams.put("X-CONFIGCAT-SDKKEY", localVarApiClient.parameterToString(X_CONFIGCAT_SDKKEY)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSettingValueBySdkkeyV2ValidateBeforeCall(String settingKeyOrId, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settingKeyOrId' is set + if (settingKeyOrId == null) { + throw new ApiException("Missing the required parameter 'settingKeyOrId' when calling getSettingValueBySdkkeyV2(Async)"); + } + + return getSettingValueBySdkkeyV2Call(settingKeyOrId, X_CONFIGCAT_SDKKEY, _callback); + + } + + /** + * Get value + * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. The most important fields in the response are the `defaultValue`, `targetingRules`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used at the [percentage evaluation](https://configcat.com/docs/advanced/targeting/#anatomy-of-the-percentage-based-targeting) of the Feature Flag or Setting. + * @param settingKeyOrId The key or id of the Setting. (required) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @return SettingFormulaModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public SettingFormulaModel getSettingValueBySdkkeyV2(String settingKeyOrId, String X_CONFIGCAT_SDKKEY) throws ApiException { + ApiResponse localVarResp = getSettingValueBySdkkeyV2WithHttpInfo(settingKeyOrId, X_CONFIGCAT_SDKKEY); + return localVarResp.getData(); + } + + /** + * Get value + * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. The most important fields in the response are the `defaultValue`, `targetingRules`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used at the [percentage evaluation](https://configcat.com/docs/advanced/targeting/#anatomy-of-the-percentage-based-targeting) of the Feature Flag or Setting. + * @param settingKeyOrId The key or id of the Setting. (required) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @return ApiResponse<SettingFormulaModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getSettingValueBySdkkeyV2WithHttpInfo(String settingKeyOrId, String X_CONFIGCAT_SDKKEY) throws ApiException { + okhttp3.Call localVarCall = getSettingValueBySdkkeyV2ValidateBeforeCall(settingKeyOrId, X_CONFIGCAT_SDKKEY, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get value (asynchronously) + * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. The most important fields in the response are the `defaultValue`, `targetingRules`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used at the [percentage evaluation](https://configcat.com/docs/advanced/targeting/#anatomy-of-the-percentage-based-targeting) of the Feature Flag or Setting. + * @param settingKeyOrId The key or id of the Setting. (required) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSettingValueBySdkkeyV2Async(String settingKeyOrId, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getSettingValueBySdkkeyV2ValidateBeforeCall(settingKeyOrId, X_CONFIGCAT_SDKKEY, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for replaceSettingValueBySdkkeyV2 + * @param settingKeyOrId The key or id of the Setting. (required) + * @param updateEvaluationFormulaModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call replaceSettingValueBySdkkeyV2Call(String settingKeyOrId, UpdateEvaluationFormulaModel updateEvaluationFormulaModel, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateEvaluationFormulaModel; + + // create path and map variables + String localVarPath = "/v2/settings/{settingKeyOrId}/value" + .replace("{" + "settingKeyOrId" + "}", localVarApiClient.escapeString(settingKeyOrId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (reason != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); + } + + if (X_CONFIGCAT_SDKKEY != null) { + localVarHeaderParams.put("X-CONFIGCAT-SDKKEY", localVarApiClient.parameterToString(X_CONFIGCAT_SDKKEY)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call replaceSettingValueBySdkkeyV2ValidateBeforeCall(String settingKeyOrId, UpdateEvaluationFormulaModel updateEvaluationFormulaModel, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settingKeyOrId' is set + if (settingKeyOrId == null) { + throw new ApiException("Missing the required parameter 'settingKeyOrId' when calling replaceSettingValueBySdkkeyV2(Async)"); + } + + // verify the required parameter 'updateEvaluationFormulaModel' is set + if (updateEvaluationFormulaModel == null) { + throw new ApiException("Missing the required parameter 'updateEvaluationFormulaModel' when calling replaceSettingValueBySdkkeyV2(Async)"); + } + + return replaceSettingValueBySdkkeyV2Call(settingKeyOrId, updateEvaluationFormulaModel, reason, X_CONFIGCAT_SDKKEY, _callback); + + } + + /** + * Replace value + * This endpoint replaces the value and the Targeting Rules of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other field that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send a replace request body as below: ```json { \"defaultValue\": { \"boolValue\": true } } ``` Then besides that the default served value is set to `true`, all the Targeting Rules are deleted. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": true }, \"targetingRules\": [] } ``` + * @param settingKeyOrId The key or id of the Setting. (required) + * @param updateEvaluationFormulaModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @return SettingFormulaModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public SettingFormulaModel replaceSettingValueBySdkkeyV2(String settingKeyOrId, UpdateEvaluationFormulaModel updateEvaluationFormulaModel, String reason, String X_CONFIGCAT_SDKKEY) throws ApiException { + ApiResponse localVarResp = replaceSettingValueBySdkkeyV2WithHttpInfo(settingKeyOrId, updateEvaluationFormulaModel, reason, X_CONFIGCAT_SDKKEY); + return localVarResp.getData(); + } + + /** + * Replace value + * This endpoint replaces the value and the Targeting Rules of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other field that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send a replace request body as below: ```json { \"defaultValue\": { \"boolValue\": true } } ``` Then besides that the default served value is set to `true`, all the Targeting Rules are deleted. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": true }, \"targetingRules\": [] } ``` + * @param settingKeyOrId The key or id of the Setting. (required) + * @param updateEvaluationFormulaModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @return ApiResponse<SettingFormulaModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse replaceSettingValueBySdkkeyV2WithHttpInfo(String settingKeyOrId, UpdateEvaluationFormulaModel updateEvaluationFormulaModel, String reason, String X_CONFIGCAT_SDKKEY) throws ApiException { + okhttp3.Call localVarCall = replaceSettingValueBySdkkeyV2ValidateBeforeCall(settingKeyOrId, updateEvaluationFormulaModel, reason, X_CONFIGCAT_SDKKEY, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Replace value (asynchronously) + * This endpoint replaces the value and the Targeting Rules of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other field that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send a replace request body as below: ```json { \"defaultValue\": { \"boolValue\": true } } ``` Then besides that the default served value is set to `true`, all the Targeting Rules are deleted. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": true }, \"targetingRules\": [] } ``` + * @param settingKeyOrId The key or id of the Setting. (required) + * @param updateEvaluationFormulaModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call replaceSettingValueBySdkkeyV2Async(String settingKeyOrId, UpdateEvaluationFormulaModel updateEvaluationFormulaModel, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = replaceSettingValueBySdkkeyV2ValidateBeforeCall(settingKeyOrId, updateEvaluationFormulaModel, reason, X_CONFIGCAT_SDKKEY, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateSettingValueBySdkkeyV2 + * @param settingKeyOrId The key or id of the Setting. (required) + * @param jsonPatchOperation (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateSettingValueBySdkkeyV2Call(String settingKeyOrId, List jsonPatchOperation, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = jsonPatchOperation; + + // create path and map variables + String localVarPath = "/v2/settings/{settingKeyOrId}/value" + .replace("{" + "settingKeyOrId" + "}", localVarApiClient.escapeString(settingKeyOrId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (reason != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); + } + + if (X_CONFIGCAT_SDKKEY != null) { + localVarHeaderParams.put("X-CONFIGCAT-SDKKEY", localVarApiClient.parameterToString(X_CONFIGCAT_SDKKEY)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateSettingValueBySdkkeyV2ValidateBeforeCall(String settingKeyOrId, List jsonPatchOperation, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settingKeyOrId' is set + if (settingKeyOrId == null) { + throw new ApiException("Missing the required parameter 'settingKeyOrId' when calling updateSettingValueBySdkkeyV2(Async)"); + } + + // verify the required parameter 'jsonPatchOperation' is set + if (jsonPatchOperation == null) { + throw new ApiException("Missing the required parameter 'jsonPatchOperation' when calling updateSettingValueBySdkkeyV2(Async)"); + } + + return updateSettingValueBySdkkeyV2Call(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY, _callback); + + } + + /** + * Update value + * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/targetingRules/0/value/boolValue\", \"value\": true } ] ``` Only the first Targeting Rule's `value` is going to be set to `false` and all the other fields are remaining unchanged. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": false } } ] } ``` + * @param settingKeyOrId The key or id of the Setting. (required) + * @param jsonPatchOperation (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @return SettingFormulaModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public SettingFormulaModel updateSettingValueBySdkkeyV2(String settingKeyOrId, List jsonPatchOperation, String reason, String X_CONFIGCAT_SDKKEY) throws ApiException { + ApiResponse localVarResp = updateSettingValueBySdkkeyV2WithHttpInfo(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY); + return localVarResp.getData(); + } + + /** + * Update value + * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/targetingRules/0/value/boolValue\", \"value\": true } ] ``` Only the first Targeting Rule's `value` is going to be set to `false` and all the other fields are remaining unchanged. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": false } } ] } ``` + * @param settingKeyOrId The key or id of the Setting. (required) + * @param jsonPatchOperation (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @return ApiResponse<SettingFormulaModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse updateSettingValueBySdkkeyV2WithHttpInfo(String settingKeyOrId, List jsonPatchOperation, String reason, String X_CONFIGCAT_SDKKEY) throws ApiException { + okhttp3.Call localVarCall = updateSettingValueBySdkkeyV2ValidateBeforeCall(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update value (asynchronously) + * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/targetingRules/0/value/boolValue\", \"value\": true } ] ``` Only the first Targeting Rule's `value` is going to be set to `false` and all the other fields are remaining unchanged. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": false } } ] } ``` + * @param settingKeyOrId The key or id of the Setting. (required) + * @param jsonPatchOperation (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param X_CONFIGCAT_SDKKEY The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateSettingValueBySdkkeyV2Async(String settingKeyOrId, List jsonPatchOperation, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateSettingValueBySdkkeyV2ValidateBeforeCall(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesV2Api.java b/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesV2Api.java new file mode 100644 index 0000000..9009b3d --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesV2Api.java @@ -0,0 +1,869 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.api; + +import com.configcat.publicapi.java.client.ApiCallback; +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.ApiResponse; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ProgressRequestBody; +import com.configcat.publicapi.java.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.configcat.publicapi.java.client.model.ConfigSettingFormulasModel; +import com.configcat.publicapi.java.client.model.JsonPatchOperation; +import com.configcat.publicapi.java.client.model.SettingFormulaModel; +import java.util.UUID; +import com.configcat.publicapi.java.client.model.UpdateEvaluationFormulaModel; +import com.configcat.publicapi.java.client.model.UpdateEvaluationFormulasModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class FeatureFlagSettingValuesV2Api { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public FeatureFlagSettingValuesV2Api() { + this(Configuration.getDefaultApiClient()); + } + + public FeatureFlagSettingValuesV2Api(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getSettingValueV2 + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the setting value data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSettingValueV2Call(UUID environmentId, Integer settingId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v2/environments/{environmentId}/settings/{settingId}/value" + .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())) + .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSettingValueV2ValidateBeforeCall(UUID environmentId, Integer settingId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'environmentId' is set + if (environmentId == null) { + throw new ApiException("Missing the required parameter 'environmentId' when calling getSettingValueV2(Async)"); + } + + // verify the required parameter 'settingId' is set + if (settingId == null) { + throw new ApiException("Missing the required parameter 'settingId' when calling getSettingValueV2(Async)"); + } + + return getSettingValueV2Call(environmentId, settingId, _callback); + + } + + /** + * Get value + * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the `environmentId` parameter. The most important fields in the response are the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used for [percentage evaluation](https://configcat.com/docs/targeting/percentage-options/) of the Feature Flag or Setting. + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @return SettingFormulaModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the setting value data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public SettingFormulaModel getSettingValueV2(UUID environmentId, Integer settingId) throws ApiException { + ApiResponse localVarResp = getSettingValueV2WithHttpInfo(environmentId, settingId); + return localVarResp.getData(); + } + + /** + * Get value + * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the `environmentId` parameter. The most important fields in the response are the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used for [percentage evaluation](https://configcat.com/docs/targeting/percentage-options/) of the Feature Flag or Setting. + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @return ApiResponse<SettingFormulaModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the setting value data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getSettingValueV2WithHttpInfo(UUID environmentId, Integer settingId) throws ApiException { + okhttp3.Call localVarCall = getSettingValueV2ValidateBeforeCall(environmentId, settingId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get value (asynchronously) + * This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the `environmentId` parameter. The most important fields in the response are the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used for [percentage evaluation](https://configcat.com/docs/targeting/percentage-options/) of the Feature Flag or Setting. + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the setting value data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSettingValueV2Async(UUID environmentId, Integer settingId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getSettingValueV2ValidateBeforeCall(environmentId, settingId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getSettingValuesV2 + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSettingValuesV2Call(UUID configId, UUID environmentId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v2/configs/{configId}/environments/{environmentId}/values" + .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())) + .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSettingValuesV2ValidateBeforeCall(UUID configId, UUID environmentId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'configId' is set + if (configId == null) { + throw new ApiException("Missing the required parameter 'configId' when calling getSettingValuesV2(Async)"); + } + + // verify the required parameter 'environmentId' is set + if (environmentId == null) { + throw new ApiException("Missing the required parameter 'environmentId' when calling getSettingValuesV2(Async)"); + } + + return getSettingValuesV2Call(configId, environmentId, _callback); + + } + + /** + * Get values + * This endpoint returns all Feature Flag and Setting values of a Config identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. The most important fields in the response are the `defaultValue`, `targetingRules`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used for [percentage evaluation](https://configcat.com/docs/targeting/percentage-options/) of the Feature Flag or Setting. + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @return ConfigSettingFormulasModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ConfigSettingFormulasModel getSettingValuesV2(UUID configId, UUID environmentId) throws ApiException { + ApiResponse localVarResp = getSettingValuesV2WithHttpInfo(configId, environmentId); + return localVarResp.getData(); + } + + /** + * Get values + * This endpoint returns all Feature Flag and Setting values of a Config identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. The most important fields in the response are the `defaultValue`, `targetingRules`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used for [percentage evaluation](https://configcat.com/docs/targeting/percentage-options/) of the Feature Flag or Setting. + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @return ApiResponse<ConfigSettingFormulasModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getSettingValuesV2WithHttpInfo(UUID configId, UUID environmentId) throws ApiException { + okhttp3.Call localVarCall = getSettingValuesV2ValidateBeforeCall(configId, environmentId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get values (asynchronously) + * This endpoint returns all Feature Flag and Setting values of a Config identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. The most important fields in the response are the `defaultValue`, `targetingRules`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an **ordered** collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules [here](https://configcat.com/docs/targeting/targeting-overview/). The `percentageEvaluationAttribute` represents the custom [User Object](https://configcat.com/docs/targeting/user-object/) attribute that must be used for [percentage evaluation](https://configcat.com/docs/targeting/percentage-options/) of the Feature Flag or Setting. + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSettingValuesV2Async(UUID configId, UUID environmentId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getSettingValuesV2ValidateBeforeCall(configId, environmentId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for postSettingValuesV2 + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @param updateEvaluationFormulasModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the updated setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call postSettingValuesV2Call(UUID configId, UUID environmentId, UpdateEvaluationFormulasModel updateEvaluationFormulasModel, String reason, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateEvaluationFormulasModel; + + // create path and map variables + String localVarPath = "/v2/configs/{configId}/environments/{environmentId}/values" + .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())) + .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (reason != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call postSettingValuesV2ValidateBeforeCall(UUID configId, UUID environmentId, UpdateEvaluationFormulasModel updateEvaluationFormulasModel, String reason, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'configId' is set + if (configId == null) { + throw new ApiException("Missing the required parameter 'configId' when calling postSettingValuesV2(Async)"); + } + + // verify the required parameter 'environmentId' is set + if (environmentId == null) { + throw new ApiException("Missing the required parameter 'environmentId' when calling postSettingValuesV2(Async)"); + } + + // verify the required parameter 'updateEvaluationFormulasModel' is set + if (updateEvaluationFormulasModel == null) { + throw new ApiException("Missing the required parameter 'updateEvaluationFormulasModel' when calling postSettingValuesV2(Async)"); + } + + return postSettingValuesV2Call(configId, environmentId, updateEvaluationFormulasModel, reason, _callback); + + } + + /** + * Post values + * This endpoint batch updates the Feature Flags and Settings of a Config identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. Only those Feature Flags and Settings are updated which are part of the request, all the others are left untouched. **Important:** As this endpoint is doing a complete replace on those Feature Flags and Settings, which are set in the request. It's important to set every other field that you don't want to change in its original state. Not listing a field means that it will reset. For example: We have the following resource of a Feature Flag. ```json { \"settingFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ], \"settingId\": 1 } ] } ``` If we send a batch replace request body as below: ```json { \"updateFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"settingId\": 1 } ] } ``` Then besides that the default value is set to `true`, all Targeting Rules of the related Feature Flag are deleted. So we get a response like this: ```json { \"settingFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [], \"setting\": { \"settingId\": 1 } } ] } ``` + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @param updateEvaluationFormulasModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @return ConfigSettingFormulasModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the updated setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ConfigSettingFormulasModel postSettingValuesV2(UUID configId, UUID environmentId, UpdateEvaluationFormulasModel updateEvaluationFormulasModel, String reason) throws ApiException { + ApiResponse localVarResp = postSettingValuesV2WithHttpInfo(configId, environmentId, updateEvaluationFormulasModel, reason); + return localVarResp.getData(); + } + + /** + * Post values + * This endpoint batch updates the Feature Flags and Settings of a Config identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. Only those Feature Flags and Settings are updated which are part of the request, all the others are left untouched. **Important:** As this endpoint is doing a complete replace on those Feature Flags and Settings, which are set in the request. It's important to set every other field that you don't want to change in its original state. Not listing a field means that it will reset. For example: We have the following resource of a Feature Flag. ```json { \"settingFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ], \"settingId\": 1 } ] } ``` If we send a batch replace request body as below: ```json { \"updateFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"settingId\": 1 } ] } ``` Then besides that the default value is set to `true`, all Targeting Rules of the related Feature Flag are deleted. So we get a response like this: ```json { \"settingFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [], \"setting\": { \"settingId\": 1 } } ] } ``` + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @param updateEvaluationFormulasModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @return ApiResponse<ConfigSettingFormulasModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the updated setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse postSettingValuesV2WithHttpInfo(UUID configId, UUID environmentId, UpdateEvaluationFormulasModel updateEvaluationFormulasModel, String reason) throws ApiException { + okhttp3.Call localVarCall = postSettingValuesV2ValidateBeforeCall(configId, environmentId, updateEvaluationFormulasModel, reason, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Post values (asynchronously) + * This endpoint batch updates the Feature Flags and Settings of a Config identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. Only those Feature Flags and Settings are updated which are part of the request, all the others are left untouched. **Important:** As this endpoint is doing a complete replace on those Feature Flags and Settings, which are set in the request. It's important to set every other field that you don't want to change in its original state. Not listing a field means that it will reset. For example: We have the following resource of a Feature Flag. ```json { \"settingFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ], \"settingId\": 1 } ] } ``` If we send a batch replace request body as below: ```json { \"updateFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"settingId\": 1 } ] } ``` Then besides that the default value is set to `true`, all Targeting Rules of the related Feature Flag are deleted. So we get a response like this: ```json { \"settingFormulas\": [ { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [], \"setting\": { \"settingId\": 1 } } ] } ``` + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @param updateEvaluationFormulasModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the updated setting values returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call postSettingValuesV2Async(UUID configId, UUID environmentId, UpdateEvaluationFormulasModel updateEvaluationFormulasModel, String reason, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = postSettingValuesV2ValidateBeforeCall(configId, environmentId, updateEvaluationFormulasModel, reason, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for replaceSettingValueV2 + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param updateEvaluationFormulaModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call replaceSettingValueV2Call(UUID environmentId, Integer settingId, UpdateEvaluationFormulaModel updateEvaluationFormulaModel, String reason, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateEvaluationFormulaModel; + + // create path and map variables + String localVarPath = "/v2/environments/{environmentId}/settings/{settingId}/value" + .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())) + .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (reason != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call replaceSettingValueV2ValidateBeforeCall(UUID environmentId, Integer settingId, UpdateEvaluationFormulaModel updateEvaluationFormulaModel, String reason, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'environmentId' is set + if (environmentId == null) { + throw new ApiException("Missing the required parameter 'environmentId' when calling replaceSettingValueV2(Async)"); + } + + // verify the required parameter 'settingId' is set + if (settingId == null) { + throw new ApiException("Missing the required parameter 'settingId' when calling replaceSettingValueV2(Async)"); + } + + // verify the required parameter 'updateEvaluationFormulaModel' is set + if (updateEvaluationFormulaModel == null) { + throw new ApiException("Missing the required parameter 'updateEvaluationFormulaModel' when calling replaceSettingValueV2(Async)"); + } + + return replaceSettingValueV2Call(environmentId, settingId, updateEvaluationFormulaModel, reason, _callback); + + } + + /** + * Replace value + * This endpoint replaces the value and the Targeting Rules of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other field that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send a replace request body as below: ```json { \"defaultValue\": { \"boolValue\": true } } ``` Then besides that the default served value is set to `true`, all the Targeting Rules are deleted. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": true }, \"targetingRules\": [] } ``` + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param updateEvaluationFormulaModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @return SettingFormulaModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public SettingFormulaModel replaceSettingValueV2(UUID environmentId, Integer settingId, UpdateEvaluationFormulaModel updateEvaluationFormulaModel, String reason) throws ApiException { + ApiResponse localVarResp = replaceSettingValueV2WithHttpInfo(environmentId, settingId, updateEvaluationFormulaModel, reason); + return localVarResp.getData(); + } + + /** + * Replace value + * This endpoint replaces the value and the Targeting Rules of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other field that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send a replace request body as below: ```json { \"defaultValue\": { \"boolValue\": true } } ``` Then besides that the default served value is set to `true`, all the Targeting Rules are deleted. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": true }, \"targetingRules\": [] } ``` + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param updateEvaluationFormulaModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @return ApiResponse<SettingFormulaModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse replaceSettingValueV2WithHttpInfo(UUID environmentId, Integer settingId, UpdateEvaluationFormulaModel updateEvaluationFormulaModel, String reason) throws ApiException { + okhttp3.Call localVarCall = replaceSettingValueV2ValidateBeforeCall(environmentId, settingId, updateEvaluationFormulaModel, reason, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Replace value (asynchronously) + * This endpoint replaces the value and the Targeting Rules of a Feature Flag or Setting in a specified Environment identified by the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. **Important:** As this endpoint is doing a complete replace, it's important to set every other field that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send a replace request body as below: ```json { \"defaultValue\": { \"boolValue\": true } } ``` Then besides that the default served value is set to `true`, all the Targeting Rules are deleted. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": true }, \"targetingRules\": [] } ``` + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param updateEvaluationFormulaModel (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call replaceSettingValueV2Async(UUID environmentId, Integer settingId, UpdateEvaluationFormulaModel updateEvaluationFormulaModel, String reason, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = replaceSettingValueV2ValidateBeforeCall(environmentId, settingId, updateEvaluationFormulaModel, reason, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateSettingValueV2 + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param jsonPatchOperation (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 When the patch was successful. -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateSettingValueV2Call(UUID environmentId, Integer settingId, List jsonPatchOperation, String reason, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = jsonPatchOperation; + + // create path and map variables + String localVarPath = "/v2/environments/{environmentId}/settings/{settingId}/value" + .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())) + .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (reason != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateSettingValueV2ValidateBeforeCall(UUID environmentId, Integer settingId, List jsonPatchOperation, String reason, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'environmentId' is set + if (environmentId == null) { + throw new ApiException("Missing the required parameter 'environmentId' when calling updateSettingValueV2(Async)"); + } + + // verify the required parameter 'settingId' is set + if (settingId == null) { + throw new ApiException("Missing the required parameter 'settingId' when calling updateSettingValueV2(Async)"); + } + + // verify the required parameter 'jsonPatchOperation' is set + if (jsonPatchOperation == null) { + throw new ApiException("Missing the required parameter 'jsonPatchOperation' when calling updateSettingValueV2(Async)"); + } + + return updateSettingValueV2Call(environmentId, settingId, jsonPatchOperation, reason, _callback); + + } + + /** + * Update value + * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/targetingRules/0/value/boolValue\", \"value\": true } ] ``` Only the first Targeting Rule's `value` is going to be set to `false` and all the other fields are remaining unchanged. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": false } } ] } ``` + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param jsonPatchOperation (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @return SettingFormulaModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 When the patch was successful. -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public SettingFormulaModel updateSettingValueV2(UUID environmentId, Integer settingId, List jsonPatchOperation, String reason) throws ApiException { + ApiResponse localVarResp = updateSettingValueV2WithHttpInfo(environmentId, settingId, jsonPatchOperation, reason); + return localVarResp.getData(); + } + + /** + * Update value + * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/targetingRules/0/value/boolValue\", \"value\": true } ] ``` Only the first Targeting Rule's `value` is going to be set to `false` and all the other fields are remaining unchanged. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": false } } ] } ``` + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param jsonPatchOperation (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @return ApiResponse<SettingFormulaModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 When the patch was successful. -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse updateSettingValueV2WithHttpInfo(UUID environmentId, Integer settingId, List jsonPatchOperation, String reason) throws ApiException { + okhttp3.Call localVarCall = updateSettingValueV2ValidateBeforeCall(environmentId, settingId, jsonPatchOperation, reason, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update value (asynchronously) + * This endpoint updates the value of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Environment. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource of a Feature Flag. ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": true } } ] } ``` If we send an update request body as below: ```json [ { \"op\": \"replace\", \"path\": \"/targetingRules/0/value/boolValue\", \"value\": true } ] ``` Only the first Targeting Rule's `value` is going to be set to `false` and all the other fields are remaining unchanged. So we get a response like this: ```json { \"defaultValue\": { \"boolValue\": false }, \"targetingRules\": [ { \"conditions\": [ { \"userCondition\": { \"comparisonAttribute\": \"Email\", \"comparator\": \"sensitiveTextEquals\", \"comparisonValue\": { \"stringValue\": \"test@example.com\" } } } ], \"percentageOptions\": [], \"value\": { \"boolValue\": false } } ] } ``` + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param jsonPatchOperation (required) + * @param reason The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 When the patch was successful. -
204 When no change applied on the resource. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateSettingValueV2Async(UUID environmentId, Integer settingId, List jsonPatchOperation, String reason, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateSettingValueV2ValidateBeforeCall(environmentId, settingId, jsonPatchOperation, reason, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagsSettingsApi.java b/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagsSettingsApi.java new file mode 100644 index 0000000..1618212 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagsSettingsApi.java @@ -0,0 +1,920 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.api; + +import com.configcat.publicapi.java.client.ApiCallback; +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.ApiResponse; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ProgressRequestBody; +import com.configcat.publicapi.java.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.configcat.publicapi.java.client.model.CreateSettingInitialValues; +import com.configcat.publicapi.java.client.model.JsonPatchOperation; +import com.configcat.publicapi.java.client.model.ReplaceSettingModel; +import com.configcat.publicapi.java.client.model.SettingModel; +import java.util.UUID; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class FeatureFlagsSettingsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public FeatureFlagsSettingsApi() { + this(Configuration.getDefaultApiClient()); + } + + public FeatureFlagsSettingsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createSetting + * @param configId The identifier of the Config. (required) + * @param createSettingInitialValues (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call createSettingCall(UUID configId, CreateSettingInitialValues createSettingInitialValues, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createSettingInitialValues; + + // create path and map variables + String localVarPath = "/v1/configs/{configId}/settings" + .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createSettingValidateBeforeCall(UUID configId, CreateSettingInitialValues createSettingInitialValues, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'configId' is set + if (configId == null) { + throw new ApiException("Missing the required parameter 'configId' when calling createSetting(Async)"); + } + + // verify the required parameter 'createSettingInitialValues' is set + if (createSettingInitialValues == null) { + throw new ApiException("Missing the required parameter 'createSettingInitialValues' when calling createSetting(Async)"); + } + + return createSettingCall(configId, createSettingInitialValues, _callback); + + } + + /** + * Create Flag + * This endpoint creates a new Feature Flag or Setting in a specified Config identified by the `configId` parameter. **Important:** The `key` attribute must be unique within the given Config. + * @param configId The identifier of the Config. (required) + * @param createSettingInitialValues (required) + * @return SettingModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public SettingModel createSetting(UUID configId, CreateSettingInitialValues createSettingInitialValues) throws ApiException { + ApiResponse localVarResp = createSettingWithHttpInfo(configId, createSettingInitialValues); + return localVarResp.getData(); + } + + /** + * Create Flag + * This endpoint creates a new Feature Flag or Setting in a specified Config identified by the `configId` parameter. **Important:** The `key` attribute must be unique within the given Config. + * @param configId The identifier of the Config. (required) + * @param createSettingInitialValues (required) + * @return ApiResponse<SettingModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse createSettingWithHttpInfo(UUID configId, CreateSettingInitialValues createSettingInitialValues) throws ApiException { + okhttp3.Call localVarCall = createSettingValidateBeforeCall(configId, createSettingInitialValues, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Flag (asynchronously) + * This endpoint creates a new Feature Flag or Setting in a specified Config identified by the `configId` parameter. **Important:** The `key` attribute must be unique within the given Config. + * @param configId The identifier of the Config. (required) + * @param createSettingInitialValues (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call createSettingAsync(UUID configId, CreateSettingInitialValues createSettingInitialValues, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createSettingValidateBeforeCall(configId, createSettingInitialValues, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteSetting + * @param settingId The identifier of the Setting. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteSettingCall(Integer settingId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/settings/{settingId}" + .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteSettingValidateBeforeCall(Integer settingId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settingId' is set + if (settingId == null) { + throw new ApiException("Missing the required parameter 'settingId' when calling deleteSetting(Async)"); + } + + return deleteSettingCall(settingId, _callback); + + } + + /** + * Delete Flag + * This endpoint removes a Feature Flag or Setting from a specified Config, identified by the `configId` parameter. + * @param settingId The identifier of the Setting. (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public void deleteSetting(Integer settingId) throws ApiException { + deleteSettingWithHttpInfo(settingId); + } + + /** + * Delete Flag + * This endpoint removes a Feature Flag or Setting from a specified Config, identified by the `configId` parameter. + * @param settingId The identifier of the Setting. (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse deleteSettingWithHttpInfo(Integer settingId) throws ApiException { + okhttp3.Call localVarCall = deleteSettingValidateBeforeCall(settingId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete Flag (asynchronously) + * This endpoint removes a Feature Flag or Setting from a specified Config, identified by the `configId` parameter. + * @param settingId The identifier of the Setting. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteSettingAsync(Integer settingId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteSettingValidateBeforeCall(settingId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getSetting + * @param settingId The identifier of the Setting. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the setting data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSettingCall(Integer settingId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/settings/{settingId}" + .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSettingValidateBeforeCall(Integer settingId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settingId' is set + if (settingId == null) { + throw new ApiException("Missing the required parameter 'settingId' when calling getSetting(Async)"); + } + + return getSettingCall(settingId, _callback); + + } + + /** + * Get Flag + * This endpoint returns the metadata attributes of a Feature Flag or Setting identified by the `settingId` parameter. + * @param settingId The identifier of the Setting. (required) + * @return SettingModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the setting data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public SettingModel getSetting(Integer settingId) throws ApiException { + ApiResponse localVarResp = getSettingWithHttpInfo(settingId); + return localVarResp.getData(); + } + + /** + * Get Flag + * This endpoint returns the metadata attributes of a Feature Flag or Setting identified by the `settingId` parameter. + * @param settingId The identifier of the Setting. (required) + * @return ApiResponse<SettingModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the setting data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getSettingWithHttpInfo(Integer settingId) throws ApiException { + okhttp3.Call localVarCall = getSettingValidateBeforeCall(settingId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Flag (asynchronously) + * This endpoint returns the metadata attributes of a Feature Flag or Setting identified by the `settingId` parameter. + * @param settingId The identifier of the Setting. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the setting data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSettingAsync(Integer settingId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getSettingValidateBeforeCall(settingId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getSettings + * @param configId The identifier of the Config. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSettingsCall(UUID configId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/configs/{configId}/settings" + .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSettingsValidateBeforeCall(UUID configId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'configId' is set + if (configId == null) { + throw new ApiException("Missing the required parameter 'configId' when calling getSettings(Async)"); + } + + return getSettingsCall(configId, _callback); + + } + + /** + * List Flags + * This endpoint returns the list of the Feature Flags and Settings defined in a specified Config, identified by the `configId` parameter. + * @param configId The identifier of the Config. (required) + * @return List<SettingModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public List getSettings(UUID configId) throws ApiException { + ApiResponse> localVarResp = getSettingsWithHttpInfo(configId); + return localVarResp.getData(); + } + + /** + * List Flags + * This endpoint returns the list of the Feature Flags and Settings defined in a specified Config, identified by the `configId` parameter. + * @param configId The identifier of the Config. (required) + * @return ApiResponse<List<SettingModel>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse> getSettingsWithHttpInfo(UUID configId) throws ApiException { + okhttp3.Call localVarCall = getSettingsValidateBeforeCall(configId, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Flags (asynchronously) + * This endpoint returns the list of the Feature Flags and Settings defined in a specified Config, identified by the `configId` parameter. + * @param configId The identifier of the Config. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSettingsAsync(UUID configId, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getSettingsValidateBeforeCall(configId, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for replaceSetting + * @param settingId The identifier of the Setting. (required) + * @param replaceSettingModel (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the replace was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call replaceSettingCall(Integer settingId, ReplaceSettingModel replaceSettingModel, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = replaceSettingModel; + + // create path and map variables + String localVarPath = "/v1/settings/{settingId}" + .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call replaceSettingValidateBeforeCall(Integer settingId, ReplaceSettingModel replaceSettingModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settingId' is set + if (settingId == null) { + throw new ApiException("Missing the required parameter 'settingId' when calling replaceSetting(Async)"); + } + + // verify the required parameter 'replaceSettingModel' is set + if (replaceSettingModel == null) { + throw new ApiException("Missing the required parameter 'replaceSettingModel' when calling replaceSetting(Async)"); + } + + return replaceSettingCall(settingId, replaceSettingModel, _callback); + + } + + /** + * Replace Flag + * This endpoint replaces the whole value of a Feature Flag or Setting identified by the `settingId` parameter. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. + * @param settingId The identifier of the Setting. (required) + * @param replaceSettingModel (required) + * @return SettingModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the replace was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public SettingModel replaceSetting(Integer settingId, ReplaceSettingModel replaceSettingModel) throws ApiException { + ApiResponse localVarResp = replaceSettingWithHttpInfo(settingId, replaceSettingModel); + return localVarResp.getData(); + } + + /** + * Replace Flag + * This endpoint replaces the whole value of a Feature Flag or Setting identified by the `settingId` parameter. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. + * @param settingId The identifier of the Setting. (required) + * @param replaceSettingModel (required) + * @return ApiResponse<SettingModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the replace was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse replaceSettingWithHttpInfo(Integer settingId, ReplaceSettingModel replaceSettingModel) throws ApiException { + okhttp3.Call localVarCall = replaceSettingValidateBeforeCall(settingId, replaceSettingModel, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Replace Flag (asynchronously) + * This endpoint replaces the whole value of a Feature Flag or Setting identified by the `settingId` parameter. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. + * @param settingId The identifier of the Setting. (required) + * @param replaceSettingModel (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the replace was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call replaceSettingAsync(Integer settingId, ReplaceSettingModel replaceSettingModel, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = replaceSettingValidateBeforeCall(settingId, replaceSettingModel, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateSetting + * @param settingId The identifier of the Setting. (required) + * @param jsonPatchOperation (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateSettingCall(Integer settingId, List jsonPatchOperation, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = jsonPatchOperation; + + // create path and map variables + String localVarPath = "/v1/settings/{settingId}" + .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateSettingValidateBeforeCall(Integer settingId, List jsonPatchOperation, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settingId' is set + if (settingId == null) { + throw new ApiException("Missing the required parameter 'settingId' when calling updateSetting(Async)"); + } + + // verify the required parameter 'jsonPatchOperation' is set + if (jsonPatchOperation == null) { + throw new ApiException("Missing the required parameter 'jsonPatchOperation' when calling updateSetting(Async)"); + } + + return updateSettingCall(settingId, jsonPatchOperation, _callback); + + } + + /** + * Update Flag + * This endpoint updates the metadata of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Config. Only the `name`, `hint` and `tags` attributes are modifiable by this endpoint. The `tags` attribute is a simple collection of the [tag IDs](#operation/get-tags) attached to the given setting. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. For example: We have the following resource. ```json { \"settingId\": 5345, \"key\": \"myGrandFeature\", \"name\": \"Tihs is a naem with soem typos.\", \"hint\": \"This flag controls my grandioso feature.\", \"settingType\": \"boolean\", \"tags\": [ { \"tagId\": 0, \"name\": \"sample tag\", \"color\": \"whale\" } ] } ``` If we send an update request body as below (it changes the `name` and adds the already existing tag with the id `2`): ```json [ { \"op\": \"replace\", \"path\": \"/name\", \"value\": \"This is the name without typos.\" }, { \"op\": \"add\", \"path\": \"/tags/-\", \"value\": 2 } ] ``` Only the `name` and `tags` are updated and all the other attributes remain unchanged. So we get a response like this: ```json { \"settingId\": 5345, \"key\": \"myGrandFeature\", \"name\": \"This is the name without typos.\", \"hint\": \"This flag controls my grandioso feature.\", \"settingType\": \"boolean\", \"tags\": [ { \"tagId\": 0, \"name\": \"sample tag\", \"color\": \"whale\" }, { \"tagId\": 2, \"name\": \"another tag\", \"color\": \"koala\" } ] } ``` + * @param settingId The identifier of the Setting. (required) + * @param jsonPatchOperation (required) + * @return SettingModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public SettingModel updateSetting(Integer settingId, List jsonPatchOperation) throws ApiException { + ApiResponse localVarResp = updateSettingWithHttpInfo(settingId, jsonPatchOperation); + return localVarResp.getData(); + } + + /** + * Update Flag + * This endpoint updates the metadata of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Config. Only the `name`, `hint` and `tags` attributes are modifiable by this endpoint. The `tags` attribute is a simple collection of the [tag IDs](#operation/get-tags) attached to the given setting. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. For example: We have the following resource. ```json { \"settingId\": 5345, \"key\": \"myGrandFeature\", \"name\": \"Tihs is a naem with soem typos.\", \"hint\": \"This flag controls my grandioso feature.\", \"settingType\": \"boolean\", \"tags\": [ { \"tagId\": 0, \"name\": \"sample tag\", \"color\": \"whale\" } ] } ``` If we send an update request body as below (it changes the `name` and adds the already existing tag with the id `2`): ```json [ { \"op\": \"replace\", \"path\": \"/name\", \"value\": \"This is the name without typos.\" }, { \"op\": \"add\", \"path\": \"/tags/-\", \"value\": 2 } ] ``` Only the `name` and `tags` are updated and all the other attributes remain unchanged. So we get a response like this: ```json { \"settingId\": 5345, \"key\": \"myGrandFeature\", \"name\": \"This is the name without typos.\", \"hint\": \"This flag controls my grandioso feature.\", \"settingType\": \"boolean\", \"tags\": [ { \"tagId\": 0, \"name\": \"sample tag\", \"color\": \"whale\" }, { \"tagId\": 2, \"name\": \"another tag\", \"color\": \"koala\" } ] } ``` + * @param settingId The identifier of the Setting. (required) + * @param jsonPatchOperation (required) + * @return ApiResponse<SettingModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse updateSettingWithHttpInfo(Integer settingId, List jsonPatchOperation) throws ApiException { + okhttp3.Call localVarCall = updateSettingValidateBeforeCall(settingId, jsonPatchOperation, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Flag (asynchronously) + * This endpoint updates the metadata of a Feature Flag or Setting with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Config. Only the `name`, `hint` and `tags` attributes are modifiable by this endpoint. The `tags` attribute is a simple collection of the [tag IDs](#operation/get-tags) attached to the given setting. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. For example: We have the following resource. ```json { \"settingId\": 5345, \"key\": \"myGrandFeature\", \"name\": \"Tihs is a naem with soem typos.\", \"hint\": \"This flag controls my grandioso feature.\", \"settingType\": \"boolean\", \"tags\": [ { \"tagId\": 0, \"name\": \"sample tag\", \"color\": \"whale\" } ] } ``` If we send an update request body as below (it changes the `name` and adds the already existing tag with the id `2`): ```json [ { \"op\": \"replace\", \"path\": \"/name\", \"value\": \"This is the name without typos.\" }, { \"op\": \"add\", \"path\": \"/tags/-\", \"value\": 2 } ] ``` Only the `name` and `tags` are updated and all the other attributes remain unchanged. So we get a response like this: ```json { \"settingId\": 5345, \"key\": \"myGrandFeature\", \"name\": \"This is the name without typos.\", \"hint\": \"This flag controls my grandioso feature.\", \"settingType\": \"boolean\", \"tags\": [ { \"tagId\": 0, \"name\": \"sample tag\", \"color\": \"whale\" }, { \"tagId\": 2, \"name\": \"another tag\", \"color\": \"koala\" } ] } ``` + * @param settingId The identifier of the Setting. (required) + * @param jsonPatchOperation (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateSettingAsync(Integer settingId, List jsonPatchOperation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateSettingValidateBeforeCall(settingId, jsonPatchOperation, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/IntegrationLinksApi.java b/src/main/java/com/configcat/publicapi/java/client/api/IntegrationLinksApi.java new file mode 100644 index 0000000..21cff99 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/api/IntegrationLinksApi.java @@ -0,0 +1,845 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.api; + +import com.configcat.publicapi.java.client.ApiCallback; +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.ApiResponse; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ProgressRequestBody; +import com.configcat.publicapi.java.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.configcat.publicapi.java.client.model.AddOrUpdateIntegrationLinkModel; +import com.configcat.publicapi.java.client.model.AddOrUpdateJiraIntegrationLinkModel; +import com.configcat.publicapi.java.client.model.ConnectRequest; +import com.configcat.publicapi.java.client.model.DeleteIntegrationLinkModel; +import com.configcat.publicapi.java.client.model.IntegrationLinkDetailsModel; +import com.configcat.publicapi.java.client.model.IntegrationLinkModel; +import com.configcat.publicapi.java.client.model.IntegrationLinkType; +import java.util.UUID; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class IntegrationLinksApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public IntegrationLinksApi() { + this(Configuration.getDefaultApiClient()); + } + + public IntegrationLinksApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for addOrUpdateIntegrationLink + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param integrationLinkType The integration link's type. (required) + * @param key The key of the integration link. (required) + * @param addOrUpdateIntegrationLinkModel (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the integration link data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call addOrUpdateIntegrationLinkCall(UUID environmentId, Integer settingId, IntegrationLinkType integrationLinkType, String key, AddOrUpdateIntegrationLinkModel addOrUpdateIntegrationLinkModel, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = addOrUpdateIntegrationLinkModel; + + // create path and map variables + String localVarPath = "/v1/environments/{environmentId}/settings/{settingId}/integrationLinks/{integrationLinkType}/{key}" + .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())) + .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())) + .replace("{" + "integrationLinkType" + "}", localVarApiClient.escapeString(integrationLinkType.toString())) + .replace("{" + "key" + "}", localVarApiClient.escapeString(key.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call addOrUpdateIntegrationLinkValidateBeforeCall(UUID environmentId, Integer settingId, IntegrationLinkType integrationLinkType, String key, AddOrUpdateIntegrationLinkModel addOrUpdateIntegrationLinkModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'environmentId' is set + if (environmentId == null) { + throw new ApiException("Missing the required parameter 'environmentId' when calling addOrUpdateIntegrationLink(Async)"); + } + + // verify the required parameter 'settingId' is set + if (settingId == null) { + throw new ApiException("Missing the required parameter 'settingId' when calling addOrUpdateIntegrationLink(Async)"); + } + + // verify the required parameter 'integrationLinkType' is set + if (integrationLinkType == null) { + throw new ApiException("Missing the required parameter 'integrationLinkType' when calling addOrUpdateIntegrationLink(Async)"); + } + + // verify the required parameter 'key' is set + if (key == null) { + throw new ApiException("Missing the required parameter 'key' when calling addOrUpdateIntegrationLink(Async)"); + } + + return addOrUpdateIntegrationLinkCall(environmentId, settingId, integrationLinkType, key, addOrUpdateIntegrationLinkModel, _callback); + + } + + /** + * Add or update Integration link + * + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param integrationLinkType The integration link's type. (required) + * @param key The key of the integration link. (required) + * @param addOrUpdateIntegrationLinkModel (optional) + * @return IntegrationLinkModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the integration link data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public IntegrationLinkModel addOrUpdateIntegrationLink(UUID environmentId, Integer settingId, IntegrationLinkType integrationLinkType, String key, AddOrUpdateIntegrationLinkModel addOrUpdateIntegrationLinkModel) throws ApiException { + ApiResponse localVarResp = addOrUpdateIntegrationLinkWithHttpInfo(environmentId, settingId, integrationLinkType, key, addOrUpdateIntegrationLinkModel); + return localVarResp.getData(); + } + + /** + * Add or update Integration link + * + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param integrationLinkType The integration link's type. (required) + * @param key The key of the integration link. (required) + * @param addOrUpdateIntegrationLinkModel (optional) + * @return ApiResponse<IntegrationLinkModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the integration link data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse addOrUpdateIntegrationLinkWithHttpInfo(UUID environmentId, Integer settingId, IntegrationLinkType integrationLinkType, String key, AddOrUpdateIntegrationLinkModel addOrUpdateIntegrationLinkModel) throws ApiException { + okhttp3.Call localVarCall = addOrUpdateIntegrationLinkValidateBeforeCall(environmentId, settingId, integrationLinkType, key, addOrUpdateIntegrationLinkModel, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Add or update Integration link (asynchronously) + * + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param integrationLinkType The integration link's type. (required) + * @param key The key of the integration link. (required) + * @param addOrUpdateIntegrationLinkModel (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the integration link data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call addOrUpdateIntegrationLinkAsync(UUID environmentId, Integer settingId, IntegrationLinkType integrationLinkType, String key, AddOrUpdateIntegrationLinkModel addOrUpdateIntegrationLinkModel, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = addOrUpdateIntegrationLinkValidateBeforeCall(environmentId, settingId, integrationLinkType, key, addOrUpdateIntegrationLinkModel, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteIntegrationLink + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param integrationLinkType The integration's type. (required) + * @param key The key of the integration link. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteIntegrationLinkCall(UUID environmentId, Integer settingId, IntegrationLinkType integrationLinkType, String key, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/environments/{environmentId}/settings/{settingId}/integrationLinks/{integrationLinkType}/{key}" + .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())) + .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())) + .replace("{" + "integrationLinkType" + "}", localVarApiClient.escapeString(integrationLinkType.toString())) + .replace("{" + "key" + "}", localVarApiClient.escapeString(key.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteIntegrationLinkValidateBeforeCall(UUID environmentId, Integer settingId, IntegrationLinkType integrationLinkType, String key, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'environmentId' is set + if (environmentId == null) { + throw new ApiException("Missing the required parameter 'environmentId' when calling deleteIntegrationLink(Async)"); + } + + // verify the required parameter 'settingId' is set + if (settingId == null) { + throw new ApiException("Missing the required parameter 'settingId' when calling deleteIntegrationLink(Async)"); + } + + // verify the required parameter 'integrationLinkType' is set + if (integrationLinkType == null) { + throw new ApiException("Missing the required parameter 'integrationLinkType' when calling deleteIntegrationLink(Async)"); + } + + // verify the required parameter 'key' is set + if (key == null) { + throw new ApiException("Missing the required parameter 'key' when calling deleteIntegrationLink(Async)"); + } + + return deleteIntegrationLinkCall(environmentId, settingId, integrationLinkType, key, _callback); + + } + + /** + * Delete Integration link + * + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param integrationLinkType The integration's type. (required) + * @param key The key of the integration link. (required) + * @return DeleteIntegrationLinkModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public DeleteIntegrationLinkModel deleteIntegrationLink(UUID environmentId, Integer settingId, IntegrationLinkType integrationLinkType, String key) throws ApiException { + ApiResponse localVarResp = deleteIntegrationLinkWithHttpInfo(environmentId, settingId, integrationLinkType, key); + return localVarResp.getData(); + } + + /** + * Delete Integration link + * + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param integrationLinkType The integration's type. (required) + * @param key The key of the integration link. (required) + * @return ApiResponse<DeleteIntegrationLinkModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse deleteIntegrationLinkWithHttpInfo(UUID environmentId, Integer settingId, IntegrationLinkType integrationLinkType, String key) throws ApiException { + okhttp3.Call localVarCall = deleteIntegrationLinkValidateBeforeCall(environmentId, settingId, integrationLinkType, key, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Integration link (asynchronously) + * + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param integrationLinkType The integration's type. (required) + * @param key The key of the integration link. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteIntegrationLinkAsync(UUID environmentId, Integer settingId, IntegrationLinkType integrationLinkType, String key, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteIntegrationLinkValidateBeforeCall(environmentId, settingId, integrationLinkType, key, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getIntegrationLinkDetails + * @param integrationLinkType The integration link's type. (required) + * @param key The key of the integration link. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the details for the integration link returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getIntegrationLinkDetailsCall(IntegrationLinkType integrationLinkType, String key, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/integrationLink/{integrationLinkType}/{key}/details" + .replace("{" + "integrationLinkType" + "}", localVarApiClient.escapeString(integrationLinkType.toString())) + .replace("{" + "key" + "}", localVarApiClient.escapeString(key.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getIntegrationLinkDetailsValidateBeforeCall(IntegrationLinkType integrationLinkType, String key, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'integrationLinkType' is set + if (integrationLinkType == null) { + throw new ApiException("Missing the required parameter 'integrationLinkType' when calling getIntegrationLinkDetails(Async)"); + } + + // verify the required parameter 'key' is set + if (key == null) { + throw new ApiException("Missing the required parameter 'key' when calling getIntegrationLinkDetails(Async)"); + } + + return getIntegrationLinkDetailsCall(integrationLinkType, key, _callback); + + } + + /** + * Get Integration link + * + * @param integrationLinkType The integration link's type. (required) + * @param key The key of the integration link. (required) + * @return IntegrationLinkDetailsModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the details for the integration link returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public IntegrationLinkDetailsModel getIntegrationLinkDetails(IntegrationLinkType integrationLinkType, String key) throws ApiException { + ApiResponse localVarResp = getIntegrationLinkDetailsWithHttpInfo(integrationLinkType, key); + return localVarResp.getData(); + } + + /** + * Get Integration link + * + * @param integrationLinkType The integration link's type. (required) + * @param key The key of the integration link. (required) + * @return ApiResponse<IntegrationLinkDetailsModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the details for the integration link returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getIntegrationLinkDetailsWithHttpInfo(IntegrationLinkType integrationLinkType, String key) throws ApiException { + okhttp3.Call localVarCall = getIntegrationLinkDetailsValidateBeforeCall(integrationLinkType, key, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Integration link (asynchronously) + * + * @param integrationLinkType The integration link's type. (required) + * @param key The key of the integration link. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the details for the integration link returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getIntegrationLinkDetailsAsync(IntegrationLinkType integrationLinkType, String key, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getIntegrationLinkDetailsValidateBeforeCall(integrationLinkType, key, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for jiraAddOrUpdateIntegrationLink + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param key The key of the integration link. (required) + * @param addOrUpdateJiraIntegrationLinkModel (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the integration link data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call jiraAddOrUpdateIntegrationLinkCall(UUID environmentId, Integer settingId, String key, AddOrUpdateJiraIntegrationLinkModel addOrUpdateJiraIntegrationLinkModel, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = addOrUpdateJiraIntegrationLinkModel; + + // create path and map variables + String localVarPath = "/v1/jira/environments/{environmentId}/settings/{settingId}/integrationLinks/{key}" + .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())) + .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())) + .replace("{" + "key" + "}", localVarApiClient.escapeString(key.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call jiraAddOrUpdateIntegrationLinkValidateBeforeCall(UUID environmentId, Integer settingId, String key, AddOrUpdateJiraIntegrationLinkModel addOrUpdateJiraIntegrationLinkModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'environmentId' is set + if (environmentId == null) { + throw new ApiException("Missing the required parameter 'environmentId' when calling jiraAddOrUpdateIntegrationLink(Async)"); + } + + // verify the required parameter 'settingId' is set + if (settingId == null) { + throw new ApiException("Missing the required parameter 'settingId' when calling jiraAddOrUpdateIntegrationLink(Async)"); + } + + // verify the required parameter 'key' is set + if (key == null) { + throw new ApiException("Missing the required parameter 'key' when calling jiraAddOrUpdateIntegrationLink(Async)"); + } + + return jiraAddOrUpdateIntegrationLinkCall(environmentId, settingId, key, addOrUpdateJiraIntegrationLinkModel, _callback); + + } + + /** + * + * + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param key The key of the integration link. (required) + * @param addOrUpdateJiraIntegrationLinkModel (optional) + * @return IntegrationLinkModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the integration link data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public IntegrationLinkModel jiraAddOrUpdateIntegrationLink(UUID environmentId, Integer settingId, String key, AddOrUpdateJiraIntegrationLinkModel addOrUpdateJiraIntegrationLinkModel) throws ApiException { + ApiResponse localVarResp = jiraAddOrUpdateIntegrationLinkWithHttpInfo(environmentId, settingId, key, addOrUpdateJiraIntegrationLinkModel); + return localVarResp.getData(); + } + + /** + * + * + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param key The key of the integration link. (required) + * @param addOrUpdateJiraIntegrationLinkModel (optional) + * @return ApiResponse<IntegrationLinkModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the integration link data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse jiraAddOrUpdateIntegrationLinkWithHttpInfo(UUID environmentId, Integer settingId, String key, AddOrUpdateJiraIntegrationLinkModel addOrUpdateJiraIntegrationLinkModel) throws ApiException { + okhttp3.Call localVarCall = jiraAddOrUpdateIntegrationLinkValidateBeforeCall(environmentId, settingId, key, addOrUpdateJiraIntegrationLinkModel, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param environmentId The identifier of the Environment. (required) + * @param settingId The id of the Setting. (required) + * @param key The key of the integration link. (required) + * @param addOrUpdateJiraIntegrationLinkModel (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the integration link data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call jiraAddOrUpdateIntegrationLinkAsync(UUID environmentId, Integer settingId, String key, AddOrUpdateJiraIntegrationLinkModel addOrUpdateJiraIntegrationLinkModel, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = jiraAddOrUpdateIntegrationLinkValidateBeforeCall(environmentId, settingId, key, addOrUpdateJiraIntegrationLinkModel, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for jiraConnect + * @param connectRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call jiraConnectCall(ConnectRequest connectRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = connectRequest; + + // create path and map variables + String localVarPath = "/v1/jira/connect"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call jiraConnectValidateBeforeCall(ConnectRequest connectRequest, final ApiCallback _callback) throws ApiException { + return jiraConnectCall(connectRequest, _callback); + + } + + /** + * + * + * @param connectRequest (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public void jiraConnect(ConnectRequest connectRequest) throws ApiException { + jiraConnectWithHttpInfo(connectRequest); + } + + /** + * + * + * @param connectRequest (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse jiraConnectWithHttpInfo(ConnectRequest connectRequest) throws ApiException { + okhttp3.Call localVarCall = jiraConnectValidateBeforeCall(connectRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param connectRequest (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call jiraConnectAsync(ConnectRequest connectRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = jiraConnectValidateBeforeCall(connectRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/IntegrationsApi.java b/src/main/java/com/configcat/publicapi/java/client/api/IntegrationsApi.java new file mode 100644 index 0000000..718c57b --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/api/IntegrationsApi.java @@ -0,0 +1,773 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.api; + +import com.configcat.publicapi.java.client.ApiCallback; +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.ApiResponse; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ProgressRequestBody; +import com.configcat.publicapi.java.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.configcat.publicapi.java.client.model.CreateIntegrationModel; +import com.configcat.publicapi.java.client.model.IntegrationModel; +import com.configcat.publicapi.java.client.model.IntegrationsModel; +import com.configcat.publicapi.java.client.model.ModifyIntegrationRequest; +import java.util.UUID; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class IntegrationsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public IntegrationsApi() { + this(Configuration.getDefaultApiClient()); + } + + public IntegrationsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createIntegration + * @param productId The identifier of the Product. (required) + * @param createIntegrationModel (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call createIntegrationCall(UUID productId, CreateIntegrationModel createIntegrationModel, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createIntegrationModel; + + // create path and map variables + String localVarPath = "/v1/products/{productId}/integrations" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createIntegrationValidateBeforeCall(UUID productId, CreateIntegrationModel createIntegrationModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling createIntegration(Async)"); + } + + // verify the required parameter 'createIntegrationModel' is set + if (createIntegrationModel == null) { + throw new ApiException("Missing the required parameter 'createIntegrationModel' when calling createIntegration(Async)"); + } + + return createIntegrationCall(productId, createIntegrationModel, _callback); + + } + + /** + * Create Integration + * This endpoint creates a new Integration in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. The Parameters dictionary differs for each IntegrationType: - Datadog - `apikey`: Required. Datadog API key. - `site`: Datadog site. Available values: `Us`, `Eu`, `Us1Fed`, `Us3`, `Us5`. Default: `Us`. - Slack Connecting the Slack integration through the Public Management API will not post messages with the ConfigCat Feature Flags Slack app but with an incoming webhook. - `incoming_webhook.url`: Required. The [incoming webhook URL](https://api.slack.com/messaging/webhooks) where the integration should post messages. - Amplitude - `apiKey`: Required. Amplitude API Key. - `secretKey`: Required. Amplitude Secret Key. - Mixpanel - `serviceAccountUserName`: Required. Mixpanel Service Account Username. - `serviceAccountSecret`: Required. Mixpanel Service Account Secret. - `projectId`: Required. Mixpanel Project ID. - `server`: Mixpanel Server. Available values: `StandardServer`, `EUResidencyServer`. Default: `StandardServer`. - Twilio Segment - `writeKey`: Required. Twilio Segment Write Key. - `server`: Twilio Segment Server. Available values: `Us`, `Eu`. Default: `Us`. - PubNub (work in progress) + * @param productId The identifier of the Product. (required) + * @param createIntegrationModel (required) + * @return IntegrationModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public IntegrationModel createIntegration(UUID productId, CreateIntegrationModel createIntegrationModel) throws ApiException { + ApiResponse localVarResp = createIntegrationWithHttpInfo(productId, createIntegrationModel); + return localVarResp.getData(); + } + + /** + * Create Integration + * This endpoint creates a new Integration in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. The Parameters dictionary differs for each IntegrationType: - Datadog - `apikey`: Required. Datadog API key. - `site`: Datadog site. Available values: `Us`, `Eu`, `Us1Fed`, `Us3`, `Us5`. Default: `Us`. - Slack Connecting the Slack integration through the Public Management API will not post messages with the ConfigCat Feature Flags Slack app but with an incoming webhook. - `incoming_webhook.url`: Required. The [incoming webhook URL](https://api.slack.com/messaging/webhooks) where the integration should post messages. - Amplitude - `apiKey`: Required. Amplitude API Key. - `secretKey`: Required. Amplitude Secret Key. - Mixpanel - `serviceAccountUserName`: Required. Mixpanel Service Account Username. - `serviceAccountSecret`: Required. Mixpanel Service Account Secret. - `projectId`: Required. Mixpanel Project ID. - `server`: Mixpanel Server. Available values: `StandardServer`, `EUResidencyServer`. Default: `StandardServer`. - Twilio Segment - `writeKey`: Required. Twilio Segment Write Key. - `server`: Twilio Segment Server. Available values: `Us`, `Eu`. Default: `Us`. - PubNub (work in progress) + * @param productId The identifier of the Product. (required) + * @param createIntegrationModel (required) + * @return ApiResponse<IntegrationModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse createIntegrationWithHttpInfo(UUID productId, CreateIntegrationModel createIntegrationModel) throws ApiException { + okhttp3.Call localVarCall = createIntegrationValidateBeforeCall(productId, createIntegrationModel, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Integration (asynchronously) + * This endpoint creates a new Integration in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. The Parameters dictionary differs for each IntegrationType: - Datadog - `apikey`: Required. Datadog API key. - `site`: Datadog site. Available values: `Us`, `Eu`, `Us1Fed`, `Us3`, `Us5`. Default: `Us`. - Slack Connecting the Slack integration through the Public Management API will not post messages with the ConfigCat Feature Flags Slack app but with an incoming webhook. - `incoming_webhook.url`: Required. The [incoming webhook URL](https://api.slack.com/messaging/webhooks) where the integration should post messages. - Amplitude - `apiKey`: Required. Amplitude API Key. - `secretKey`: Required. Amplitude Secret Key. - Mixpanel - `serviceAccountUserName`: Required. Mixpanel Service Account Username. - `serviceAccountSecret`: Required. Mixpanel Service Account Secret. - `projectId`: Required. Mixpanel Project ID. - `server`: Mixpanel Server. Available values: `StandardServer`, `EUResidencyServer`. Default: `StandardServer`. - Twilio Segment - `writeKey`: Required. Twilio Segment Write Key. - `server`: Twilio Segment Server. Available values: `Us`, `Eu`. Default: `Us`. - PubNub (work in progress) + * @param productId The identifier of the Product. (required) + * @param createIntegrationModel (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call createIntegrationAsync(UUID productId, CreateIntegrationModel createIntegrationModel, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createIntegrationValidateBeforeCall(productId, createIntegrationModel, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteIntegration + * @param integrationId The identifier of the Integration. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteIntegrationCall(UUID integrationId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/integrations/{integrationId}" + .replace("{" + "integrationId" + "}", localVarApiClient.escapeString(integrationId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteIntegrationValidateBeforeCall(UUID integrationId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'integrationId' is set + if (integrationId == null) { + throw new ApiException("Missing the required parameter 'integrationId' when calling deleteIntegration(Async)"); + } + + return deleteIntegrationCall(integrationId, _callback); + + } + + /** + * Delete Integration + * This endpoint removes a Integration identified by the `integrationId` parameter. + * @param integrationId The identifier of the Integration. (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public void deleteIntegration(UUID integrationId) throws ApiException { + deleteIntegrationWithHttpInfo(integrationId); + } + + /** + * Delete Integration + * This endpoint removes a Integration identified by the `integrationId` parameter. + * @param integrationId The identifier of the Integration. (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse deleteIntegrationWithHttpInfo(UUID integrationId) throws ApiException { + okhttp3.Call localVarCall = deleteIntegrationValidateBeforeCall(integrationId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete Integration (asynchronously) + * This endpoint removes a Integration identified by the `integrationId` parameter. + * @param integrationId The identifier of the Integration. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteIntegrationAsync(UUID integrationId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteIntegrationValidateBeforeCall(integrationId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getIntegration + * @param integrationId The identifier of the Integration. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the integration data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getIntegrationCall(UUID integrationId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/integrations/{integrationId}" + .replace("{" + "integrationId" + "}", localVarApiClient.escapeString(integrationId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getIntegrationValidateBeforeCall(UUID integrationId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'integrationId' is set + if (integrationId == null) { + throw new ApiException("Missing the required parameter 'integrationId' when calling getIntegration(Async)"); + } + + return getIntegrationCall(integrationId, _callback); + + } + + /** + * Get Integration + * This endpoint returns the metadata of an Integration identified by the `integrationId`. + * @param integrationId The identifier of the Integration. (required) + * @return IntegrationModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the integration data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public IntegrationModel getIntegration(UUID integrationId) throws ApiException { + ApiResponse localVarResp = getIntegrationWithHttpInfo(integrationId); + return localVarResp.getData(); + } + + /** + * Get Integration + * This endpoint returns the metadata of an Integration identified by the `integrationId`. + * @param integrationId The identifier of the Integration. (required) + * @return ApiResponse<IntegrationModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the integration data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getIntegrationWithHttpInfo(UUID integrationId) throws ApiException { + okhttp3.Call localVarCall = getIntegrationValidateBeforeCall(integrationId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Integration (asynchronously) + * This endpoint returns the metadata of an Integration identified by the `integrationId`. + * @param integrationId The identifier of the Integration. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the integration data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getIntegrationAsync(UUID integrationId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getIntegrationValidateBeforeCall(integrationId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getIntegrations + * @param productId The identifier of the Product. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getIntegrationsCall(UUID productId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/products/{productId}/integrations" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getIntegrationsValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling getIntegrations(Async)"); + } + + return getIntegrationsCall(productId, _callback); + + } + + /** + * List Integrations + * This endpoint returns the list of the Integrations that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @return IntegrationsModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public IntegrationsModel getIntegrations(UUID productId) throws ApiException { + ApiResponse localVarResp = getIntegrationsWithHttpInfo(productId); + return localVarResp.getData(); + } + + /** + * List Integrations + * This endpoint returns the list of the Integrations that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @return ApiResponse<IntegrationsModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getIntegrationsWithHttpInfo(UUID productId) throws ApiException { + okhttp3.Call localVarCall = getIntegrationsValidateBeforeCall(productId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Integrations (asynchronously) + * This endpoint returns the list of the Integrations that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getIntegrationsAsync(UUID productId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getIntegrationsValidateBeforeCall(productId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateIntegration + * @param integrationId The identifier of the Integration. (required) + * @param modifyIntegrationRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateIntegrationCall(UUID integrationId, ModifyIntegrationRequest modifyIntegrationRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = modifyIntegrationRequest; + + // create path and map variables + String localVarPath = "/v1/integrations/{integrationId}" + .replace("{" + "integrationId" + "}", localVarApiClient.escapeString(integrationId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateIntegrationValidateBeforeCall(UUID integrationId, ModifyIntegrationRequest modifyIntegrationRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'integrationId' is set + if (integrationId == null) { + throw new ApiException("Missing the required parameter 'integrationId' when calling updateIntegration(Async)"); + } + + // verify the required parameter 'modifyIntegrationRequest' is set + if (modifyIntegrationRequest == null) { + throw new ApiException("Missing the required parameter 'modifyIntegrationRequest' when calling updateIntegration(Async)"); + } + + return updateIntegrationCall(integrationId, modifyIntegrationRequest, _callback); + + } + + /** + * Update Integration + * This endpoint updates a Config identified by the `integrationId` parameter. The Parameters dictionary differs for each IntegrationType: - Datadog - `apikey`: Required. Datadog API key. - `site`: Datadog site. Available values: `Us`, `Eu`, `Us1Fed`, `Us3`, `Us5`. Default: `Us`. - Slack Connecting the Slack integration through the Public Management API will not post messages with the ConfigCat Feature Flags Slack app but with an incoming webhook. - `incoming_webhook.url`: Required. The [incoming webhook URL](https://api.slack.com/messaging/webhooks) where the integration should post messages. - Amplitude - `apiKey`: Required. Amplitude API Key. - `secretKey`: Required. Amplitude Secret Key. - Mixpanel - `serviceAccountUserName`: Required. Mixpanel Service Account Username. - `serviceAccountSecret`: Required. Mixpanel Service Account Secret. - `projectId`: Required. Mixpanel Project ID. - `server`: Mixpanel Server. Available values: `StandardServer`, `EUResidencyServer`. Default: `StandardServer`. - Twilio Segment - `writeKey`: Required. Twilio Segment Write Key. - `server`: Twilio Segment Server. Available values: `Us`, `Eu`. Default: `Us`. - PubNub (work in progress) + * @param integrationId The identifier of the Integration. (required) + * @param modifyIntegrationRequest (required) + * @return IntegrationModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public IntegrationModel updateIntegration(UUID integrationId, ModifyIntegrationRequest modifyIntegrationRequest) throws ApiException { + ApiResponse localVarResp = updateIntegrationWithHttpInfo(integrationId, modifyIntegrationRequest); + return localVarResp.getData(); + } + + /** + * Update Integration + * This endpoint updates a Config identified by the `integrationId` parameter. The Parameters dictionary differs for each IntegrationType: - Datadog - `apikey`: Required. Datadog API key. - `site`: Datadog site. Available values: `Us`, `Eu`, `Us1Fed`, `Us3`, `Us5`. Default: `Us`. - Slack Connecting the Slack integration through the Public Management API will not post messages with the ConfigCat Feature Flags Slack app but with an incoming webhook. - `incoming_webhook.url`: Required. The [incoming webhook URL](https://api.slack.com/messaging/webhooks) where the integration should post messages. - Amplitude - `apiKey`: Required. Amplitude API Key. - `secretKey`: Required. Amplitude Secret Key. - Mixpanel - `serviceAccountUserName`: Required. Mixpanel Service Account Username. - `serviceAccountSecret`: Required. Mixpanel Service Account Secret. - `projectId`: Required. Mixpanel Project ID. - `server`: Mixpanel Server. Available values: `StandardServer`, `EUResidencyServer`. Default: `StandardServer`. - Twilio Segment - `writeKey`: Required. Twilio Segment Write Key. - `server`: Twilio Segment Server. Available values: `Us`, `Eu`. Default: `Us`. - PubNub (work in progress) + * @param integrationId The identifier of the Integration. (required) + * @param modifyIntegrationRequest (required) + * @return ApiResponse<IntegrationModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse updateIntegrationWithHttpInfo(UUID integrationId, ModifyIntegrationRequest modifyIntegrationRequest) throws ApiException { + okhttp3.Call localVarCall = updateIntegrationValidateBeforeCall(integrationId, modifyIntegrationRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Integration (asynchronously) + * This endpoint updates a Config identified by the `integrationId` parameter. The Parameters dictionary differs for each IntegrationType: - Datadog - `apikey`: Required. Datadog API key. - `site`: Datadog site. Available values: `Us`, `Eu`, `Us1Fed`, `Us3`, `Us5`. Default: `Us`. - Slack Connecting the Slack integration through the Public Management API will not post messages with the ConfigCat Feature Flags Slack app but with an incoming webhook. - `incoming_webhook.url`: Required. The [incoming webhook URL](https://api.slack.com/messaging/webhooks) where the integration should post messages. - Amplitude - `apiKey`: Required. Amplitude API Key. - `secretKey`: Required. Amplitude Secret Key. - Mixpanel - `serviceAccountUserName`: Required. Mixpanel Service Account Username. - `serviceAccountSecret`: Required. Mixpanel Service Account Secret. - `projectId`: Required. Mixpanel Project ID. - `server`: Mixpanel Server. Available values: `StandardServer`, `EUResidencyServer`. Default: `StandardServer`. - Twilio Segment - `writeKey`: Required. Twilio Segment Write Key. - `server`: Twilio Segment Server. Available values: `Us`, `Eu`. Default: `Us`. - PubNub (work in progress) + * @param integrationId The identifier of the Integration. (required) + * @param modifyIntegrationRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateIntegrationAsync(UUID integrationId, ModifyIntegrationRequest modifyIntegrationRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateIntegrationValidateBeforeCall(integrationId, modifyIntegrationRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/MeApi.java b/src/main/java/com/configcat/publicapi/java/client/api/MeApi.java new file mode 100644 index 0000000..5868484 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/api/MeApi.java @@ -0,0 +1,192 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.api; + +import com.configcat.publicapi.java.client.ApiCallback; +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.ApiResponse; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ProgressRequestBody; +import com.configcat.publicapi.java.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.configcat.publicapi.java.client.model.MeModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class MeApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public MeApi() { + this(Configuration.getDefaultApiClient()); + } + + public MeApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getMe + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getMeCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/me"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getMeValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getMeCall(_callback); + + } + + /** + * Get authenticated user details + * + * @return MeModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public MeModel getMe() throws ApiException { + ApiResponse localVarResp = getMeWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get authenticated user details + * + * @return ApiResponse<MeModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getMeWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getMeValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get authenticated user details (asynchronously) + * + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getMeAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getMeValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/MembersApi.java b/src/main/java/com/configcat/publicapi/java/client/api/MembersApi.java new file mode 100644 index 0000000..6121b7c --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/api/MembersApi.java @@ -0,0 +1,1470 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.api; + +import com.configcat.publicapi.java.client.ApiCallback; +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.ApiResponse; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ProgressRequestBody; +import com.configcat.publicapi.java.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.configcat.publicapi.java.client.model.InvitationModel; +import com.configcat.publicapi.java.client.model.InviteMembersRequest; +import com.configcat.publicapi.java.client.model.MemberModel; +import com.configcat.publicapi.java.client.model.OrganizationInvitationModel; +import com.configcat.publicapi.java.client.model.OrganizationMembersModel; +import java.util.UUID; +import com.configcat.publicapi.java.client.model.UpdateMemberPermissionsRequest; +import com.configcat.publicapi.java.client.model.UserModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class MembersApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public MembersApi() { + this(Configuration.getDefaultApiClient()); + } + + public MembersApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for addMemberToGroup + * @param organizationId The identifier of the Organization. (required) + * @param userId The identifier of the Member. (required) + * @param updateMemberPermissionsRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call addMemberToGroupCall(UUID organizationId, String userId, UpdateMemberPermissionsRequest updateMemberPermissionsRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateMemberPermissionsRequest; + + // create path and map variables + String localVarPath = "/v1/organizations/{organizationId}/members/{userId}" + .replace("{" + "organizationId" + "}", localVarApiClient.escapeString(organizationId.toString())) + .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call addMemberToGroupValidateBeforeCall(UUID organizationId, String userId, UpdateMemberPermissionsRequest updateMemberPermissionsRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { + throw new ApiException("Missing the required parameter 'organizationId' when calling addMemberToGroup(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling addMemberToGroup(Async)"); + } + + // verify the required parameter 'updateMemberPermissionsRequest' is set + if (updateMemberPermissionsRequest == null) { + throw new ApiException("Missing the required parameter 'updateMemberPermissionsRequest' when calling addMemberToGroup(Async)"); + } + + return addMemberToGroupCall(organizationId, userId, updateMemberPermissionsRequest, _callback); + + } + + /** + * Update Member Permissions + * This endpoint updates the permissions of a Member identified by the `userId`. This endpoint can also be used to move a Member between Permission Groups within a Product. Only a single Permission Group can be set per Product. + * @param organizationId The identifier of the Organization. (required) + * @param userId The identifier of the Member. (required) + * @param updateMemberPermissionsRequest (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public void addMemberToGroup(UUID organizationId, String userId, UpdateMemberPermissionsRequest updateMemberPermissionsRequest) throws ApiException { + addMemberToGroupWithHttpInfo(organizationId, userId, updateMemberPermissionsRequest); + } + + /** + * Update Member Permissions + * This endpoint updates the permissions of a Member identified by the `userId`. This endpoint can also be used to move a Member between Permission Groups within a Product. Only a single Permission Group can be set per Product. + * @param organizationId The identifier of the Organization. (required) + * @param userId The identifier of the Member. (required) + * @param updateMemberPermissionsRequest (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse addMemberToGroupWithHttpInfo(UUID organizationId, String userId, UpdateMemberPermissionsRequest updateMemberPermissionsRequest) throws ApiException { + okhttp3.Call localVarCall = addMemberToGroupValidateBeforeCall(organizationId, userId, updateMemberPermissionsRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Update Member Permissions (asynchronously) + * This endpoint updates the permissions of a Member identified by the `userId`. This endpoint can also be used to move a Member between Permission Groups within a Product. Only a single Permission Group can be set per Product. + * @param organizationId The identifier of the Organization. (required) + * @param userId The identifier of the Member. (required) + * @param updateMemberPermissionsRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call addMemberToGroupAsync(UUID organizationId, String userId, UpdateMemberPermissionsRequest updateMemberPermissionsRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = addMemberToGroupValidateBeforeCall(organizationId, userId, updateMemberPermissionsRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for deleteInvitation + * @param invitationId The identifier of the Invitation. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteInvitationCall(UUID invitationId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/invitations/{invitationId}" + .replace("{" + "invitationId" + "}", localVarApiClient.escapeString(invitationId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteInvitationValidateBeforeCall(UUID invitationId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'invitationId' is set + if (invitationId == null) { + throw new ApiException("Missing the required parameter 'invitationId' when calling deleteInvitation(Async)"); + } + + return deleteInvitationCall(invitationId, _callback); + + } + + /** + * Delete Invitation + * This endpoint removes an Invitation identified by the `invitationId` parameter. + * @param invitationId The identifier of the Invitation. (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public void deleteInvitation(UUID invitationId) throws ApiException { + deleteInvitationWithHttpInfo(invitationId); + } + + /** + * Delete Invitation + * This endpoint removes an Invitation identified by the `invitationId` parameter. + * @param invitationId The identifier of the Invitation. (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse deleteInvitationWithHttpInfo(UUID invitationId) throws ApiException { + okhttp3.Call localVarCall = deleteInvitationValidateBeforeCall(invitationId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete Invitation (asynchronously) + * This endpoint removes an Invitation identified by the `invitationId` parameter. + * @param invitationId The identifier of the Invitation. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteInvitationAsync(UUID invitationId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteInvitationValidateBeforeCall(invitationId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for deleteOrganizationMember + * @param organizationId The identifier of the Organization. (required) + * @param userId The identifier of the Member. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteOrganizationMemberCall(UUID organizationId, String userId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/organizations/{organizationId}/members/{userId}" + .replace("{" + "organizationId" + "}", localVarApiClient.escapeString(organizationId.toString())) + .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteOrganizationMemberValidateBeforeCall(UUID organizationId, String userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { + throw new ApiException("Missing the required parameter 'organizationId' when calling deleteOrganizationMember(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling deleteOrganizationMember(Async)"); + } + + return deleteOrganizationMemberCall(organizationId, userId, _callback); + + } + + /** + * Delete Member from Organization + * This endpoint removes a Member identified by the `userId` from the given Organization identified by the `organizationId` parameter. + * @param organizationId The identifier of the Organization. (required) + * @param userId The identifier of the Member. (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public void deleteOrganizationMember(UUID organizationId, String userId) throws ApiException { + deleteOrganizationMemberWithHttpInfo(organizationId, userId); + } + + /** + * Delete Member from Organization + * This endpoint removes a Member identified by the `userId` from the given Organization identified by the `organizationId` parameter. + * @param organizationId The identifier of the Organization. (required) + * @param userId The identifier of the Member. (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse deleteOrganizationMemberWithHttpInfo(UUID organizationId, String userId) throws ApiException { + okhttp3.Call localVarCall = deleteOrganizationMemberValidateBeforeCall(organizationId, userId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete Member from Organization (asynchronously) + * This endpoint removes a Member identified by the `userId` from the given Organization identified by the `organizationId` parameter. + * @param organizationId The identifier of the Organization. (required) + * @param userId The identifier of the Member. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteOrganizationMemberAsync(UUID organizationId, String userId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteOrganizationMemberValidateBeforeCall(organizationId, userId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for deleteProductMember + * @param productId The identifier of the Product. (required) + * @param userId The identifier of the Member. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteProductMemberCall(UUID productId, String userId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/products/{productId}/members/{userId}" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())) + .replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteProductMemberValidateBeforeCall(UUID productId, String userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling deleteProductMember(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling deleteProductMember(Async)"); + } + + return deleteProductMemberCall(productId, userId, _callback); + + } + + /** + * Delete Member from Product + * This endpoint removes a Member identified by the `userId` from the given Product identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @param userId The identifier of the Member. (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public void deleteProductMember(UUID productId, String userId) throws ApiException { + deleteProductMemberWithHttpInfo(productId, userId); + } + + /** + * Delete Member from Product + * This endpoint removes a Member identified by the `userId` from the given Product identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @param userId The identifier of the Member. (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse deleteProductMemberWithHttpInfo(UUID productId, String userId) throws ApiException { + okhttp3.Call localVarCall = deleteProductMemberValidateBeforeCall(productId, userId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete Member from Product (asynchronously) + * This endpoint removes a Member identified by the `userId` from the given Product identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @param userId The identifier of the Member. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteProductMemberAsync(UUID productId, String userId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteProductMemberValidateBeforeCall(productId, userId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getOrganizationMembers + * @param organizationId The identifier of the Organization. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ * @deprecated + */ + @Deprecated + public okhttp3.Call getOrganizationMembersCall(UUID organizationId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/organizations/{organizationId}/members" + .replace("{" + "organizationId" + "}", localVarApiClient.escapeString(organizationId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @Deprecated + @SuppressWarnings("rawtypes") + private okhttp3.Call getOrganizationMembersValidateBeforeCall(UUID organizationId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { + throw new ApiException("Missing the required parameter 'organizationId' when calling getOrganizationMembers(Async)"); + } + + return getOrganizationMembersCall(organizationId, _callback); + + } + + /** + * List Organization Members + * This endpoint returns the list of Members that belongs to the given Organization, identified by the `organizationId` parameter. The results may vary based on the access level of the user who calls the endpoint: - When it's called with Organization Admin privileges, the result will contain each member in the Organization. - When it's called without Organization Admin privileges, the result will contain each Organization Admin along with members of those products where the caller has `Team members and permission groups` (`canManageMembers`) permission. + * @param organizationId The identifier of the Organization. (required) + * @return List<UserModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ * @deprecated + */ + @Deprecated + public List getOrganizationMembers(UUID organizationId) throws ApiException { + ApiResponse> localVarResp = getOrganizationMembersWithHttpInfo(organizationId); + return localVarResp.getData(); + } + + /** + * List Organization Members + * This endpoint returns the list of Members that belongs to the given Organization, identified by the `organizationId` parameter. The results may vary based on the access level of the user who calls the endpoint: - When it's called with Organization Admin privileges, the result will contain each member in the Organization. - When it's called without Organization Admin privileges, the result will contain each Organization Admin along with members of those products where the caller has `Team members and permission groups` (`canManageMembers`) permission. + * @param organizationId The identifier of the Organization. (required) + * @return ApiResponse<List<UserModel>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ * @deprecated + */ + @Deprecated + public ApiResponse> getOrganizationMembersWithHttpInfo(UUID organizationId) throws ApiException { + okhttp3.Call localVarCall = getOrganizationMembersValidateBeforeCall(organizationId, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Organization Members (asynchronously) + * This endpoint returns the list of Members that belongs to the given Organization, identified by the `organizationId` parameter. The results may vary based on the access level of the user who calls the endpoint: - When it's called with Organization Admin privileges, the result will contain each member in the Organization. - When it's called without Organization Admin privileges, the result will contain each Organization Admin along with members of those products where the caller has `Team members and permission groups` (`canManageMembers`) permission. + * @param organizationId The identifier of the Organization. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ * @deprecated + */ + @Deprecated + public okhttp3.Call getOrganizationMembersAsync(UUID organizationId, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getOrganizationMembersValidateBeforeCall(organizationId, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOrganizationMembersV2 + * @param organizationId The identifier of the Organization. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getOrganizationMembersV2Call(UUID organizationId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v2/organizations/{organizationId}/members" + .replace("{" + "organizationId" + "}", localVarApiClient.escapeString(organizationId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOrganizationMembersV2ValidateBeforeCall(UUID organizationId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { + throw new ApiException("Missing the required parameter 'organizationId' when calling getOrganizationMembersV2(Async)"); + } + + return getOrganizationMembersV2Call(organizationId, _callback); + + } + + /** + * List Organization Members + * This endpoint returns the list of Members that belongs to the given Organization, identified by the `organizationId` parameter. The results may vary based on the access level of the user who calls the endpoint: - When it's called with Organization Admin privileges, the result will contain each member in the Organization. - When it's called without Organization Admin privileges, the result will contain each Organization Admin along with members of those products where the caller has `Team members and permission groups` (`canManageMembers`) permission. + * @param organizationId The identifier of the Organization. (required) + * @return OrganizationMembersModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public OrganizationMembersModel getOrganizationMembersV2(UUID organizationId) throws ApiException { + ApiResponse localVarResp = getOrganizationMembersV2WithHttpInfo(organizationId); + return localVarResp.getData(); + } + + /** + * List Organization Members + * This endpoint returns the list of Members that belongs to the given Organization, identified by the `organizationId` parameter. The results may vary based on the access level of the user who calls the endpoint: - When it's called with Organization Admin privileges, the result will contain each member in the Organization. - When it's called without Organization Admin privileges, the result will contain each Organization Admin along with members of those products where the caller has `Team members and permission groups` (`canManageMembers`) permission. + * @param organizationId The identifier of the Organization. (required) + * @return ApiResponse<OrganizationMembersModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getOrganizationMembersV2WithHttpInfo(UUID organizationId) throws ApiException { + okhttp3.Call localVarCall = getOrganizationMembersV2ValidateBeforeCall(organizationId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Organization Members (asynchronously) + * This endpoint returns the list of Members that belongs to the given Organization, identified by the `organizationId` parameter. The results may vary based on the access level of the user who calls the endpoint: - When it's called with Organization Admin privileges, the result will contain each member in the Organization. - When it's called without Organization Admin privileges, the result will contain each Organization Admin along with members of those products where the caller has `Team members and permission groups` (`canManageMembers`) permission. + * @param organizationId The identifier of the Organization. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getOrganizationMembersV2Async(UUID organizationId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getOrganizationMembersV2ValidateBeforeCall(organizationId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPendingInvitations + * @param productId The identifier of the Product. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getPendingInvitationsCall(UUID productId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/products/{productId}/invitations" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPendingInvitationsValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling getPendingInvitations(Async)"); + } + + return getPendingInvitationsCall(productId, _callback); + + } + + /** + * List Pending Invitations in Product + * This endpoint returns the list of pending invitations within the given Product identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @return List<InvitationModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public List getPendingInvitations(UUID productId) throws ApiException { + ApiResponse> localVarResp = getPendingInvitationsWithHttpInfo(productId); + return localVarResp.getData(); + } + + /** + * List Pending Invitations in Product + * This endpoint returns the list of pending invitations within the given Product identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @return ApiResponse<List<InvitationModel>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse> getPendingInvitationsWithHttpInfo(UUID productId) throws ApiException { + okhttp3.Call localVarCall = getPendingInvitationsValidateBeforeCall(productId, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Pending Invitations in Product (asynchronously) + * This endpoint returns the list of pending invitations within the given Product identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getPendingInvitationsAsync(UUID productId, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getPendingInvitationsValidateBeforeCall(productId, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPendingInvitationsOrg + * @param organizationId The identifier of the Organization. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getPendingInvitationsOrgCall(UUID organizationId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/organizations/{organizationId}/invitations" + .replace("{" + "organizationId" + "}", localVarApiClient.escapeString(organizationId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPendingInvitationsOrgValidateBeforeCall(UUID organizationId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { + throw new ApiException("Missing the required parameter 'organizationId' when calling getPendingInvitationsOrg(Async)"); + } + + return getPendingInvitationsOrgCall(organizationId, _callback); + + } + + /** + * List Pending Invitations in Organization + * This endpoint returns the list of pending invitations within the given Organization identified by the `organizationId` parameter. + * @param organizationId The identifier of the Organization. (required) + * @return List<OrganizationInvitationModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public List getPendingInvitationsOrg(UUID organizationId) throws ApiException { + ApiResponse> localVarResp = getPendingInvitationsOrgWithHttpInfo(organizationId); + return localVarResp.getData(); + } + + /** + * List Pending Invitations in Organization + * This endpoint returns the list of pending invitations within the given Organization identified by the `organizationId` parameter. + * @param organizationId The identifier of the Organization. (required) + * @return ApiResponse<List<OrganizationInvitationModel>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse> getPendingInvitationsOrgWithHttpInfo(UUID organizationId) throws ApiException { + okhttp3.Call localVarCall = getPendingInvitationsOrgValidateBeforeCall(organizationId, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Pending Invitations in Organization (asynchronously) + * This endpoint returns the list of pending invitations within the given Organization identified by the `organizationId` parameter. + * @param organizationId The identifier of the Organization. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getPendingInvitationsOrgAsync(UUID organizationId, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getPendingInvitationsOrgValidateBeforeCall(organizationId, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getProductMembers + * @param productId The identifier of the Product. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getProductMembersCall(UUID productId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/products/{productId}/members" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getProductMembersValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling getProductMembers(Async)"); + } + + return getProductMembersCall(productId, _callback); + + } + + /** + * List Product Members + * This endpoint returns the list of Members that belongs to the given Product, identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @return List<MemberModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public List getProductMembers(UUID productId) throws ApiException { + ApiResponse> localVarResp = getProductMembersWithHttpInfo(productId); + return localVarResp.getData(); + } + + /** + * List Product Members + * This endpoint returns the list of Members that belongs to the given Product, identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @return ApiResponse<List<MemberModel>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse> getProductMembersWithHttpInfo(UUID productId) throws ApiException { + okhttp3.Call localVarCall = getProductMembersValidateBeforeCall(productId, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Product Members (asynchronously) + * This endpoint returns the list of Members that belongs to the given Product, identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getProductMembersAsync(UUID productId, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getProductMembersValidateBeforeCall(productId, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for inviteMember + * @param productId The identifier of the Product. (required) + * @param inviteMembersRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the invite was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call inviteMemberCall(UUID productId, InviteMembersRequest inviteMembersRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = inviteMembersRequest; + + // create path and map variables + String localVarPath = "/v1/products/{productId}/members/invite" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call inviteMemberValidateBeforeCall(UUID productId, InviteMembersRequest inviteMembersRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling inviteMember(Async)"); + } + + // verify the required parameter 'inviteMembersRequest' is set + if (inviteMembersRequest == null) { + throw new ApiException("Missing the required parameter 'inviteMembersRequest' when calling inviteMember(Async)"); + } + + return inviteMemberCall(productId, inviteMembersRequest, _callback); + + } + + /** + * Invite Member + * This endpoint invites a Member into the given Product identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @param inviteMembersRequest (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the invite was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public void inviteMember(UUID productId, InviteMembersRequest inviteMembersRequest) throws ApiException { + inviteMemberWithHttpInfo(productId, inviteMembersRequest); + } + + /** + * Invite Member + * This endpoint invites a Member into the given Product identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @param inviteMembersRequest (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the invite was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse inviteMemberWithHttpInfo(UUID productId, InviteMembersRequest inviteMembersRequest) throws ApiException { + okhttp3.Call localVarCall = inviteMemberValidateBeforeCall(productId, inviteMembersRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Invite Member (asynchronously) + * This endpoint invites a Member into the given Product identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @param inviteMembersRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the invite was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call inviteMemberAsync(UUID productId, InviteMembersRequest inviteMembersRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = inviteMemberValidateBeforeCall(productId, inviteMembersRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/OrganizationsApi.java b/src/main/java/com/configcat/publicapi/java/client/api/OrganizationsApi.java new file mode 100644 index 0000000..2db33b1 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/api/OrganizationsApi.java @@ -0,0 +1,192 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.api; + +import com.configcat.publicapi.java.client.ApiCallback; +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.ApiResponse; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ProgressRequestBody; +import com.configcat.publicapi.java.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.configcat.publicapi.java.client.model.OrganizationModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class OrganizationsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public OrganizationsApi() { + this(Configuration.getDefaultApiClient()); + } + + public OrganizationsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getOrganizations + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getOrganizationsCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/organizations"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOrganizationsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getOrganizationsCall(_callback); + + } + + /** + * List Organizations + * This endpoint returns the list of the Organizations that belongs to the user. + * @return List<OrganizationModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public List getOrganizations() throws ApiException { + ApiResponse> localVarResp = getOrganizationsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List Organizations + * This endpoint returns the list of the Organizations that belongs to the user. + * @return ApiResponse<List<OrganizationModel>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse> getOrganizationsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getOrganizationsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Organizations (asynchronously) + * This endpoint returns the list of the Organizations that belongs to the user. + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getOrganizationsAsync(final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getOrganizationsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/PermissionGroupsApi.java b/src/main/java/com/configcat/publicapi/java/client/api/PermissionGroupsApi.java new file mode 100644 index 0000000..ac65669 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/api/PermissionGroupsApi.java @@ -0,0 +1,772 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.api; + +import com.configcat.publicapi.java.client.ApiCallback; +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.ApiResponse; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ProgressRequestBody; +import com.configcat.publicapi.java.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.configcat.publicapi.java.client.model.CreatePermissionGroupRequest; +import com.configcat.publicapi.java.client.model.PermissionGroupModel; +import java.util.UUID; +import com.configcat.publicapi.java.client.model.UpdatePermissionGroupRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PermissionGroupsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public PermissionGroupsApi() { + this(Configuration.getDefaultApiClient()); + } + + public PermissionGroupsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createPermissionGroup + * @param productId The identifier of the Product. (required) + * @param createPermissionGroupRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call createPermissionGroupCall(UUID productId, CreatePermissionGroupRequest createPermissionGroupRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createPermissionGroupRequest; + + // create path and map variables + String localVarPath = "/v1/products/{productId}/permissions" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createPermissionGroupValidateBeforeCall(UUID productId, CreatePermissionGroupRequest createPermissionGroupRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling createPermissionGroup(Async)"); + } + + // verify the required parameter 'createPermissionGroupRequest' is set + if (createPermissionGroupRequest == null) { + throw new ApiException("Missing the required parameter 'createPermissionGroupRequest' when calling createPermissionGroup(Async)"); + } + + return createPermissionGroupCall(productId, createPermissionGroupRequest, _callback); + + } + + /** + * Create Permission Group + * This endpoint creates a new Permission Group in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @param createPermissionGroupRequest (required) + * @return PermissionGroupModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public PermissionGroupModel createPermissionGroup(UUID productId, CreatePermissionGroupRequest createPermissionGroupRequest) throws ApiException { + ApiResponse localVarResp = createPermissionGroupWithHttpInfo(productId, createPermissionGroupRequest); + return localVarResp.getData(); + } + + /** + * Create Permission Group + * This endpoint creates a new Permission Group in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @param createPermissionGroupRequest (required) + * @return ApiResponse<PermissionGroupModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse createPermissionGroupWithHttpInfo(UUID productId, CreatePermissionGroupRequest createPermissionGroupRequest) throws ApiException { + okhttp3.Call localVarCall = createPermissionGroupValidateBeforeCall(productId, createPermissionGroupRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Permission Group (asynchronously) + * This endpoint creates a new Permission Group in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @param createPermissionGroupRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call createPermissionGroupAsync(UUID productId, CreatePermissionGroupRequest createPermissionGroupRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createPermissionGroupValidateBeforeCall(productId, createPermissionGroupRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deletePermissionGroup + * @param permissionGroupId The identifier of the Permission Group. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deletePermissionGroupCall(Long permissionGroupId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/permissions/{permissionGroupId}" + .replace("{" + "permissionGroupId" + "}", localVarApiClient.escapeString(permissionGroupId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deletePermissionGroupValidateBeforeCall(Long permissionGroupId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'permissionGroupId' is set + if (permissionGroupId == null) { + throw new ApiException("Missing the required parameter 'permissionGroupId' when calling deletePermissionGroup(Async)"); + } + + return deletePermissionGroupCall(permissionGroupId, _callback); + + } + + /** + * Delete Permission Group + * This endpoint removes a Permission Group identified by the `permissionGroupId` parameter. + * @param permissionGroupId The identifier of the Permission Group. (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public void deletePermissionGroup(Long permissionGroupId) throws ApiException { + deletePermissionGroupWithHttpInfo(permissionGroupId); + } + + /** + * Delete Permission Group + * This endpoint removes a Permission Group identified by the `permissionGroupId` parameter. + * @param permissionGroupId The identifier of the Permission Group. (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse deletePermissionGroupWithHttpInfo(Long permissionGroupId) throws ApiException { + okhttp3.Call localVarCall = deletePermissionGroupValidateBeforeCall(permissionGroupId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete Permission Group (asynchronously) + * This endpoint removes a Permission Group identified by the `permissionGroupId` parameter. + * @param permissionGroupId The identifier of the Permission Group. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deletePermissionGroupAsync(Long permissionGroupId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deletePermissionGroupValidateBeforeCall(permissionGroupId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getPermissionGroup + * @param permissionGroupId The identifier of the Permission Group. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the permission group data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getPermissionGroupCall(Long permissionGroupId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/permissions/{permissionGroupId}" + .replace("{" + "permissionGroupId" + "}", localVarApiClient.escapeString(permissionGroupId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPermissionGroupValidateBeforeCall(Long permissionGroupId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'permissionGroupId' is set + if (permissionGroupId == null) { + throw new ApiException("Missing the required parameter 'permissionGroupId' when calling getPermissionGroup(Async)"); + } + + return getPermissionGroupCall(permissionGroupId, _callback); + + } + + /** + * Get Permission Group + * This endpoint returns the metadata of a Permission Group identified by the `permissionGroupId`. + * @param permissionGroupId The identifier of the Permission Group. (required) + * @return PermissionGroupModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the permission group data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public PermissionGroupModel getPermissionGroup(Long permissionGroupId) throws ApiException { + ApiResponse localVarResp = getPermissionGroupWithHttpInfo(permissionGroupId); + return localVarResp.getData(); + } + + /** + * Get Permission Group + * This endpoint returns the metadata of a Permission Group identified by the `permissionGroupId`. + * @param permissionGroupId The identifier of the Permission Group. (required) + * @return ApiResponse<PermissionGroupModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the permission group data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getPermissionGroupWithHttpInfo(Long permissionGroupId) throws ApiException { + okhttp3.Call localVarCall = getPermissionGroupValidateBeforeCall(permissionGroupId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Permission Group (asynchronously) + * This endpoint returns the metadata of a Permission Group identified by the `permissionGroupId`. + * @param permissionGroupId The identifier of the Permission Group. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the permission group data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getPermissionGroupAsync(Long permissionGroupId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPermissionGroupValidateBeforeCall(permissionGroupId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPermissionGroups + * @param productId The identifier of the Product. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getPermissionGroupsCall(UUID productId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/products/{productId}/permissions" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPermissionGroupsValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling getPermissionGroups(Async)"); + } + + return getPermissionGroupsCall(productId, _callback); + + } + + /** + * List Permission Groups + * This endpoint returns the list of the Permission Groups that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @return List<PermissionGroupModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public List getPermissionGroups(UUID productId) throws ApiException { + ApiResponse> localVarResp = getPermissionGroupsWithHttpInfo(productId); + return localVarResp.getData(); + } + + /** + * List Permission Groups + * This endpoint returns the list of the Permission Groups that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @return ApiResponse<List<PermissionGroupModel>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse> getPermissionGroupsWithHttpInfo(UUID productId) throws ApiException { + okhttp3.Call localVarCall = getPermissionGroupsValidateBeforeCall(productId, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Permission Groups (asynchronously) + * This endpoint returns the list of the Permission Groups that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getPermissionGroupsAsync(UUID productId, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getPermissionGroupsValidateBeforeCall(productId, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updatePermissionGroup + * @param permissionGroupId The identifier of the Permission Group. (required) + * @param updatePermissionGroupRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updatePermissionGroupCall(Long permissionGroupId, UpdatePermissionGroupRequest updatePermissionGroupRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updatePermissionGroupRequest; + + // create path and map variables + String localVarPath = "/v1/permissions/{permissionGroupId}" + .replace("{" + "permissionGroupId" + "}", localVarApiClient.escapeString(permissionGroupId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updatePermissionGroupValidateBeforeCall(Long permissionGroupId, UpdatePermissionGroupRequest updatePermissionGroupRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'permissionGroupId' is set + if (permissionGroupId == null) { + throw new ApiException("Missing the required parameter 'permissionGroupId' when calling updatePermissionGroup(Async)"); + } + + // verify the required parameter 'updatePermissionGroupRequest' is set + if (updatePermissionGroupRequest == null) { + throw new ApiException("Missing the required parameter 'updatePermissionGroupRequest' when calling updatePermissionGroup(Async)"); + } + + return updatePermissionGroupCall(permissionGroupId, updatePermissionGroupRequest, _callback); + + } + + /** + * Update Permission Group + * This endpoint updates a Permission Group identified by the `permissionGroupId` parameter. + * @param permissionGroupId The identifier of the Permission Group. (required) + * @param updatePermissionGroupRequest (required) + * @return PermissionGroupModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public PermissionGroupModel updatePermissionGroup(Long permissionGroupId, UpdatePermissionGroupRequest updatePermissionGroupRequest) throws ApiException { + ApiResponse localVarResp = updatePermissionGroupWithHttpInfo(permissionGroupId, updatePermissionGroupRequest); + return localVarResp.getData(); + } + + /** + * Update Permission Group + * This endpoint updates a Permission Group identified by the `permissionGroupId` parameter. + * @param permissionGroupId The identifier of the Permission Group. (required) + * @param updatePermissionGroupRequest (required) + * @return ApiResponse<PermissionGroupModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse updatePermissionGroupWithHttpInfo(Long permissionGroupId, UpdatePermissionGroupRequest updatePermissionGroupRequest) throws ApiException { + okhttp3.Call localVarCall = updatePermissionGroupValidateBeforeCall(permissionGroupId, updatePermissionGroupRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Permission Group (asynchronously) + * This endpoint updates a Permission Group identified by the `permissionGroupId` parameter. + * @param permissionGroupId The identifier of the Permission Group. (required) + * @param updatePermissionGroupRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updatePermissionGroupAsync(Long permissionGroupId, UpdatePermissionGroupRequest updatePermissionGroupRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updatePermissionGroupValidateBeforeCall(permissionGroupId, updatePermissionGroupRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/ProductsApi.java b/src/main/java/com/configcat/publicapi/java/client/api/ProductsApi.java new file mode 100644 index 0000000..d48b4a6 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/api/ProductsApi.java @@ -0,0 +1,1038 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.api; + +import com.configcat.publicapi.java.client.ApiCallback; +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.ApiResponse; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ProgressRequestBody; +import com.configcat.publicapi.java.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.configcat.publicapi.java.client.model.CreateProductRequest; +import com.configcat.publicapi.java.client.model.PreferencesModel; +import com.configcat.publicapi.java.client.model.ProductModel; +import java.util.UUID; +import com.configcat.publicapi.java.client.model.UpdatePreferencesRequest; +import com.configcat.publicapi.java.client.model.UpdateProductRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ProductsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ProductsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ProductsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createProduct + * @param organizationId The identifier of the Organization. (required) + * @param createProductRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call createProductCall(UUID organizationId, CreateProductRequest createProductRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createProductRequest; + + // create path and map variables + String localVarPath = "/v1/organizations/{organizationId}/products" + .replace("{" + "organizationId" + "}", localVarApiClient.escapeString(organizationId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createProductValidateBeforeCall(UUID organizationId, CreateProductRequest createProductRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { + throw new ApiException("Missing the required parameter 'organizationId' when calling createProduct(Async)"); + } + + // verify the required parameter 'createProductRequest' is set + if (createProductRequest == null) { + throw new ApiException("Missing the required parameter 'createProductRequest' when calling createProduct(Async)"); + } + + return createProductCall(organizationId, createProductRequest, _callback); + + } + + /** + * Create Product + * This endpoint creates a new Product in a specified Organization identified by the `organizationId` parameter, which can be obtained from the [List Organizations](#operation/get-organizations) endpoint. + * @param organizationId The identifier of the Organization. (required) + * @param createProductRequest (required) + * @return ProductModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ProductModel createProduct(UUID organizationId, CreateProductRequest createProductRequest) throws ApiException { + ApiResponse localVarResp = createProductWithHttpInfo(organizationId, createProductRequest); + return localVarResp.getData(); + } + + /** + * Create Product + * This endpoint creates a new Product in a specified Organization identified by the `organizationId` parameter, which can be obtained from the [List Organizations](#operation/get-organizations) endpoint. + * @param organizationId The identifier of the Organization. (required) + * @param createProductRequest (required) + * @return ApiResponse<ProductModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse createProductWithHttpInfo(UUID organizationId, CreateProductRequest createProductRequest) throws ApiException { + okhttp3.Call localVarCall = createProductValidateBeforeCall(organizationId, createProductRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Product (asynchronously) + * This endpoint creates a new Product in a specified Organization identified by the `organizationId` parameter, which can be obtained from the [List Organizations](#operation/get-organizations) endpoint. + * @param organizationId The identifier of the Organization. (required) + * @param createProductRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call createProductAsync(UUID organizationId, CreateProductRequest createProductRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createProductValidateBeforeCall(organizationId, createProductRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteProduct + * @param productId The identifier of the Product. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteProductCall(UUID productId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/products/{productId}" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteProductValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling deleteProduct(Async)"); + } + + return deleteProductCall(productId, _callback); + + } + + /** + * Delete Product + * This endpoint removes a Product identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public void deleteProduct(UUID productId) throws ApiException { + deleteProductWithHttpInfo(productId); + } + + /** + * Delete Product + * This endpoint removes a Product identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse deleteProductWithHttpInfo(UUID productId) throws ApiException { + okhttp3.Call localVarCall = deleteProductValidateBeforeCall(productId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete Product (asynchronously) + * This endpoint removes a Product identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteProductAsync(UUID productId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteProductValidateBeforeCall(productId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getProduct + * @param productId The identifier of the Product. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the product data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getProductCall(UUID productId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/products/{productId}" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getProductValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling getProduct(Async)"); + } + + return getProductCall(productId, _callback); + + } + + /** + * Get Product + * This endpoint returns the metadata of a Product identified by the `productId`. + * @param productId The identifier of the Product. (required) + * @return ProductModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the product data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ProductModel getProduct(UUID productId) throws ApiException { + ApiResponse localVarResp = getProductWithHttpInfo(productId); + return localVarResp.getData(); + } + + /** + * Get Product + * This endpoint returns the metadata of a Product identified by the `productId`. + * @param productId The identifier of the Product. (required) + * @return ApiResponse<ProductModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the product data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getProductWithHttpInfo(UUID productId) throws ApiException { + okhttp3.Call localVarCall = getProductValidateBeforeCall(productId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Product (asynchronously) + * This endpoint returns the metadata of a Product identified by the `productId`. + * @param productId The identifier of the Product. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the product data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getProductAsync(UUID productId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getProductValidateBeforeCall(productId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getProductPreferences + * @param productId The identifier of the Product. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the product preferences data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getProductPreferencesCall(UUID productId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/products/{productId}/preferences" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getProductPreferencesValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling getProductPreferences(Async)"); + } + + return getProductPreferencesCall(productId, _callback); + + } + + /** + * Get Product Preferences + * This endpoint returns the preferences of a Product identified by the `productId`. + * @param productId The identifier of the Product. (required) + * @return PreferencesModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the product preferences data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public PreferencesModel getProductPreferences(UUID productId) throws ApiException { + ApiResponse localVarResp = getProductPreferencesWithHttpInfo(productId); + return localVarResp.getData(); + } + + /** + * Get Product Preferences + * This endpoint returns the preferences of a Product identified by the `productId`. + * @param productId The identifier of the Product. (required) + * @return ApiResponse<PreferencesModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the product preferences data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getProductPreferencesWithHttpInfo(UUID productId) throws ApiException { + okhttp3.Call localVarCall = getProductPreferencesValidateBeforeCall(productId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Product Preferences (asynchronously) + * This endpoint returns the preferences of a Product identified by the `productId`. + * @param productId The identifier of the Product. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the product preferences data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getProductPreferencesAsync(UUID productId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getProductPreferencesValidateBeforeCall(productId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getProducts + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getProductsCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/products"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getProductsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getProductsCall(_callback); + + } + + /** + * List Products + * This endpoint returns the list of the Products that belongs to the user. + * @return List<ProductModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public List getProducts() throws ApiException { + ApiResponse> localVarResp = getProductsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List Products + * This endpoint returns the list of the Products that belongs to the user. + * @return ApiResponse<List<ProductModel>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse> getProductsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getProductsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Products (asynchronously) + * This endpoint returns the list of the Products that belongs to the user. + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getProductsAsync(final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getProductsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateProduct + * @param productId The identifier of the Product. (required) + * @param updateProductRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateProductCall(UUID productId, UpdateProductRequest updateProductRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateProductRequest; + + // create path and map variables + String localVarPath = "/v1/products/{productId}" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateProductValidateBeforeCall(UUID productId, UpdateProductRequest updateProductRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling updateProduct(Async)"); + } + + // verify the required parameter 'updateProductRequest' is set + if (updateProductRequest == null) { + throw new ApiException("Missing the required parameter 'updateProductRequest' when calling updateProduct(Async)"); + } + + return updateProductCall(productId, updateProductRequest, _callback); + + } + + /** + * Update Product + * This endpoint updates a Product identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @param updateProductRequest (required) + * @return ProductModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ProductModel updateProduct(UUID productId, UpdateProductRequest updateProductRequest) throws ApiException { + ApiResponse localVarResp = updateProductWithHttpInfo(productId, updateProductRequest); + return localVarResp.getData(); + } + + /** + * Update Product + * This endpoint updates a Product identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @param updateProductRequest (required) + * @return ApiResponse<ProductModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse updateProductWithHttpInfo(UUID productId, UpdateProductRequest updateProductRequest) throws ApiException { + okhttp3.Call localVarCall = updateProductValidateBeforeCall(productId, updateProductRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Product (asynchronously) + * This endpoint updates a Product identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @param updateProductRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateProductAsync(UUID productId, UpdateProductRequest updateProductRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateProductValidateBeforeCall(productId, updateProductRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateProductPreferences + * @param productId The identifier of the Product. (required) + * @param updatePreferencesRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateProductPreferencesCall(UUID productId, UpdatePreferencesRequest updatePreferencesRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updatePreferencesRequest; + + // create path and map variables + String localVarPath = "/v1/products/{productId}/preferences" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateProductPreferencesValidateBeforeCall(UUID productId, UpdatePreferencesRequest updatePreferencesRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling updateProductPreferences(Async)"); + } + + // verify the required parameter 'updatePreferencesRequest' is set + if (updatePreferencesRequest == null) { + throw new ApiException("Missing the required parameter 'updatePreferencesRequest' when calling updateProductPreferences(Async)"); + } + + return updateProductPreferencesCall(productId, updatePreferencesRequest, _callback); + + } + + /** + * Update Product Preferences + * This endpoint updates the preferences of a Product identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @param updatePreferencesRequest (required) + * @return PreferencesModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public PreferencesModel updateProductPreferences(UUID productId, UpdatePreferencesRequest updatePreferencesRequest) throws ApiException { + ApiResponse localVarResp = updateProductPreferencesWithHttpInfo(productId, updatePreferencesRequest); + return localVarResp.getData(); + } + + /** + * Update Product Preferences + * This endpoint updates the preferences of a Product identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @param updatePreferencesRequest (required) + * @return ApiResponse<PreferencesModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse updateProductPreferencesWithHttpInfo(UUID productId, UpdatePreferencesRequest updatePreferencesRequest) throws ApiException { + okhttp3.Call localVarCall = updateProductPreferencesValidateBeforeCall(productId, updatePreferencesRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Product Preferences (asynchronously) + * This endpoint updates the preferences of a Product identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @param updatePreferencesRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateProductPreferencesAsync(UUID productId, UpdatePreferencesRequest updatePreferencesRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateProductPreferencesValidateBeforeCall(productId, updatePreferencesRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/SdkKeysApi.java b/src/main/java/com/configcat/publicapi/java/client/api/SdkKeysApi.java new file mode 100644 index 0000000..7de5cac --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/api/SdkKeysApi.java @@ -0,0 +1,221 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.api; + +import com.configcat.publicapi.java.client.ApiCallback; +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.ApiResponse; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ProgressRequestBody; +import com.configcat.publicapi.java.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.configcat.publicapi.java.client.model.SdkKeysModel; +import java.util.UUID; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SdkKeysApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public SdkKeysApi() { + this(Configuration.getDefaultApiClient()); + } + + public SdkKeysApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getSdkKeys + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSdkKeysCall(UUID configId, UUID environmentId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/configs/{configId}/environments/{environmentId}" + .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())) + .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSdkKeysValidateBeforeCall(UUID configId, UUID environmentId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'configId' is set + if (configId == null) { + throw new ApiException("Missing the required parameter 'configId' when calling getSdkKeys(Async)"); + } + + // verify the required parameter 'environmentId' is set + if (environmentId == null) { + throw new ApiException("Missing the required parameter 'environmentId' when calling getSdkKeys(Async)"); + } + + return getSdkKeysCall(configId, environmentId, _callback); + + } + + /** + * Get SDK Key + * This endpoint returns the SDK Key for your Config in a specified Environment. + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @return SdkKeysModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public SdkKeysModel getSdkKeys(UUID configId, UUID environmentId) throws ApiException { + ApiResponse localVarResp = getSdkKeysWithHttpInfo(configId, environmentId); + return localVarResp.getData(); + } + + /** + * Get SDK Key + * This endpoint returns the SDK Key for your Config in a specified Environment. + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @return ApiResponse<SdkKeysModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getSdkKeysWithHttpInfo(UUID configId, UUID environmentId) throws ApiException { + okhttp3.Call localVarCall = getSdkKeysValidateBeforeCall(configId, environmentId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get SDK Key (asynchronously) + * This endpoint returns the SDK Key for your Config in a specified Environment. + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSdkKeysAsync(UUID configId, UUID environmentId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getSdkKeysValidateBeforeCall(configId, environmentId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/SegmentsApi.java b/src/main/java/com/configcat/publicapi/java/client/api/SegmentsApi.java new file mode 100644 index 0000000..5057acc --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/api/SegmentsApi.java @@ -0,0 +1,773 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.api; + +import com.configcat.publicapi.java.client.ApiCallback; +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.ApiResponse; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ProgressRequestBody; +import com.configcat.publicapi.java.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.configcat.publicapi.java.client.model.CreateSegmentModel; +import com.configcat.publicapi.java.client.model.SegmentListModel; +import com.configcat.publicapi.java.client.model.SegmentModel; +import java.util.UUID; +import com.configcat.publicapi.java.client.model.UpdateSegmentModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SegmentsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public SegmentsApi() { + this(Configuration.getDefaultApiClient()); + } + + public SegmentsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createSegment + * @param productId The identifier of the Product. (required) + * @param createSegmentModel (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call createSegmentCall(UUID productId, CreateSegmentModel createSegmentModel, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createSegmentModel; + + // create path and map variables + String localVarPath = "/v1/products/{productId}/segments" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createSegmentValidateBeforeCall(UUID productId, CreateSegmentModel createSegmentModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling createSegment(Async)"); + } + + // verify the required parameter 'createSegmentModel' is set + if (createSegmentModel == null) { + throw new ApiException("Missing the required parameter 'createSegmentModel' when calling createSegment(Async)"); + } + + return createSegmentCall(productId, createSegmentModel, _callback); + + } + + /** + * Create Segment + * This endpoint creates a new Segment in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @param createSegmentModel (required) + * @return SegmentModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public SegmentModel createSegment(UUID productId, CreateSegmentModel createSegmentModel) throws ApiException { + ApiResponse localVarResp = createSegmentWithHttpInfo(productId, createSegmentModel); + return localVarResp.getData(); + } + + /** + * Create Segment + * This endpoint creates a new Segment in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @param createSegmentModel (required) + * @return ApiResponse<SegmentModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse createSegmentWithHttpInfo(UUID productId, CreateSegmentModel createSegmentModel) throws ApiException { + okhttp3.Call localVarCall = createSegmentValidateBeforeCall(productId, createSegmentModel, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Segment (asynchronously) + * This endpoint creates a new Segment in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @param createSegmentModel (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call createSegmentAsync(UUID productId, CreateSegmentModel createSegmentModel, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createSegmentValidateBeforeCall(productId, createSegmentModel, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteSegment + * @param segmentId The identifier of the Segment. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteSegmentCall(UUID segmentId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/segments/{segmentId}" + .replace("{" + "segmentId" + "}", localVarApiClient.escapeString(segmentId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteSegmentValidateBeforeCall(UUID segmentId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + throw new ApiException("Missing the required parameter 'segmentId' when calling deleteSegment(Async)"); + } + + return deleteSegmentCall(segmentId, _callback); + + } + + /** + * Delete Segment + * This endpoint removes a Segment identified by the `segmentId` parameter. + * @param segmentId The identifier of the Segment. (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public void deleteSegment(UUID segmentId) throws ApiException { + deleteSegmentWithHttpInfo(segmentId); + } + + /** + * Delete Segment + * This endpoint removes a Segment identified by the `segmentId` parameter. + * @param segmentId The identifier of the Segment. (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse deleteSegmentWithHttpInfo(UUID segmentId) throws ApiException { + okhttp3.Call localVarCall = deleteSegmentValidateBeforeCall(segmentId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete Segment (asynchronously) + * This endpoint removes a Segment identified by the `segmentId` parameter. + * @param segmentId The identifier of the Segment. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteSegmentAsync(UUID segmentId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteSegmentValidateBeforeCall(segmentId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getSegment + * @param segmentId The identifier of the Segment. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the config data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSegmentCall(UUID segmentId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/segments/{segmentId}" + .replace("{" + "segmentId" + "}", localVarApiClient.escapeString(segmentId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSegmentValidateBeforeCall(UUID segmentId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + throw new ApiException("Missing the required parameter 'segmentId' when calling getSegment(Async)"); + } + + return getSegmentCall(segmentId, _callback); + + } + + /** + * Get Segment + * This endpoint returns the metadata of a Segment identified by the `segmentId`. + * @param segmentId The identifier of the Segment. (required) + * @return SegmentModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the config data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public SegmentModel getSegment(UUID segmentId) throws ApiException { + ApiResponse localVarResp = getSegmentWithHttpInfo(segmentId); + return localVarResp.getData(); + } + + /** + * Get Segment + * This endpoint returns the metadata of a Segment identified by the `segmentId`. + * @param segmentId The identifier of the Segment. (required) + * @return ApiResponse<SegmentModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the config data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getSegmentWithHttpInfo(UUID segmentId) throws ApiException { + okhttp3.Call localVarCall = getSegmentValidateBeforeCall(segmentId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Segment (asynchronously) + * This endpoint returns the metadata of a Segment identified by the `segmentId`. + * @param segmentId The identifier of the Segment. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the config data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSegmentAsync(UUID segmentId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getSegmentValidateBeforeCall(segmentId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getSegments + * @param productId The identifier of the Product. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSegmentsCall(UUID productId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/products/{productId}/segments" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSegmentsValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling getSegments(Async)"); + } + + return getSegmentsCall(productId, _callback); + + } + + /** + * List Segments + * This endpoint returns the list of the Segments that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @return List<SegmentListModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public List getSegments(UUID productId) throws ApiException { + ApiResponse> localVarResp = getSegmentsWithHttpInfo(productId); + return localVarResp.getData(); + } + + /** + * List Segments + * This endpoint returns the list of the Segments that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @return ApiResponse<List<SegmentListModel>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse> getSegmentsWithHttpInfo(UUID productId) throws ApiException { + okhttp3.Call localVarCall = getSegmentsValidateBeforeCall(productId, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Segments (asynchronously) + * This endpoint returns the list of the Segments that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSegmentsAsync(UUID productId, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getSegmentsValidateBeforeCall(productId, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateSegment + * @param segmentId The identifier of the Segment. (required) + * @param updateSegmentModel (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateSegmentCall(UUID segmentId, UpdateSegmentModel updateSegmentModel, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateSegmentModel; + + // create path and map variables + String localVarPath = "/v1/segments/{segmentId}" + .replace("{" + "segmentId" + "}", localVarApiClient.escapeString(segmentId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateSegmentValidateBeforeCall(UUID segmentId, UpdateSegmentModel updateSegmentModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + throw new ApiException("Missing the required parameter 'segmentId' when calling updateSegment(Async)"); + } + + // verify the required parameter 'updateSegmentModel' is set + if (updateSegmentModel == null) { + throw new ApiException("Missing the required parameter 'updateSegmentModel' when calling updateSegment(Async)"); + } + + return updateSegmentCall(segmentId, updateSegmentModel, _callback); + + } + + /** + * Update Segment + * This endpoint updates a Segment identified by the `segmentId` parameter. + * @param segmentId The identifier of the Segment. (required) + * @param updateSegmentModel (required) + * @return SegmentModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public SegmentModel updateSegment(UUID segmentId, UpdateSegmentModel updateSegmentModel) throws ApiException { + ApiResponse localVarResp = updateSegmentWithHttpInfo(segmentId, updateSegmentModel); + return localVarResp.getData(); + } + + /** + * Update Segment + * This endpoint updates a Segment identified by the `segmentId` parameter. + * @param segmentId The identifier of the Segment. (required) + * @param updateSegmentModel (required) + * @return ApiResponse<SegmentModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse updateSegmentWithHttpInfo(UUID segmentId, UpdateSegmentModel updateSegmentModel) throws ApiException { + okhttp3.Call localVarCall = updateSegmentValidateBeforeCall(segmentId, updateSegmentModel, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Segment (asynchronously) + * This endpoint updates a Segment identified by the `segmentId` parameter. + * @param segmentId The identifier of the Segment. (required) + * @param updateSegmentModel (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateSegmentAsync(UUID segmentId, UpdateSegmentModel updateSegmentModel, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateSegmentValidateBeforeCall(segmentId, updateSegmentModel, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/TagsApi.java b/src/main/java/com/configcat/publicapi/java/client/api/TagsApi.java new file mode 100644 index 0000000..6f7b523 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/api/TagsApi.java @@ -0,0 +1,900 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.api; + +import com.configcat.publicapi.java.client.ApiCallback; +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.ApiResponse; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ProgressRequestBody; +import com.configcat.publicapi.java.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.configcat.publicapi.java.client.model.CreateTagModel; +import com.configcat.publicapi.java.client.model.SettingModel; +import com.configcat.publicapi.java.client.model.TagModel; +import java.util.UUID; +import com.configcat.publicapi.java.client.model.UpdateTagModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class TagsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public TagsApi() { + this(Configuration.getDefaultApiClient()); + } + + public TagsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createTag + * @param productId The identifier of the Organization. (required) + * @param createTagModel (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call createTagCall(UUID productId, CreateTagModel createTagModel, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createTagModel; + + // create path and map variables + String localVarPath = "/v1/products/{productId}/tags" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createTagValidateBeforeCall(UUID productId, CreateTagModel createTagModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling createTag(Async)"); + } + + // verify the required parameter 'createTagModel' is set + if (createTagModel == null) { + throw new ApiException("Missing the required parameter 'createTagModel' when calling createTag(Async)"); + } + + return createTagCall(productId, createTagModel, _callback); + + } + + /** + * Create Tag + * This endpoint creates a new Tag in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Organization. (required) + * @param createTagModel (required) + * @return TagModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public TagModel createTag(UUID productId, CreateTagModel createTagModel) throws ApiException { + ApiResponse localVarResp = createTagWithHttpInfo(productId, createTagModel); + return localVarResp.getData(); + } + + /** + * Create Tag + * This endpoint creates a new Tag in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Organization. (required) + * @param createTagModel (required) + * @return ApiResponse<TagModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse createTagWithHttpInfo(UUID productId, CreateTagModel createTagModel) throws ApiException { + okhttp3.Call localVarCall = createTagValidateBeforeCall(productId, createTagModel, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Tag (asynchronously) + * This endpoint creates a new Tag in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Organization. (required) + * @param createTagModel (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call createTagAsync(UUID productId, CreateTagModel createTagModel, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createTagValidateBeforeCall(productId, createTagModel, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteTag + * @param tagId The identifier of the Tag. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteTagCall(Long tagId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/tags/{tagId}" + .replace("{" + "tagId" + "}", localVarApiClient.escapeString(tagId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteTagValidateBeforeCall(Long tagId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'tagId' is set + if (tagId == null) { + throw new ApiException("Missing the required parameter 'tagId' when calling deleteTag(Async)"); + } + + return deleteTagCall(tagId, _callback); + + } + + /** + * Delete Tag + * This endpoint deletes a Tag identified by the `tagId` parameter. To remove a Tag from a Feature Flag or Setting use the [Update Flag](#operation/update-setting) endpoint. + * @param tagId The identifier of the Tag. (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public void deleteTag(Long tagId) throws ApiException { + deleteTagWithHttpInfo(tagId); + } + + /** + * Delete Tag + * This endpoint deletes a Tag identified by the `tagId` parameter. To remove a Tag from a Feature Flag or Setting use the [Update Flag](#operation/update-setting) endpoint. + * @param tagId The identifier of the Tag. (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse deleteTagWithHttpInfo(Long tagId) throws ApiException { + okhttp3.Call localVarCall = deleteTagValidateBeforeCall(tagId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete Tag (asynchronously) + * This endpoint deletes a Tag identified by the `tagId` parameter. To remove a Tag from a Feature Flag or Setting use the [Update Flag](#operation/update-setting) endpoint. + * @param tagId The identifier of the Tag. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteTagAsync(Long tagId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteTagValidateBeforeCall(tagId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getSettingsByTag + * @param tagId The identifier of the Tag. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the settings data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSettingsByTagCall(Long tagId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/tags/{tagId}/settings" + .replace("{" + "tagId" + "}", localVarApiClient.escapeString(tagId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSettingsByTagValidateBeforeCall(Long tagId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'tagId' is set + if (tagId == null) { + throw new ApiException("Missing the required parameter 'tagId' when calling getSettingsByTag(Async)"); + } + + return getSettingsByTagCall(tagId, _callback); + + } + + /** + * List Settings by Tag + * This endpoint returns the list of the Settings that has the specified Tag, identified by the `tagId` parameter. + * @param tagId The identifier of the Tag. (required) + * @return List<SettingModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the settings data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public List getSettingsByTag(Long tagId) throws ApiException { + ApiResponse> localVarResp = getSettingsByTagWithHttpInfo(tagId); + return localVarResp.getData(); + } + + /** + * List Settings by Tag + * This endpoint returns the list of the Settings that has the specified Tag, identified by the `tagId` parameter. + * @param tagId The identifier of the Tag. (required) + * @return ApiResponse<List<SettingModel>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the settings data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse> getSettingsByTagWithHttpInfo(Long tagId) throws ApiException { + okhttp3.Call localVarCall = getSettingsByTagValidateBeforeCall(tagId, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Settings by Tag (asynchronously) + * This endpoint returns the list of the Settings that has the specified Tag, identified by the `tagId` parameter. + * @param tagId The identifier of the Tag. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the settings data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getSettingsByTagAsync(Long tagId, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getSettingsByTagValidateBeforeCall(tagId, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getTag + * @param tagId The identifier of the Tag. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the tag data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getTagCall(Long tagId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/tags/{tagId}" + .replace("{" + "tagId" + "}", localVarApiClient.escapeString(tagId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getTagValidateBeforeCall(Long tagId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'tagId' is set + if (tagId == null) { + throw new ApiException("Missing the required parameter 'tagId' when calling getTag(Async)"); + } + + return getTagCall(tagId, _callback); + + } + + /** + * Get Tag + * This endpoint returns the metadata of a Tag identified by the `tagId`. + * @param tagId The identifier of the Tag. (required) + * @return TagModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the tag data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public TagModel getTag(Long tagId) throws ApiException { + ApiResponse localVarResp = getTagWithHttpInfo(tagId); + return localVarResp.getData(); + } + + /** + * Get Tag + * This endpoint returns the metadata of a Tag identified by the `tagId`. + * @param tagId The identifier of the Tag. (required) + * @return ApiResponse<TagModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the tag data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getTagWithHttpInfo(Long tagId) throws ApiException { + okhttp3.Call localVarCall = getTagValidateBeforeCall(tagId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Tag (asynchronously) + * This endpoint returns the metadata of a Tag identified by the `tagId`. + * @param tagId The identifier of the Tag. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the tag data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getTagAsync(Long tagId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getTagValidateBeforeCall(tagId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getTags + * @param productId The identifier of the Product. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getTagsCall(UUID productId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/products/{productId}/tags" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getTagsValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling getTags(Async)"); + } + + return getTagsCall(productId, _callback); + + } + + /** + * List Tags + * This endpoint returns the list of the Tags in a specified Product, identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @return List<TagModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public List getTags(UUID productId) throws ApiException { + ApiResponse> localVarResp = getTagsWithHttpInfo(productId); + return localVarResp.getData(); + } + + /** + * List Tags + * This endpoint returns the list of the Tags in a specified Product, identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @return ApiResponse<List<TagModel>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse> getTagsWithHttpInfo(UUID productId) throws ApiException { + okhttp3.Call localVarCall = getTagsValidateBeforeCall(productId, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Tags (asynchronously) + * This endpoint returns the list of the Tags in a specified Product, identified by the `productId` parameter. + * @param productId The identifier of the Product. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getTagsAsync(UUID productId, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getTagsValidateBeforeCall(productId, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateTag + * @param tagId The identifier of the Tag. (required) + * @param updateTagModel (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateTagCall(Long tagId, UpdateTagModel updateTagModel, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateTagModel; + + // create path and map variables + String localVarPath = "/v1/tags/{tagId}" + .replace("{" + "tagId" + "}", localVarApiClient.escapeString(tagId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateTagValidateBeforeCall(Long tagId, UpdateTagModel updateTagModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'tagId' is set + if (tagId == null) { + throw new ApiException("Missing the required parameter 'tagId' when calling updateTag(Async)"); + } + + // verify the required parameter 'updateTagModel' is set + if (updateTagModel == null) { + throw new ApiException("Missing the required parameter 'updateTagModel' when calling updateTag(Async)"); + } + + return updateTagCall(tagId, updateTagModel, _callback); + + } + + /** + * Update Tag + * This endpoint updates a Tag identified by the `tagId` parameter. + * @param tagId The identifier of the Tag. (required) + * @param updateTagModel (required) + * @return TagModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public TagModel updateTag(Long tagId, UpdateTagModel updateTagModel) throws ApiException { + ApiResponse localVarResp = updateTagWithHttpInfo(tagId, updateTagModel); + return localVarResp.getData(); + } + + /** + * Update Tag + * This endpoint updates a Tag identified by the `tagId` parameter. + * @param tagId The identifier of the Tag. (required) + * @param updateTagModel (required) + * @return ApiResponse<TagModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse updateTagWithHttpInfo(Long tagId, UpdateTagModel updateTagModel) throws ApiException { + okhttp3.Call localVarCall = updateTagValidateBeforeCall(tagId, updateTagModel, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Tag (asynchronously) + * This endpoint updates a Tag identified by the `tagId` parameter. + * @param tagId The identifier of the Tag. (required) + * @param updateTagModel (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateTagAsync(Long tagId, UpdateTagModel updateTagModel, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateTagValidateBeforeCall(tagId, updateTagModel, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/WebhooksApi.java b/src/main/java/com/configcat/publicapi/java/client/api/WebhooksApi.java new file mode 100644 index 0000000..8bacf7d --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/api/WebhooksApi.java @@ -0,0 +1,1057 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.api; + +import com.configcat.publicapi.java.client.ApiCallback; +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.ApiResponse; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ProgressRequestBody; +import com.configcat.publicapi.java.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.configcat.publicapi.java.client.model.JsonPatchOperation; +import java.util.UUID; +import com.configcat.publicapi.java.client.model.WebHookRequestModel; +import com.configcat.publicapi.java.client.model.WebhookResponseModel; +import com.configcat.publicapi.java.client.model.WebhookSigningKeysModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class WebhooksApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public WebhooksApi() { + this(Configuration.getDefaultApiClient()); + } + + public WebhooksApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createWebhook + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @param webHookRequestModel (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call createWebhookCall(UUID configId, UUID environmentId, WebHookRequestModel webHookRequestModel, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = webHookRequestModel; + + // create path and map variables + String localVarPath = "/v1/configs/{configId}/environments/{environmentId}/webhooks" + .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())) + .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createWebhookValidateBeforeCall(UUID configId, UUID environmentId, WebHookRequestModel webHookRequestModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'configId' is set + if (configId == null) { + throw new ApiException("Missing the required parameter 'configId' when calling createWebhook(Async)"); + } + + // verify the required parameter 'environmentId' is set + if (environmentId == null) { + throw new ApiException("Missing the required parameter 'environmentId' when calling createWebhook(Async)"); + } + + // verify the required parameter 'webHookRequestModel' is set + if (webHookRequestModel == null) { + throw new ApiException("Missing the required parameter 'webHookRequestModel' when calling createWebhook(Async)"); + } + + return createWebhookCall(configId, environmentId, webHookRequestModel, _callback); + + } + + /** + * Create Webhook + * This endpoint creates a new Webhook in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @param webHookRequestModel (required) + * @return WebhookResponseModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public WebhookResponseModel createWebhook(UUID configId, UUID environmentId, WebHookRequestModel webHookRequestModel) throws ApiException { + ApiResponse localVarResp = createWebhookWithHttpInfo(configId, environmentId, webHookRequestModel); + return localVarResp.getData(); + } + + /** + * Create Webhook + * This endpoint creates a new Webhook in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @param webHookRequestModel (required) + * @return ApiResponse<WebhookResponseModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse createWebhookWithHttpInfo(UUID configId, UUID environmentId, WebHookRequestModel webHookRequestModel) throws ApiException { + okhttp3.Call localVarCall = createWebhookValidateBeforeCall(configId, environmentId, webHookRequestModel, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Webhook (asynchronously) + * This endpoint creates a new Webhook in a specified Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param configId The identifier of the Config. (required) + * @param environmentId The identifier of the Environment. (required) + * @param webHookRequestModel (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call createWebhookAsync(UUID configId, UUID environmentId, WebHookRequestModel webHookRequestModel, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createWebhookValidateBeforeCall(configId, environmentId, webHookRequestModel, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteWebhook + * @param webhookId The identifier of the Webhook. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteWebhookCall(Integer webhookId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/webhooks/{webhookId}" + .replace("{" + "webhookId" + "}", localVarApiClient.escapeString(webhookId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteWebhookValidateBeforeCall(Integer webhookId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'webhookId' is set + if (webhookId == null) { + throw new ApiException("Missing the required parameter 'webhookId' when calling deleteWebhook(Async)"); + } + + return deleteWebhookCall(webhookId, _callback); + + } + + /** + * Delete Webhook + * This endpoint removes a Webhook identified by the `webhookId` parameter. + * @param webhookId The identifier of the Webhook. (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public void deleteWebhook(Integer webhookId) throws ApiException { + deleteWebhookWithHttpInfo(webhookId); + } + + /** + * Delete Webhook + * This endpoint removes a Webhook identified by the `webhookId` parameter. + * @param webhookId The identifier of the Webhook. (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse deleteWebhookWithHttpInfo(Integer webhookId) throws ApiException { + okhttp3.Call localVarCall = deleteWebhookValidateBeforeCall(webhookId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete Webhook (asynchronously) + * This endpoint removes a Webhook identified by the `webhookId` parameter. + * @param webhookId The identifier of the Webhook. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call deleteWebhookAsync(Integer webhookId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteWebhookValidateBeforeCall(webhookId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getWebhook + * @param webhookId The identifier of the Webhook. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the webhook data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getWebhookCall(Integer webhookId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/webhooks/{webhookId}" + .replace("{" + "webhookId" + "}", localVarApiClient.escapeString(webhookId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getWebhookValidateBeforeCall(Integer webhookId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'webhookId' is set + if (webhookId == null) { + throw new ApiException("Missing the required parameter 'webhookId' when calling getWebhook(Async)"); + } + + return getWebhookCall(webhookId, _callback); + + } + + /** + * Get Webhook + * This endpoint returns the metadata of a Webhook identified by the `webhookId`. + * @param webhookId The identifier of the Webhook. (required) + * @return WebhookResponseModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the webhook data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public WebhookResponseModel getWebhook(Integer webhookId) throws ApiException { + ApiResponse localVarResp = getWebhookWithHttpInfo(webhookId); + return localVarResp.getData(); + } + + /** + * Get Webhook + * This endpoint returns the metadata of a Webhook identified by the `webhookId`. + * @param webhookId The identifier of the Webhook. (required) + * @return ApiResponse<WebhookResponseModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the webhook data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getWebhookWithHttpInfo(Integer webhookId) throws ApiException { + okhttp3.Call localVarCall = getWebhookValidateBeforeCall(webhookId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Webhook (asynchronously) + * This endpoint returns the metadata of a Webhook identified by the `webhookId`. + * @param webhookId The identifier of the Webhook. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the webhook data is returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getWebhookAsync(Integer webhookId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getWebhookValidateBeforeCall(webhookId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getWebhookSigningKeys + * @param webhookId The identifier of the Webhook. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the webhook signing keys are returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getWebhookSigningKeysCall(Integer webhookId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/webhooks/{webhookId}/keys" + .replace("{" + "webhookId" + "}", localVarApiClient.escapeString(webhookId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getWebhookSigningKeysValidateBeforeCall(Integer webhookId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'webhookId' is set + if (webhookId == null) { + throw new ApiException("Missing the required parameter 'webhookId' when calling getWebhookSigningKeys(Async)"); + } + + return getWebhookSigningKeysCall(webhookId, _callback); + + } + + /** + * Get Webhook Signing Keys + * This endpoint returns the signing keys of a Webhook identified by the `webhookId`. Signing keys are used for ensuring the Webhook requests you receive are actually sent by ConfigCat. <a href=\"https://configcat.com/docs/advanced/notifications-webhooks/#verifying-webhook-requests\" target=\"_blank\" rel=\"noopener noreferrer\">Here</a> you can read more about Webhook request verification. + * @param webhookId The identifier of the Webhook. (required) + * @return WebhookSigningKeysModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the webhook signing keys are returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public WebhookSigningKeysModel getWebhookSigningKeys(Integer webhookId) throws ApiException { + ApiResponse localVarResp = getWebhookSigningKeysWithHttpInfo(webhookId); + return localVarResp.getData(); + } + + /** + * Get Webhook Signing Keys + * This endpoint returns the signing keys of a Webhook identified by the `webhookId`. Signing keys are used for ensuring the Webhook requests you receive are actually sent by ConfigCat. <a href=\"https://configcat.com/docs/advanced/notifications-webhooks/#verifying-webhook-requests\" target=\"_blank\" rel=\"noopener noreferrer\">Here</a> you can read more about Webhook request verification. + * @param webhookId The identifier of the Webhook. (required) + * @return ApiResponse<WebhookSigningKeysModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the webhook signing keys are returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getWebhookSigningKeysWithHttpInfo(Integer webhookId) throws ApiException { + okhttp3.Call localVarCall = getWebhookSigningKeysValidateBeforeCall(webhookId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Webhook Signing Keys (asynchronously) + * This endpoint returns the signing keys of a Webhook identified by the `webhookId`. Signing keys are used for ensuring the Webhook requests you receive are actually sent by ConfigCat. <a href=\"https://configcat.com/docs/advanced/notifications-webhooks/#verifying-webhook-requests\" target=\"_blank\" rel=\"noopener noreferrer\">Here</a> you can read more about Webhook request verification. + * @param webhookId The identifier of the Webhook. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When everything is ok, the webhook signing keys are returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getWebhookSigningKeysAsync(Integer webhookId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getWebhookSigningKeysValidateBeforeCall(webhookId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getWebhooks + * @param productId The identifier of the Product. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getWebhooksCall(UUID productId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/products/{productId}/webhooks" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getWebhooksValidateBeforeCall(UUID productId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling getWebhooks(Async)"); + } + + return getWebhooksCall(productId, _callback); + + } + + /** + * List Webhooks + * This endpoint returns the list of the Webhooks that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @return List<WebhookResponseModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public List getWebhooks(UUID productId) throws ApiException { + ApiResponse> localVarResp = getWebhooksWithHttpInfo(productId); + return localVarResp.getData(); + } + + /** + * List Webhooks + * This endpoint returns the list of the Webhooks that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @return ApiResponse<List<WebhookResponseModel>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse> getWebhooksWithHttpInfo(UUID productId) throws ApiException { + okhttp3.Call localVarCall = getWebhooksValidateBeforeCall(productId, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Webhooks (asynchronously) + * This endpoint returns the list of the Webhooks that belongs to the given Product identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint. + * @param productId The identifier of the Product. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getWebhooksAsync(UUID productId, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getWebhooksValidateBeforeCall(productId, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for replaceWebhook + * @param webhookId The identifier of the Webhook. (required) + * @param webHookRequestModel (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the replace was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call replaceWebhookCall(Integer webhookId, WebHookRequestModel webHookRequestModel, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = webHookRequestModel; + + // create path and map variables + String localVarPath = "/v1/webhooks/{webhookId}" + .replace("{" + "webhookId" + "}", localVarApiClient.escapeString(webhookId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call replaceWebhookValidateBeforeCall(Integer webhookId, WebHookRequestModel webHookRequestModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'webhookId' is set + if (webhookId == null) { + throw new ApiException("Missing the required parameter 'webhookId' when calling replaceWebhook(Async)"); + } + + // verify the required parameter 'webHookRequestModel' is set + if (webHookRequestModel == null) { + throw new ApiException("Missing the required parameter 'webHookRequestModel' when calling replaceWebhook(Async)"); + } + + return replaceWebhookCall(webhookId, webHookRequestModel, _callback); + + } + + /** + * Replace Webhook + * This endpoint replaces the whole value of a Webhook identified by the `webhookId` parameter. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. + * @param webhookId The identifier of the Webhook. (required) + * @param webHookRequestModel (required) + * @return WebhookResponseModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the replace was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public WebhookResponseModel replaceWebhook(Integer webhookId, WebHookRequestModel webHookRequestModel) throws ApiException { + ApiResponse localVarResp = replaceWebhookWithHttpInfo(webhookId, webHookRequestModel); + return localVarResp.getData(); + } + + /** + * Replace Webhook + * This endpoint replaces the whole value of a Webhook identified by the `webhookId` parameter. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. + * @param webhookId The identifier of the Webhook. (required) + * @param webHookRequestModel (required) + * @return ApiResponse<WebhookResponseModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the replace was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse replaceWebhookWithHttpInfo(Integer webhookId, WebHookRequestModel webHookRequestModel) throws ApiException { + okhttp3.Call localVarCall = replaceWebhookValidateBeforeCall(webhookId, webHookRequestModel, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Replace Webhook (asynchronously) + * This endpoint replaces the whole value of a Webhook identified by the `webhookId` parameter. **Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset. + * @param webhookId The identifier of the Webhook. (required) + * @param webHookRequestModel (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the replace was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call replaceWebhookAsync(Integer webhookId, WebHookRequestModel webHookRequestModel, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = replaceWebhookValidateBeforeCall(webhookId, webHookRequestModel, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateWebhook + * @param webhookId The identifier of the Webhook. (required) + * @param jsonPatchOperation (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateWebhookCall(Integer webhookId, List jsonPatchOperation, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = jsonPatchOperation; + + // create path and map variables + String localVarPath = "/v1/webhooks/{webhookId}" + .replace("{" + "webhookId" + "}", localVarApiClient.escapeString(webhookId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "text/json", + "application/*+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateWebhookValidateBeforeCall(Integer webhookId, List jsonPatchOperation, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'webhookId' is set + if (webhookId == null) { + throw new ApiException("Missing the required parameter 'webhookId' when calling updateWebhook(Async)"); + } + + // verify the required parameter 'jsonPatchOperation' is set + if (jsonPatchOperation == null) { + throw new ApiException("Missing the required parameter 'jsonPatchOperation' when calling updateWebhook(Async)"); + } + + return updateWebhookCall(webhookId, jsonPatchOperation, _callback); + + } + + /** + * Update Webhook + * This endpoint updates a Webhook identified by the `webhookId` parameter with a collection of [JSON Patch](https://jsonpatch.com) operations. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. For example: We have the following resource. ```json { \"webhookId\": 6, \"url\": \"https://example.com/hook\", \"httpMethod\": \"post\", \"content\": \"null\", \"webHookHeaders\": [] } ``` If we send an update request body as below (it changes the `content` field and adds a new HTTP header): ```json [ { \"op\": \"replace\", \"path\": \"/content\", \"value\": \"Some webhook content.\" }, { \"op\": \"add\", \"path\": \"/webHookHeaders/-\", \"value\": { \"key\": \"X-Custom-Header\", \"value\": \"Custom header value\" } } ] ``` Only the `content` and `webHookHeaders` are updated and all the other attributes remain unchanged. So we get a response like this: ```json { \"webhookId\": 6, \"url\": \"https://example.com/hook\", \"httpMethod\": \"post\", \"content\": \"Some webhook content.\", \"webHookHeaders\": [ { \"key\": \"X-Custom-Header\", \"value\": \"Custom header value\", \"isSecure\": false } ] } ``` + * @param webhookId The identifier of the Webhook. (required) + * @param jsonPatchOperation (required) + * @return WebhookResponseModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public WebhookResponseModel updateWebhook(Integer webhookId, List jsonPatchOperation) throws ApiException { + ApiResponse localVarResp = updateWebhookWithHttpInfo(webhookId, jsonPatchOperation); + return localVarResp.getData(); + } + + /** + * Update Webhook + * This endpoint updates a Webhook identified by the `webhookId` parameter with a collection of [JSON Patch](https://jsonpatch.com) operations. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. For example: We have the following resource. ```json { \"webhookId\": 6, \"url\": \"https://example.com/hook\", \"httpMethod\": \"post\", \"content\": \"null\", \"webHookHeaders\": [] } ``` If we send an update request body as below (it changes the `content` field and adds a new HTTP header): ```json [ { \"op\": \"replace\", \"path\": \"/content\", \"value\": \"Some webhook content.\" }, { \"op\": \"add\", \"path\": \"/webHookHeaders/-\", \"value\": { \"key\": \"X-Custom-Header\", \"value\": \"Custom header value\" } } ] ``` Only the `content` and `webHookHeaders` are updated and all the other attributes remain unchanged. So we get a response like this: ```json { \"webhookId\": 6, \"url\": \"https://example.com/hook\", \"httpMethod\": \"post\", \"content\": \"Some webhook content.\", \"webHookHeaders\": [ { \"key\": \"X-Custom-Header\", \"value\": \"Custom header value\", \"isSecure\": false } ] } ``` + * @param webhookId The identifier of the Webhook. (required) + * @param jsonPatchOperation (required) + * @return ApiResponse<WebhookResponseModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse updateWebhookWithHttpInfo(Integer webhookId, List jsonPatchOperation) throws ApiException { + okhttp3.Call localVarCall = updateWebhookValidateBeforeCall(webhookId, jsonPatchOperation, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Webhook (asynchronously) + * This endpoint updates a Webhook identified by the `webhookId` parameter with a collection of [JSON Patch](https://jsonpatch.com) operations. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. For example: We have the following resource. ```json { \"webhookId\": 6, \"url\": \"https://example.com/hook\", \"httpMethod\": \"post\", \"content\": \"null\", \"webHookHeaders\": [] } ``` If we send an update request body as below (it changes the `content` field and adds a new HTTP header): ```json [ { \"op\": \"replace\", \"path\": \"/content\", \"value\": \"Some webhook content.\" }, { \"op\": \"add\", \"path\": \"/webHookHeaders/-\", \"value\": { \"key\": \"X-Custom-Header\", \"value\": \"Custom header value\" } } ] ``` Only the `content` and `webHookHeaders` are updated and all the other attributes remain unchanged. So we get a response like this: ```json { \"webhookId\": 6, \"url\": \"https://example.com/hook\", \"httpMethod\": \"post\", \"content\": \"Some webhook content.\", \"webHookHeaders\": [ { \"key\": \"X-Custom-Header\", \"value\": \"Custom header value\", \"isSecure\": false } ] } ``` + * @param webhookId The identifier of the Webhook. (required) + * @param jsonPatchOperation (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call updateWebhookAsync(Integer webhookId, List jsonPatchOperation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateWebhookValidateBeforeCall(webhookId, jsonPatchOperation, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/api/ZombieStaleFlagsApi.java b/src/main/java/com/configcat/publicapi/java/client/api/ZombieStaleFlagsApi.java new file mode 100644 index 0000000..18d02cd --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/api/ZombieStaleFlagsApi.java @@ -0,0 +1,253 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.api; + +import com.configcat.publicapi.java.client.ApiCallback; +import com.configcat.publicapi.java.client.ApiClient; +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.ApiResponse; +import com.configcat.publicapi.java.client.Configuration; +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ProgressRequestBody; +import com.configcat.publicapi.java.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.configcat.publicapi.java.client.model.StaleFlagProductModel; +import com.configcat.publicapi.java.client.model.StaleFlagReminderScope; +import com.configcat.publicapi.java.client.model.StaleFlagStaleInEnvironmentsType; +import java.util.UUID; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ZombieStaleFlagsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ZombieStaleFlagsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ZombieStaleFlagsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getStaleflags + * @param productId The identifier of the Product. (required) + * @param scope The scope of the report. (optional) + * @param staleFlagAgeDays The inactivity in days after a feature flag should be considered stale. (optional) + * @param staleFlagStaleInEnvironmentsType Consider a feature flag as stale if the feature flag is stale in all/any of the environments. (optional) + * @param ignoredEnvironmentIds Ignore environment identifiers from the report. (optional) + * @param ignoredTagIds Ignore feature flags from the report based on their tag identifiers. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getStaleflagsCall(UUID productId, StaleFlagReminderScope scope, Integer staleFlagAgeDays, StaleFlagStaleInEnvironmentsType staleFlagStaleInEnvironmentsType, List ignoredEnvironmentIds, List ignoredTagIds, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/products/{productId}/staleflags" + .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (scope != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("scope", scope)); + } + + if (staleFlagAgeDays != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("staleFlagAgeDays", staleFlagAgeDays)); + } + + if (staleFlagStaleInEnvironmentsType != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("staleFlagStaleInEnvironmentsType", staleFlagStaleInEnvironmentsType)); + } + + if (ignoredEnvironmentIds != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "ignoredEnvironmentIds", ignoredEnvironmentIds)); + } + + if (ignoredTagIds != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "ignoredTagIds", ignoredTagIds)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getStaleflagsValidateBeforeCall(UUID productId, StaleFlagReminderScope scope, Integer staleFlagAgeDays, StaleFlagStaleInEnvironmentsType staleFlagStaleInEnvironmentsType, List ignoredEnvironmentIds, List ignoredTagIds, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'productId' is set + if (productId == null) { + throw new ApiException("Missing the required parameter 'productId' when calling getStaleflags(Async)"); + } + + return getStaleflagsCall(productId, scope, staleFlagAgeDays, staleFlagStaleInEnvironmentsType, ignoredEnvironmentIds, ignoredTagIds, _callback); + + } + + /** + * List Zombie (stale) flags for Product + * This endpoint returns the list of Zombie (stale) flags for a given Product and the result can be optionally filtered by various parameters. + * @param productId The identifier of the Product. (required) + * @param scope The scope of the report. (optional) + * @param staleFlagAgeDays The inactivity in days after a feature flag should be considered stale. (optional) + * @param staleFlagStaleInEnvironmentsType Consider a feature flag as stale if the feature flag is stale in all/any of the environments. (optional) + * @param ignoredEnvironmentIds Ignore environment identifiers from the report. (optional) + * @param ignoredTagIds Ignore feature flags from the report based on their tag identifiers. (optional) + * @return StaleFlagProductModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public StaleFlagProductModel getStaleflags(UUID productId, StaleFlagReminderScope scope, Integer staleFlagAgeDays, StaleFlagStaleInEnvironmentsType staleFlagStaleInEnvironmentsType, List ignoredEnvironmentIds, List ignoredTagIds) throws ApiException { + ApiResponse localVarResp = getStaleflagsWithHttpInfo(productId, scope, staleFlagAgeDays, staleFlagStaleInEnvironmentsType, ignoredEnvironmentIds, ignoredTagIds); + return localVarResp.getData(); + } + + /** + * List Zombie (stale) flags for Product + * This endpoint returns the list of Zombie (stale) flags for a given Product and the result can be optionally filtered by various parameters. + * @param productId The identifier of the Product. (required) + * @param scope The scope of the report. (optional) + * @param staleFlagAgeDays The inactivity in days after a feature flag should be considered stale. (optional) + * @param staleFlagStaleInEnvironmentsType Consider a feature flag as stale if the feature flag is stale in all/any of the environments. (optional) + * @param ignoredEnvironmentIds Ignore environment identifiers from the report. (optional) + * @param ignoredTagIds Ignore feature flags from the report based on their tag identifiers. (optional) + * @return ApiResponse<StaleFlagProductModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public ApiResponse getStaleflagsWithHttpInfo(UUID productId, StaleFlagReminderScope scope, Integer staleFlagAgeDays, StaleFlagStaleInEnvironmentsType staleFlagStaleInEnvironmentsType, List ignoredEnvironmentIds, List ignoredTagIds) throws ApiException { + okhttp3.Call localVarCall = getStaleflagsValidateBeforeCall(productId, scope, staleFlagAgeDays, staleFlagStaleInEnvironmentsType, ignoredEnvironmentIds, ignoredTagIds, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Zombie (stale) flags for Product (asynchronously) + * This endpoint returns the list of Zombie (stale) flags for a given Product and the result can be optionally filtered by various parameters. + * @param productId The identifier of the Product. (required) + * @param scope The scope of the report. (optional) + * @param staleFlagAgeDays The inactivity in days after a feature flag should be considered stale. (optional) + * @param staleFlagStaleInEnvironmentsType Consider a feature flag as stale if the feature flag is stale in all/any of the environments. (optional) + * @param ignoredEnvironmentIds Ignore environment identifiers from the report. (optional) + * @param ignoredTagIds Ignore feature flags from the report based on their tag identifiers. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
+ */ + public okhttp3.Call getStaleflagsAsync(UUID productId, StaleFlagReminderScope scope, Integer staleFlagAgeDays, StaleFlagStaleInEnvironmentsType staleFlagStaleInEnvironmentsType, List ignoredEnvironmentIds, List ignoredTagIds, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getStaleflagsValidateBeforeCall(productId, scope, staleFlagAgeDays, staleFlagStaleInEnvironmentsType, ignoredEnvironmentIds, ignoredTagIds, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/auth/ApiKeyAuth.java b/src/main/java/com/configcat/publicapi/java/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000..cc2e81e --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.auth; + +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/auth/Authentication.java b/src/main/java/com/configcat/publicapi/java/client/auth/Authentication.java new file mode 100644 index 0000000..9e0c12f --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.auth; + +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/src/main/java/com/configcat/publicapi/java/client/auth/HttpBasicAuth.java b/src/main/java/com/configcat/publicapi/java/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000..f5abe41 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/auth/HttpBasicAuth.java @@ -0,0 +1,55 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.auth; + +import com.configcat.publicapi.java.client.Pair; +import com.configcat.publicapi.java.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/auth/HttpBearerAuth.java b/src/main/java/com/configcat/publicapi/java/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000..d53dd00 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/auth/HttpBearerAuth.java @@ -0,0 +1,75 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.auth; + +import com.configcat.publicapi.java.client.ApiException; +import com.configcat.publicapi.java.client.Pair; + +import java.net.URI; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Supplier; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private Supplier tokenSupplier; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return tokenSupplier.get(); + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/src/main/java/com/configcat/publicapi/java/client/model/AbstractOpenApiSchema.java b/src/main/java/com/configcat/publicapi/java/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000..a023d85 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,146 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import com.configcat.publicapi.java.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/src/main/java/com/configcat/publicapi/java/client/model/AccessType.java b/src/main/java/com/configcat/publicapi/java/client/model/AccessType.java new file mode 100644 index 0000000..e32ffb9 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/AccessType.java @@ -0,0 +1,80 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Represent the Feature Management permission. + */ +@JsonAdapter(AccessType.Adapter.class) +public enum AccessType { + + READ_ONLY("readOnly"), + + FULL("full"), + + CUSTOM("custom"); + + private String value; + + AccessType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AccessType fromValue(String value) { + for (AccessType b : AccessType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AccessType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AccessType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AccessType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AccessType.fromValue(value); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/AddOrUpdateIntegrationLinkModel.java b/src/main/java/com/configcat/publicapi/java/client/model/AddOrUpdateIntegrationLinkModel.java new file mode 100644 index 0000000..1bca446 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/AddOrUpdateIntegrationLinkModel.java @@ -0,0 +1,328 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * AddOrUpdateIntegrationLinkModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class AddOrUpdateIntegrationLinkModel { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_URL = "url"; + @SerializedName(SERIALIZED_NAME_URL) + private String url; + + public AddOrUpdateIntegrationLinkModel() { + } + + public AddOrUpdateIntegrationLinkModel description(String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + + public AddOrUpdateIntegrationLinkModel url(String url) { + this.url = url; + return this; + } + + /** + * Get url + * @return url + */ + @javax.annotation.Nullable + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AddOrUpdateIntegrationLinkModel instance itself + */ + public AddOrUpdateIntegrationLinkModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddOrUpdateIntegrationLinkModel addOrUpdateIntegrationLinkModel = (AddOrUpdateIntegrationLinkModel) o; + return Objects.equals(this.description, addOrUpdateIntegrationLinkModel.description) && + Objects.equals(this.url, addOrUpdateIntegrationLinkModel.url)&& + Objects.equals(this.additionalProperties, addOrUpdateIntegrationLinkModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(description, url, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddOrUpdateIntegrationLinkModel {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("description"); + openapiFields.add("url"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AddOrUpdateIntegrationLinkModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AddOrUpdateIntegrationLinkModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AddOrUpdateIntegrationLinkModel is not found in the empty JSON string", AddOrUpdateIntegrationLinkModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if ((jsonObj.get("url") != null && !jsonObj.get("url").isJsonNull()) && !jsonObj.get("url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddOrUpdateIntegrationLinkModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddOrUpdateIntegrationLinkModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AddOrUpdateIntegrationLinkModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AddOrUpdateIntegrationLinkModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AddOrUpdateIntegrationLinkModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AddOrUpdateIntegrationLinkModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AddOrUpdateIntegrationLinkModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddOrUpdateIntegrationLinkModel + * @throws IOException if the JSON string is invalid with respect to AddOrUpdateIntegrationLinkModel + */ + public static AddOrUpdateIntegrationLinkModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddOrUpdateIntegrationLinkModel.class); + } + + /** + * Convert an instance of AddOrUpdateIntegrationLinkModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/AddOrUpdateJiraIntegrationLinkModel.java b/src/main/java/com/configcat/publicapi/java/client/model/AddOrUpdateJiraIntegrationLinkModel.java new file mode 100644 index 0000000..ba19e07 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/AddOrUpdateJiraIntegrationLinkModel.java @@ -0,0 +1,395 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * AddOrUpdateJiraIntegrationLinkModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class AddOrUpdateJiraIntegrationLinkModel { + public static final String SERIALIZED_NAME_JIRA_JWT_TOKEN = "jiraJwtToken"; + @SerializedName(SERIALIZED_NAME_JIRA_JWT_TOKEN) + private String jiraJwtToken; + + public static final String SERIALIZED_NAME_CLIENT_KEY = "clientKey"; + @SerializedName(SERIALIZED_NAME_CLIENT_KEY) + private String clientKey; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_URL = "url"; + @SerializedName(SERIALIZED_NAME_URL) + private String url; + + public AddOrUpdateJiraIntegrationLinkModel() { + } + + public AddOrUpdateJiraIntegrationLinkModel jiraJwtToken(String jiraJwtToken) { + this.jiraJwtToken = jiraJwtToken; + return this; + } + + /** + * Get jiraJwtToken + * @return jiraJwtToken + */ + @javax.annotation.Nonnull + public String getJiraJwtToken() { + return jiraJwtToken; + } + + public void setJiraJwtToken(String jiraJwtToken) { + this.jiraJwtToken = jiraJwtToken; + } + + + public AddOrUpdateJiraIntegrationLinkModel clientKey(String clientKey) { + this.clientKey = clientKey; + return this; + } + + /** + * Get clientKey + * @return clientKey + */ + @javax.annotation.Nonnull + public String getClientKey() { + return clientKey; + } + + public void setClientKey(String clientKey) { + this.clientKey = clientKey; + } + + + public AddOrUpdateJiraIntegrationLinkModel description(String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + + public AddOrUpdateJiraIntegrationLinkModel url(String url) { + this.url = url; + return this; + } + + /** + * Get url + * @return url + */ + @javax.annotation.Nullable + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AddOrUpdateJiraIntegrationLinkModel instance itself + */ + public AddOrUpdateJiraIntegrationLinkModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddOrUpdateJiraIntegrationLinkModel addOrUpdateJiraIntegrationLinkModel = (AddOrUpdateJiraIntegrationLinkModel) o; + return Objects.equals(this.jiraJwtToken, addOrUpdateJiraIntegrationLinkModel.jiraJwtToken) && + Objects.equals(this.clientKey, addOrUpdateJiraIntegrationLinkModel.clientKey) && + Objects.equals(this.description, addOrUpdateJiraIntegrationLinkModel.description) && + Objects.equals(this.url, addOrUpdateJiraIntegrationLinkModel.url)&& + Objects.equals(this.additionalProperties, addOrUpdateJiraIntegrationLinkModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(jiraJwtToken, clientKey, description, url, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddOrUpdateJiraIntegrationLinkModel {\n"); + sb.append(" jiraJwtToken: ").append(toIndentedString(jiraJwtToken)).append("\n"); + sb.append(" clientKey: ").append(toIndentedString(clientKey)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("jiraJwtToken"); + openapiFields.add("clientKey"); + openapiFields.add("description"); + openapiFields.add("url"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("jiraJwtToken"); + openapiRequiredFields.add("clientKey"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AddOrUpdateJiraIntegrationLinkModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AddOrUpdateJiraIntegrationLinkModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AddOrUpdateJiraIntegrationLinkModel is not found in the empty JSON string", AddOrUpdateJiraIntegrationLinkModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddOrUpdateJiraIntegrationLinkModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("jiraJwtToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `jiraJwtToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jiraJwtToken").toString())); + } + if (!jsonObj.get("clientKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientKey").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if ((jsonObj.get("url") != null && !jsonObj.get("url").isJsonNull()) && !jsonObj.get("url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddOrUpdateJiraIntegrationLinkModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddOrUpdateJiraIntegrationLinkModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AddOrUpdateJiraIntegrationLinkModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AddOrUpdateJiraIntegrationLinkModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AddOrUpdateJiraIntegrationLinkModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AddOrUpdateJiraIntegrationLinkModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AddOrUpdateJiraIntegrationLinkModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddOrUpdateJiraIntegrationLinkModel + * @throws IOException if the JSON string is invalid with respect to AddOrUpdateJiraIntegrationLinkModel + */ + public static AddOrUpdateJiraIntegrationLinkModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddOrUpdateJiraIntegrationLinkModel.class); + } + + /** + * Convert an instance of AddOrUpdateJiraIntegrationLinkModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/AuditLogItemModel.java b/src/main/java/com/configcat/publicapi/java/client/model/AuditLogItemModel.java new file mode 100644 index 0000000..1afebb5 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/AuditLogItemModel.java @@ -0,0 +1,618 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.AuditLogType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * AuditLogItemModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class AuditLogItemModel { + public static final String SERIALIZED_NAME_AUDIT_LOG_ID = "auditLogId"; + @SerializedName(SERIALIZED_NAME_AUDIT_LOG_ID) + private Long auditLogId; + + public static final String SERIALIZED_NAME_AUDIT_LOG_DATE_TIME = "auditLogDateTime"; + @SerializedName(SERIALIZED_NAME_AUDIT_LOG_DATE_TIME) + private OffsetDateTime auditLogDateTime; + + public static final String SERIALIZED_NAME_AUDIT_LOG_TYPE_ENUM = "auditLogTypeEnum"; + @SerializedName(SERIALIZED_NAME_AUDIT_LOG_TYPE_ENUM) + private AuditLogType auditLogTypeEnum; + + public static final String SERIALIZED_NAME_CHANGE_SET_ID = "changeSetId"; + @SerializedName(SERIALIZED_NAME_CHANGE_SET_ID) + private UUID changeSetId; + + public static final String SERIALIZED_NAME_TRUNCATED = "truncated"; + @SerializedName(SERIALIZED_NAME_TRUNCATED) + private Boolean truncated; + + public static final String SERIALIZED_NAME_AUDIT_LOG_TYPE = "auditLogType"; + @SerializedName(SERIALIZED_NAME_AUDIT_LOG_TYPE) + private String auditLogType; + + public static final String SERIALIZED_NAME_USER_EMAIL = "userEmail"; + @SerializedName(SERIALIZED_NAME_USER_EMAIL) + private String userEmail; + + public static final String SERIALIZED_NAME_USER_NAME = "userName"; + @SerializedName(SERIALIZED_NAME_USER_NAME) + private String userName; + + public static final String SERIALIZED_NAME_WHERE = "where"; + @SerializedName(SERIALIZED_NAME_WHERE) + private String where; + + public static final String SERIALIZED_NAME_WHY = "why"; + @SerializedName(SERIALIZED_NAME_WHY) + private String why; + + public static final String SERIALIZED_NAME_ACTION_TARGET = "actionTarget"; + @SerializedName(SERIALIZED_NAME_ACTION_TARGET) + private String actionTarget; + + public static final String SERIALIZED_NAME_DETAILS = "details"; + @SerializedName(SERIALIZED_NAME_DETAILS) + private String details; + + public AuditLogItemModel() { + } + + public AuditLogItemModel auditLogId(Long auditLogId) { + this.auditLogId = auditLogId; + return this; + } + + /** + * Get auditLogId + * @return auditLogId + */ + @javax.annotation.Nonnull + public Long getAuditLogId() { + return auditLogId; + } + + public void setAuditLogId(Long auditLogId) { + this.auditLogId = auditLogId; + } + + + public AuditLogItemModel auditLogDateTime(OffsetDateTime auditLogDateTime) { + this.auditLogDateTime = auditLogDateTime; + return this; + } + + /** + * Get auditLogDateTime + * @return auditLogDateTime + */ + @javax.annotation.Nonnull + public OffsetDateTime getAuditLogDateTime() { + return auditLogDateTime; + } + + public void setAuditLogDateTime(OffsetDateTime auditLogDateTime) { + this.auditLogDateTime = auditLogDateTime; + } + + + public AuditLogItemModel auditLogTypeEnum(AuditLogType auditLogTypeEnum) { + this.auditLogTypeEnum = auditLogTypeEnum; + return this; + } + + /** + * Get auditLogTypeEnum + * @return auditLogTypeEnum + */ + @javax.annotation.Nonnull + public AuditLogType getAuditLogTypeEnum() { + return auditLogTypeEnum; + } + + public void setAuditLogTypeEnum(AuditLogType auditLogTypeEnum) { + this.auditLogTypeEnum = auditLogTypeEnum; + } + + + public AuditLogItemModel changeSetId(UUID changeSetId) { + this.changeSetId = changeSetId; + return this; + } + + /** + * Get changeSetId + * @return changeSetId + */ + @javax.annotation.Nullable + public UUID getChangeSetId() { + return changeSetId; + } + + public void setChangeSetId(UUID changeSetId) { + this.changeSetId = changeSetId; + } + + + public AuditLogItemModel truncated(Boolean truncated) { + this.truncated = truncated; + return this; + } + + /** + * Get truncated + * @return truncated + */ + @javax.annotation.Nonnull + public Boolean getTruncated() { + return truncated; + } + + public void setTruncated(Boolean truncated) { + this.truncated = truncated; + } + + + public AuditLogItemModel auditLogType(String auditLogType) { + this.auditLogType = auditLogType; + return this; + } + + /** + * Get auditLogType + * @return auditLogType + */ + @javax.annotation.Nullable + public String getAuditLogType() { + return auditLogType; + } + + public void setAuditLogType(String auditLogType) { + this.auditLogType = auditLogType; + } + + + public AuditLogItemModel userEmail(String userEmail) { + this.userEmail = userEmail; + return this; + } + + /** + * Get userEmail + * @return userEmail + */ + @javax.annotation.Nullable + public String getUserEmail() { + return userEmail; + } + + public void setUserEmail(String userEmail) { + this.userEmail = userEmail; + } + + + public AuditLogItemModel userName(String userName) { + this.userName = userName; + return this; + } + + /** + * Get userName + * @return userName + */ + @javax.annotation.Nullable + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + + public AuditLogItemModel where(String where) { + this.where = where; + return this; + } + + /** + * Get where + * @return where + */ + @javax.annotation.Nullable + public String getWhere() { + return where; + } + + public void setWhere(String where) { + this.where = where; + } + + + public AuditLogItemModel why(String why) { + this.why = why; + return this; + } + + /** + * Get why + * @return why + */ + @javax.annotation.Nullable + public String getWhy() { + return why; + } + + public void setWhy(String why) { + this.why = why; + } + + + public AuditLogItemModel actionTarget(String actionTarget) { + this.actionTarget = actionTarget; + return this; + } + + /** + * Get actionTarget + * @return actionTarget + */ + @javax.annotation.Nullable + public String getActionTarget() { + return actionTarget; + } + + public void setActionTarget(String actionTarget) { + this.actionTarget = actionTarget; + } + + + public AuditLogItemModel details(String details) { + this.details = details; + return this; + } + + /** + * Get details + * @return details + */ + @javax.annotation.Nullable + public String getDetails() { + return details; + } + + public void setDetails(String details) { + this.details = details; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AuditLogItemModel instance itself + */ + public AuditLogItemModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuditLogItemModel auditLogItemModel = (AuditLogItemModel) o; + return Objects.equals(this.auditLogId, auditLogItemModel.auditLogId) && + Objects.equals(this.auditLogDateTime, auditLogItemModel.auditLogDateTime) && + Objects.equals(this.auditLogTypeEnum, auditLogItemModel.auditLogTypeEnum) && + Objects.equals(this.changeSetId, auditLogItemModel.changeSetId) && + Objects.equals(this.truncated, auditLogItemModel.truncated) && + Objects.equals(this.auditLogType, auditLogItemModel.auditLogType) && + Objects.equals(this.userEmail, auditLogItemModel.userEmail) && + Objects.equals(this.userName, auditLogItemModel.userName) && + Objects.equals(this.where, auditLogItemModel.where) && + Objects.equals(this.why, auditLogItemModel.why) && + Objects.equals(this.actionTarget, auditLogItemModel.actionTarget) && + Objects.equals(this.details, auditLogItemModel.details)&& + Objects.equals(this.additionalProperties, auditLogItemModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(auditLogId, auditLogDateTime, auditLogTypeEnum, changeSetId, truncated, auditLogType, userEmail, userName, where, why, actionTarget, details, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuditLogItemModel {\n"); + sb.append(" auditLogId: ").append(toIndentedString(auditLogId)).append("\n"); + sb.append(" auditLogDateTime: ").append(toIndentedString(auditLogDateTime)).append("\n"); + sb.append(" auditLogTypeEnum: ").append(toIndentedString(auditLogTypeEnum)).append("\n"); + sb.append(" changeSetId: ").append(toIndentedString(changeSetId)).append("\n"); + sb.append(" truncated: ").append(toIndentedString(truncated)).append("\n"); + sb.append(" auditLogType: ").append(toIndentedString(auditLogType)).append("\n"); + sb.append(" userEmail: ").append(toIndentedString(userEmail)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append(" where: ").append(toIndentedString(where)).append("\n"); + sb.append(" why: ").append(toIndentedString(why)).append("\n"); + sb.append(" actionTarget: ").append(toIndentedString(actionTarget)).append("\n"); + sb.append(" details: ").append(toIndentedString(details)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("auditLogId"); + openapiFields.add("auditLogDateTime"); + openapiFields.add("auditLogTypeEnum"); + openapiFields.add("changeSetId"); + openapiFields.add("truncated"); + openapiFields.add("auditLogType"); + openapiFields.add("userEmail"); + openapiFields.add("userName"); + openapiFields.add("where"); + openapiFields.add("why"); + openapiFields.add("actionTarget"); + openapiFields.add("details"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("auditLogId"); + openapiRequiredFields.add("auditLogDateTime"); + openapiRequiredFields.add("auditLogTypeEnum"); + openapiRequiredFields.add("changeSetId"); + openapiRequiredFields.add("truncated"); + openapiRequiredFields.add("auditLogType"); + openapiRequiredFields.add("userEmail"); + openapiRequiredFields.add("userName"); + openapiRequiredFields.add("where"); + openapiRequiredFields.add("why"); + openapiRequiredFields.add("actionTarget"); + openapiRequiredFields.add("details"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AuditLogItemModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AuditLogItemModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AuditLogItemModel is not found in the empty JSON string", AuditLogItemModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AuditLogItemModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `auditLogTypeEnum` + AuditLogType.validateJsonElement(jsonObj.get("auditLogTypeEnum")); + if ((jsonObj.get("changeSetId") != null && !jsonObj.get("changeSetId").isJsonNull()) && !jsonObj.get("changeSetId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `changeSetId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("changeSetId").toString())); + } + if ((jsonObj.get("auditLogType") != null && !jsonObj.get("auditLogType").isJsonNull()) && !jsonObj.get("auditLogType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `auditLogType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("auditLogType").toString())); + } + if ((jsonObj.get("userEmail") != null && !jsonObj.get("userEmail").isJsonNull()) && !jsonObj.get("userEmail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userEmail").toString())); + } + if ((jsonObj.get("userName") != null && !jsonObj.get("userName").isJsonNull()) && !jsonObj.get("userName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userName").toString())); + } + if ((jsonObj.get("where") != null && !jsonObj.get("where").isJsonNull()) && !jsonObj.get("where").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `where` to be a primitive type in the JSON string but got `%s`", jsonObj.get("where").toString())); + } + if ((jsonObj.get("why") != null && !jsonObj.get("why").isJsonNull()) && !jsonObj.get("why").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `why` to be a primitive type in the JSON string but got `%s`", jsonObj.get("why").toString())); + } + if ((jsonObj.get("actionTarget") != null && !jsonObj.get("actionTarget").isJsonNull()) && !jsonObj.get("actionTarget").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `actionTarget` to be a primitive type in the JSON string but got `%s`", jsonObj.get("actionTarget").toString())); + } + if ((jsonObj.get("details") != null && !jsonObj.get("details").isJsonNull()) && !jsonObj.get("details").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `details` to be a primitive type in the JSON string but got `%s`", jsonObj.get("details").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AuditLogItemModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuditLogItemModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuditLogItemModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AuditLogItemModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AuditLogItemModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AuditLogItemModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuditLogItemModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuditLogItemModel + * @throws IOException if the JSON string is invalid with respect to AuditLogItemModel + */ + public static AuditLogItemModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuditLogItemModel.class); + } + + /** + * Convert an instance of AuditLogItemModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/AuditLogType.java b/src/main/java/com/configcat/publicapi/java/client/model/AuditLogType.java new file mode 100644 index 0000000..0ca1030 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/AuditLogType.java @@ -0,0 +1,258 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets AuditLogType + */ +@JsonAdapter(AuditLogType.Adapter.class) +public enum AuditLogType { + + PRODUCT_CREATED("productCreated"), + + PRODUCT_CHANGED("productChanged"), + + PRODUCT_OWNERSHIP_TRANSFERRED("productOwnershipTransferred"), + + PRODUCT_DELETED("productDeleted"), + + PRODUCTS_REORDERED("productsReordered"), + + TEAM_MEMBER_INVITED("teamMemberInvited"), + + TEAM_MEMBER_INVITATION_REVOKED("teamMemberInvitationRevoked"), + + TEAM_MEMBER_JOINED("teamMemberJoined"), + + TEAM_MEMBER_PERMISSION_GROUP_CHANGED("teamMemberPermissionGroupChanged"), + + TEAM_MEMBER_REMOVED("teamMemberRemoved"), + + TEAM_MEMBER_LEFT("teamMemberLeft"), + + TEAM_MEMBER_INVITATION_CHANGED("teamMemberInvitationChanged"), + + TEAM_MEMBER_INVITATION_RESENT("teamMemberInvitationResent"), + + TEAM_MEMBER_INVITATION_REJECTED("teamMemberInvitationRejected"), + + CONFIG_CREATED("configCreated"), + + CONFIG_CHANGED("configChanged"), + + CONFIG_DELETED("configDeleted"), + + CONFIGS_REORDERED("configsReordered"), + + ENVIRONMENT_CREATED("environmentCreated"), + + ENVIRONMENT_CHANGED("environmentChanged"), + + ENVIRONMENT_DELETED("environmentDeleted"), + + ENVIRONMENTS_REORDERED("environmentsReordered"), + + SETTING_CREATED("settingCreated"), + + SETTING_CHANGED("settingChanged"), + + SETTING_DELETED("settingDeleted"), + + SETTINGS_REORDERED("settingsReordered"), + + SETTING_VALUE_CHANGED("settingValueChanged"), + + WEB_HOOK_CREATED("webHookCreated"), + + WEB_HOOK_CHANGED("webHookChanged"), + + WEB_HOOK_DELETED("webHookDeleted"), + + PERMISSION_GROUP_CREATED("permissionGroupCreated"), + + PERMISSION_GROUP_CHANGED("permissionGroupChanged"), + + PERMISSION_GROUP_DELETED("permissionGroupDeleted"), + + PERMISSION_GROUP_DEFAULT("permissionGroupDefault"), + + API_KEY_ADDED("apiKeyAdded"), + + API_KEY_REMOVED("apiKeyRemoved"), + + INTEGRATION_ADDED("integrationAdded"), + + INTEGRATION_CHANGED("integrationChanged"), + + INTEGRATION_REMOVED("integrationRemoved"), + + API_KEY_CONNECTED("apiKeyConnected"), + + INTEGRATION_LINK_ADDED("integrationLinkAdded"), + + INTEGRATION_LINK_REMOVED("integrationLinkRemoved"), + + ORGANIZATION_ADDED("organizationAdded"), + + ORGANIZATION_REMOVED("organizationRemoved"), + + ORGANIZATION_CHANGED("organizationChanged"), + + ORGANIZATION_SUBSCRIPTION_TYPE_CHANGED("organizationSubscriptionTypeChanged"), + + ORGANIZATION_ADMIN_CHANGED("organizationAdminChanged"), + + ORGANIZATION_ADMIN_LEFT("organizationAdminLeft"), + + TWO_FACTOR_DISABLED_FOR_MEMBER("twoFactorDisabledForMember"), + + TAG_ADDED("tagAdded"), + + TAG_CHANGED("tagChanged"), + + TAG_REMOVED("tagRemoved"), + + SETTING_TAG_ADDED("settingTagAdded"), + + SETTING_TAG_REMOVED("settingTagRemoved"), + + PUBLIC_API_ACCESS_TOKEN_ADDED("publicApiAccessTokenAdded"), + + PUBLIC_API_ACCESS_TOKEN_REMOVED("publicApiAccessTokenRemoved"), + + DOMAIN_ADDED("domainAdded"), + + DOMAIN_VERIFIED("domainVerified"), + + DOMAIN_REMOVED("domainRemoved"), + + DOMAIN_SAML_CONFIGURED("domainSamlConfigured"), + + DOMAIN_SAML_DELETED("domainSamlDeleted"), + + AUTO_PROVISIONING_CONFIGURATION_CHANGED("autoProvisioningConfigurationChanged"), + + SAML_IDP_CONFIGURATION_ADDED("samlIdpConfigurationAdded"), + + SAML_IDP_CONFIGURATION_REMOVED("samlIdpConfigurationRemoved"), + + SAML_IDP_CONFIGURATION_UPDATED("samlIdpConfigurationUpdated"), + + AUTO_PROVISIONING_ENABLED_CHANGED("autoProvisioningEnabledChanged"), + + ORGANIZATION_MEMBER_JOINED("organizationMemberJoined"), + + ORGANIZATION_MEMBER_PRODUCT_JOIN_REQUESTED("organizationMemberProductJoinRequested"), + + ORGANIZATION_MEMBER_PRODUCT_JOIN_REQUEST_REJECTED("organizationMemberProductJoinRequestRejected"), + + ORGANIZATION_MEMBER_PRODUCT_JOIN_REQUEST_APPROVED("organizationMemberProductJoinRequestApproved"), + + ORGANIZATION_MEMBER_REMOVED("organizationMemberRemoved"), + + CODE_REFERENCES_UPLOADED("codeReferencesUploaded"), + + CODE_REFERENCE_DELETED("codeReferenceDeleted"), + + CODE_REFERENCE_STALE_BRANCH_DELETED("codeReferenceStaleBranchDeleted"), + + SEGMENT_CREATED("segmentCreated"), + + SEGMENT_CHANGED("segmentChanged"), + + SEGMENT_DELETED("segmentDeleted"), + + WEBHOOK_SIGNING_KEY_DELETED("webhookSigningKeyDeleted"), + + WEBHOOK_SIGNING_KEY_CREATED("webhookSigningKeyCreated"), + + USER_PROVISIONING_CONFIGURATION_CHANGED("userProvisioningConfigurationChanged"), + + SYNC_GROUP_PROVISIONING_RULE_CHANGED("syncGroupProvisioningRuleChanged"), + + SYNC_GROUPS_REORDERED("syncGroupsReordered"), + + SYNC_USER_PROVISIONING_ENABLED("syncUserProvisioningEnabled"), + + SYNC_USER_PROVISIONING_DISABLED("syncUserProvisioningDisabled"), + + USER_EMAIL_CHANGED("userEmailChanged"), + + USER_FULL_NAME_CHANGED("userFullNameChanged"), + + USER_DISABLED("userDisabled"), + + AWS_CONNECTED("awsConnected"), + + AWS_DISCONNECTED("awsDisconnected"), + + USER_ENABLED("userEnabled"), + + SYNC_USER_DELETED("syncUserDeleted"), + + SYNC_GROUP_DELETED("syncGroupDeleted"); + + private String value; + + AuditLogType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AuditLogType fromValue(String value) { + for (AuditLogType b : AuditLogType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AuditLogType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AuditLogType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AuditLogType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AuditLogType.fromValue(value); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/CodeReferenceModel.java b/src/main/java/com/configcat/publicapi/java/client/model/CodeReferenceModel.java new file mode 100644 index 0000000..2ac1b13 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/CodeReferenceModel.java @@ -0,0 +1,522 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.ReferenceLinesModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * CodeReferenceModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class CodeReferenceModel { + public static final String SERIALIZED_NAME_BRANCH = "branch"; + @SerializedName(SERIALIZED_NAME_BRANCH) + private String branch; + + public static final String SERIALIZED_NAME_REFERENCES = "references"; + @SerializedName(SERIALIZED_NAME_REFERENCES) + private List references; + + public static final String SERIALIZED_NAME_COMMIT_URL = "commitUrl"; + @SerializedName(SERIALIZED_NAME_COMMIT_URL) + private String commitUrl; + + public static final String SERIALIZED_NAME_COMMIT_HASH = "commitHash"; + @SerializedName(SERIALIZED_NAME_COMMIT_HASH) + private String commitHash; + + public static final String SERIALIZED_NAME_SYNCED_AT = "syncedAt"; + @SerializedName(SERIALIZED_NAME_SYNCED_AT) + private OffsetDateTime syncedAt; + + public static final String SERIALIZED_NAME_REPOSITORY = "repository"; + @SerializedName(SERIALIZED_NAME_REPOSITORY) + private String repository; + + public static final String SERIALIZED_NAME_CODE_REFERENCE_ID = "codeReferenceId"; + @SerializedName(SERIALIZED_NAME_CODE_REFERENCE_ID) + private UUID codeReferenceId; + + public static final String SERIALIZED_NAME_UPLOADER = "uploader"; + @SerializedName(SERIALIZED_NAME_UPLOADER) + private String uploader; + + public CodeReferenceModel() { + } + + public CodeReferenceModel branch(String branch) { + this.branch = branch; + return this; + } + + /** + * The source control branch on where the scan was performed. (Source of the branch selector on the ConfigCat Dashboard) + * @return branch + */ + @javax.annotation.Nullable + public String getBranch() { + return branch; + } + + public void setBranch(String branch) { + this.branch = branch; + } + + + public CodeReferenceModel references(List references) { + this.references = references; + return this; + } + + public CodeReferenceModel addReferencesItem(ReferenceLinesModel referencesItem) { + if (this.references == null) { + this.references = new ArrayList<>(); + } + this.references.add(referencesItem); + return this; + } + + /** + * The actual references to the given Feature Flag or Setting. + * @return references + */ + @javax.annotation.Nullable + public List getReferences() { + return references; + } + + public void setReferences(List references) { + this.references = references; + } + + + public CodeReferenceModel commitUrl(String commitUrl) { + this.commitUrl = commitUrl; + return this; + } + + /** + * The related commit's URL. + * @return commitUrl + */ + @javax.annotation.Nullable + public String getCommitUrl() { + return commitUrl; + } + + public void setCommitUrl(String commitUrl) { + this.commitUrl = commitUrl; + } + + + public CodeReferenceModel commitHash(String commitHash) { + this.commitHash = commitHash; + return this; + } + + /** + * The related commit's hash. + * @return commitHash + */ + @javax.annotation.Nullable + public String getCommitHash() { + return commitHash; + } + + public void setCommitHash(String commitHash) { + this.commitHash = commitHash; + } + + + public CodeReferenceModel syncedAt(OffsetDateTime syncedAt) { + this.syncedAt = syncedAt; + return this; + } + + /** + * The date and time when the reference report was uploaded. + * @return syncedAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getSyncedAt() { + return syncedAt; + } + + public void setSyncedAt(OffsetDateTime syncedAt) { + this.syncedAt = syncedAt; + } + + + public CodeReferenceModel repository(String repository) { + this.repository = repository; + return this; + } + + /** + * The source control repository that contains the scanned code. + * @return repository + */ + @javax.annotation.Nullable + public String getRepository() { + return repository; + } + + public void setRepository(String repository) { + this.repository = repository; + } + + + public CodeReferenceModel codeReferenceId(UUID codeReferenceId) { + this.codeReferenceId = codeReferenceId; + return this; + } + + /** + * The identifier of the reference report. + * @return codeReferenceId + */ + @javax.annotation.Nonnull + public UUID getCodeReferenceId() { + return codeReferenceId; + } + + public void setCodeReferenceId(UUID codeReferenceId) { + this.codeReferenceId = codeReferenceId; + } + + + public CodeReferenceModel uploader(String uploader) { + this.uploader = uploader; + return this; + } + + /** + * The code reference scanning tool's name. + * @return uploader + */ + @javax.annotation.Nullable + public String getUploader() { + return uploader; + } + + public void setUploader(String uploader) { + this.uploader = uploader; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CodeReferenceModel instance itself + */ + public CodeReferenceModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CodeReferenceModel codeReferenceModel = (CodeReferenceModel) o; + return Objects.equals(this.branch, codeReferenceModel.branch) && + Objects.equals(this.references, codeReferenceModel.references) && + Objects.equals(this.commitUrl, codeReferenceModel.commitUrl) && + Objects.equals(this.commitHash, codeReferenceModel.commitHash) && + Objects.equals(this.syncedAt, codeReferenceModel.syncedAt) && + Objects.equals(this.repository, codeReferenceModel.repository) && + Objects.equals(this.codeReferenceId, codeReferenceModel.codeReferenceId) && + Objects.equals(this.uploader, codeReferenceModel.uploader)&& + Objects.equals(this.additionalProperties, codeReferenceModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(branch, references, commitUrl, commitHash, syncedAt, repository, codeReferenceId, uploader, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CodeReferenceModel {\n"); + sb.append(" branch: ").append(toIndentedString(branch)).append("\n"); + sb.append(" references: ").append(toIndentedString(references)).append("\n"); + sb.append(" commitUrl: ").append(toIndentedString(commitUrl)).append("\n"); + sb.append(" commitHash: ").append(toIndentedString(commitHash)).append("\n"); + sb.append(" syncedAt: ").append(toIndentedString(syncedAt)).append("\n"); + sb.append(" repository: ").append(toIndentedString(repository)).append("\n"); + sb.append(" codeReferenceId: ").append(toIndentedString(codeReferenceId)).append("\n"); + sb.append(" uploader: ").append(toIndentedString(uploader)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("branch"); + openapiFields.add("references"); + openapiFields.add("commitUrl"); + openapiFields.add("commitHash"); + openapiFields.add("syncedAt"); + openapiFields.add("repository"); + openapiFields.add("codeReferenceId"); + openapiFields.add("uploader"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("branch"); + openapiRequiredFields.add("references"); + openapiRequiredFields.add("commitUrl"); + openapiRequiredFields.add("commitHash"); + openapiRequiredFields.add("syncedAt"); + openapiRequiredFields.add("repository"); + openapiRequiredFields.add("codeReferenceId"); + openapiRequiredFields.add("uploader"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CodeReferenceModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CodeReferenceModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CodeReferenceModel is not found in the empty JSON string", CodeReferenceModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CodeReferenceModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("branch") != null && !jsonObj.get("branch").isJsonNull()) && !jsonObj.get("branch").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `branch` to be a primitive type in the JSON string but got `%s`", jsonObj.get("branch").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("references").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `references` to be an array in the JSON string but got `%s`", jsonObj.get("references").toString())); + } + + JsonArray jsonArrayreferences = jsonObj.getAsJsonArray("references"); + // validate the required field `references` (array) + for (int i = 0; i < jsonArrayreferences.size(); i++) { + ReferenceLinesModel.validateJsonElement(jsonArrayreferences.get(i)); + }; + if ((jsonObj.get("commitUrl") != null && !jsonObj.get("commitUrl").isJsonNull()) && !jsonObj.get("commitUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitUrl").toString())); + } + if ((jsonObj.get("commitHash") != null && !jsonObj.get("commitHash").isJsonNull()) && !jsonObj.get("commitHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitHash").toString())); + } + if ((jsonObj.get("repository") != null && !jsonObj.get("repository").isJsonNull()) && !jsonObj.get("repository").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `repository` to be a primitive type in the JSON string but got `%s`", jsonObj.get("repository").toString())); + } + if (!jsonObj.get("codeReferenceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `codeReferenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("codeReferenceId").toString())); + } + if ((jsonObj.get("uploader") != null && !jsonObj.get("uploader").isJsonNull()) && !jsonObj.get("uploader").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `uploader` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uploader").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CodeReferenceModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CodeReferenceModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CodeReferenceModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CodeReferenceModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CodeReferenceModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CodeReferenceModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CodeReferenceModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of CodeReferenceModel + * @throws IOException if the JSON string is invalid with respect to CodeReferenceModel + */ + public static CodeReferenceModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CodeReferenceModel.class); + } + + /** + * Convert an instance of CodeReferenceModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/CodeReferenceRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/CodeReferenceRequest.java new file mode 100644 index 0000000..ebe8a6b --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/CodeReferenceRequest.java @@ -0,0 +1,544 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.FlagReference; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * CodeReferenceRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class CodeReferenceRequest { + public static final String SERIALIZED_NAME_CONFIG_ID = "configId"; + @SerializedName(SERIALIZED_NAME_CONFIG_ID) + private UUID configId; + + public static final String SERIALIZED_NAME_REPOSITORY = "repository"; + @SerializedName(SERIALIZED_NAME_REPOSITORY) + private String repository; + + public static final String SERIALIZED_NAME_BRANCH = "branch"; + @SerializedName(SERIALIZED_NAME_BRANCH) + private String branch; + + public static final String SERIALIZED_NAME_COMMIT_URL = "commitUrl"; + @SerializedName(SERIALIZED_NAME_COMMIT_URL) + private String commitUrl; + + public static final String SERIALIZED_NAME_COMMIT_HASH = "commitHash"; + @SerializedName(SERIALIZED_NAME_COMMIT_HASH) + private String commitHash; + + public static final String SERIALIZED_NAME_UPLOADER = "uploader"; + @SerializedName(SERIALIZED_NAME_UPLOADER) + private String uploader; + + public static final String SERIALIZED_NAME_ACTIVE_BRANCHES = "activeBranches"; + @SerializedName(SERIALIZED_NAME_ACTIVE_BRANCHES) + private List activeBranches = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FLAG_REFERENCES = "flagReferences"; + @SerializedName(SERIALIZED_NAME_FLAG_REFERENCES) + private List flagReferences = new ArrayList<>(); + + public CodeReferenceRequest() { + } + + public CodeReferenceRequest configId(UUID configId) { + this.configId = configId; + return this; + } + + /** + * The Config's identifier the scanning was performed against. + * @return configId + */ + @javax.annotation.Nonnull + public UUID getConfigId() { + return configId; + } + + public void setConfigId(UUID configId) { + this.configId = configId; + } + + + public CodeReferenceRequest repository(String repository) { + this.repository = repository; + return this; + } + + /** + * The source control repository that contains the scanned code. (Source of the repository selector on the ConfigCat Dashboard) + * @return repository + */ + @javax.annotation.Nonnull + public String getRepository() { + return repository; + } + + public void setRepository(String repository) { + this.repository = repository; + } + + + public CodeReferenceRequest branch(String branch) { + this.branch = branch; + return this; + } + + /** + * The source control branch on where the scan was performed. (Source of the branch selector on the ConfigCat Dashboard) + * @return branch + */ + @javax.annotation.Nonnull + public String getBranch() { + return branch; + } + + public void setBranch(String branch) { + this.branch = branch; + } + + + public CodeReferenceRequest commitUrl(String commitUrl) { + this.commitUrl = commitUrl; + return this; + } + + /** + * The related commit's URL. (Appears on the ConfigCat Dashboard) + * @return commitUrl + */ + @javax.annotation.Nullable + public String getCommitUrl() { + return commitUrl; + } + + public void setCommitUrl(String commitUrl) { + this.commitUrl = commitUrl; + } + + + public CodeReferenceRequest commitHash(String commitHash) { + this.commitHash = commitHash; + return this; + } + + /** + * The related commit's hash. (Appears on the ConfigCat Dashboard) + * @return commitHash + */ + @javax.annotation.Nullable + public String getCommitHash() { + return commitHash; + } + + public void setCommitHash(String commitHash) { + this.commitHash = commitHash; + } + + + public CodeReferenceRequest uploader(String uploader) { + this.uploader = uploader; + return this; + } + + /** + * The scanning tool's name. (Appears on the ConfigCat Dashboard) + * @return uploader + */ + @javax.annotation.Nullable + public String getUploader() { + return uploader; + } + + public void setUploader(String uploader) { + this.uploader = uploader; + } + + + public CodeReferenceRequest activeBranches(List activeBranches) { + this.activeBranches = activeBranches; + return this; + } + + public CodeReferenceRequest addActiveBranchesItem(String activeBranchesItem) { + if (this.activeBranches == null) { + this.activeBranches = new ArrayList<>(); + } + this.activeBranches.add(activeBranchesItem); + return this; + } + + /** + * The currently active branches of the repository. Each previously uploaded report that belongs to a non-reported active branch is being deleted. + * @return activeBranches + */ + @javax.annotation.Nullable + public List getActiveBranches() { + return activeBranches; + } + + public void setActiveBranches(List activeBranches) { + this.activeBranches = activeBranches; + } + + + public CodeReferenceRequest flagReferences(List flagReferences) { + this.flagReferences = flagReferences; + return this; + } + + public CodeReferenceRequest addFlagReferencesItem(FlagReference flagReferencesItem) { + if (this.flagReferences == null) { + this.flagReferences = new ArrayList<>(); + } + this.flagReferences.add(flagReferencesItem); + return this; + } + + /** + * The actual code reference collection. + * @return flagReferences + */ + @javax.annotation.Nullable + public List getFlagReferences() { + return flagReferences; + } + + public void setFlagReferences(List flagReferences) { + this.flagReferences = flagReferences; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CodeReferenceRequest instance itself + */ + public CodeReferenceRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CodeReferenceRequest codeReferenceRequest = (CodeReferenceRequest) o; + return Objects.equals(this.configId, codeReferenceRequest.configId) && + Objects.equals(this.repository, codeReferenceRequest.repository) && + Objects.equals(this.branch, codeReferenceRequest.branch) && + Objects.equals(this.commitUrl, codeReferenceRequest.commitUrl) && + Objects.equals(this.commitHash, codeReferenceRequest.commitHash) && + Objects.equals(this.uploader, codeReferenceRequest.uploader) && + Objects.equals(this.activeBranches, codeReferenceRequest.activeBranches) && + Objects.equals(this.flagReferences, codeReferenceRequest.flagReferences)&& + Objects.equals(this.additionalProperties, codeReferenceRequest.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(configId, repository, branch, commitUrl, commitHash, uploader, activeBranches, flagReferences, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CodeReferenceRequest {\n"); + sb.append(" configId: ").append(toIndentedString(configId)).append("\n"); + sb.append(" repository: ").append(toIndentedString(repository)).append("\n"); + sb.append(" branch: ").append(toIndentedString(branch)).append("\n"); + sb.append(" commitUrl: ").append(toIndentedString(commitUrl)).append("\n"); + sb.append(" commitHash: ").append(toIndentedString(commitHash)).append("\n"); + sb.append(" uploader: ").append(toIndentedString(uploader)).append("\n"); + sb.append(" activeBranches: ").append(toIndentedString(activeBranches)).append("\n"); + sb.append(" flagReferences: ").append(toIndentedString(flagReferences)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("configId"); + openapiFields.add("repository"); + openapiFields.add("branch"); + openapiFields.add("commitUrl"); + openapiFields.add("commitHash"); + openapiFields.add("uploader"); + openapiFields.add("activeBranches"); + openapiFields.add("flagReferences"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("configId"); + openapiRequiredFields.add("repository"); + openapiRequiredFields.add("branch"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CodeReferenceRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CodeReferenceRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CodeReferenceRequest is not found in the empty JSON string", CodeReferenceRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CodeReferenceRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("configId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `configId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("configId").toString())); + } + if (!jsonObj.get("repository").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `repository` to be a primitive type in the JSON string but got `%s`", jsonObj.get("repository").toString())); + } + if (!jsonObj.get("branch").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `branch` to be a primitive type in the JSON string but got `%s`", jsonObj.get("branch").toString())); + } + if ((jsonObj.get("commitUrl") != null && !jsonObj.get("commitUrl").isJsonNull()) && !jsonObj.get("commitUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitUrl").toString())); + } + if ((jsonObj.get("commitHash") != null && !jsonObj.get("commitHash").isJsonNull()) && !jsonObj.get("commitHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitHash").toString())); + } + if ((jsonObj.get("uploader") != null && !jsonObj.get("uploader").isJsonNull()) && !jsonObj.get("uploader").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `uploader` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uploader").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("activeBranches") != null && !jsonObj.get("activeBranches").isJsonNull() && !jsonObj.get("activeBranches").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `activeBranches` to be an array in the JSON string but got `%s`", jsonObj.get("activeBranches").toString())); + } + if (jsonObj.get("flagReferences") != null && !jsonObj.get("flagReferences").isJsonNull()) { + JsonArray jsonArrayflagReferences = jsonObj.getAsJsonArray("flagReferences"); + if (jsonArrayflagReferences != null) { + // ensure the json data is an array + if (!jsonObj.get("flagReferences").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `flagReferences` to be an array in the JSON string but got `%s`", jsonObj.get("flagReferences").toString())); + } + + // validate the optional field `flagReferences` (array) + for (int i = 0; i < jsonArrayflagReferences.size(); i++) { + FlagReference.validateJsonElement(jsonArrayflagReferences.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CodeReferenceRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CodeReferenceRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CodeReferenceRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CodeReferenceRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CodeReferenceRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CodeReferenceRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CodeReferenceRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CodeReferenceRequest + * @throws IOException if the JSON string is invalid with respect to CodeReferenceRequest + */ + public static CodeReferenceRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CodeReferenceRequest.class); + } + + /** + * Convert an instance of CodeReferenceRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ComparisonValueListModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ComparisonValueListModel.java new file mode 100644 index 0000000..8bc98cf --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/ComparisonValueListModel.java @@ -0,0 +1,336 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * ComparisonValueListModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ComparisonValueListModel { + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_HINT = "hint"; + @SerializedName(SERIALIZED_NAME_HINT) + private String hint; + + public ComparisonValueListModel() { + } + + public ComparisonValueListModel value(String value) { + this.value = value; + return this; + } + + /** + * The actual comparison value. + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + + public ComparisonValueListModel hint(String hint) { + this.hint = hint; + return this; + } + + /** + * An optional hint for the comparison value. + * @return hint + */ + @javax.annotation.Nullable + public String getHint() { + return hint; + } + + public void setHint(String hint) { + this.hint = hint; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ComparisonValueListModel instance itself + */ + public ComparisonValueListModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ComparisonValueListModel comparisonValueListModel = (ComparisonValueListModel) o; + return Objects.equals(this.value, comparisonValueListModel.value) && + Objects.equals(this.hint, comparisonValueListModel.hint)&& + Objects.equals(this.additionalProperties, comparisonValueListModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(value, hint, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ComparisonValueListModel {\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" hint: ").append(toIndentedString(hint)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("value"); + openapiFields.add("hint"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ComparisonValueListModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ComparisonValueListModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ComparisonValueListModel is not found in the empty JSON string", ComparisonValueListModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ComparisonValueListModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + if ((jsonObj.get("hint") != null && !jsonObj.get("hint").isJsonNull()) && !jsonObj.get("hint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hint").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ComparisonValueListModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ComparisonValueListModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ComparisonValueListModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ComparisonValueListModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ComparisonValueListModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ComparisonValueListModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ComparisonValueListModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ComparisonValueListModel + * @throws IOException if the JSON string is invalid with respect to ComparisonValueListModel + */ + public static ComparisonValueListModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ComparisonValueListModel.class); + } + + /** + * Convert an instance of ComparisonValueListModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ComparisonValueModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ComparisonValueModel.java new file mode 100644 index 0000000..7482201 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/ComparisonValueModel.java @@ -0,0 +1,376 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.ComparisonValueListModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * The value that the user object's attribute is compared to. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ComparisonValueModel { + public static final String SERIALIZED_NAME_STRING_VALUE = "stringValue"; + @SerializedName(SERIALIZED_NAME_STRING_VALUE) + private String stringValue; + + public static final String SERIALIZED_NAME_DOUBLE_VALUE = "doubleValue"; + @SerializedName(SERIALIZED_NAME_DOUBLE_VALUE) + private Double doubleValue; + + public static final String SERIALIZED_NAME_LIST_VALUE = "listValue"; + @SerializedName(SERIALIZED_NAME_LIST_VALUE) + private List listValue; + + public ComparisonValueModel() { + } + + public ComparisonValueModel stringValue(String stringValue) { + this.stringValue = stringValue; + return this; + } + + /** + * The string representation of the comparison value. + * @return stringValue + */ + @javax.annotation.Nullable + public String getStringValue() { + return stringValue; + } + + public void setStringValue(String stringValue) { + this.stringValue = stringValue; + } + + + public ComparisonValueModel doubleValue(Double doubleValue) { + this.doubleValue = doubleValue; + return this; + } + + /** + * The number representation of the comparison value. + * @return doubleValue + */ + @javax.annotation.Nullable + public Double getDoubleValue() { + return doubleValue; + } + + public void setDoubleValue(Double doubleValue) { + this.doubleValue = doubleValue; + } + + + public ComparisonValueModel listValue(List listValue) { + this.listValue = listValue; + return this; + } + + public ComparisonValueModel addListValueItem(ComparisonValueListModel listValueItem) { + if (this.listValue == null) { + this.listValue = new ArrayList<>(); + } + this.listValue.add(listValueItem); + return this; + } + + /** + * The list representation of the comparison value. + * @return listValue + */ + @javax.annotation.Nullable + public List getListValue() { + return listValue; + } + + public void setListValue(List listValue) { + this.listValue = listValue; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ComparisonValueModel instance itself + */ + public ComparisonValueModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ComparisonValueModel comparisonValueModel = (ComparisonValueModel) o; + return Objects.equals(this.stringValue, comparisonValueModel.stringValue) && + Objects.equals(this.doubleValue, comparisonValueModel.doubleValue) && + Objects.equals(this.listValue, comparisonValueModel.listValue)&& + Objects.equals(this.additionalProperties, comparisonValueModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(stringValue, doubleValue, listValue, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ComparisonValueModel {\n"); + sb.append(" stringValue: ").append(toIndentedString(stringValue)).append("\n"); + sb.append(" doubleValue: ").append(toIndentedString(doubleValue)).append("\n"); + sb.append(" listValue: ").append(toIndentedString(listValue)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("stringValue"); + openapiFields.add("doubleValue"); + openapiFields.add("listValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ComparisonValueModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ComparisonValueModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ComparisonValueModel is not found in the empty JSON string", ComparisonValueModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("stringValue") != null && !jsonObj.get("stringValue").isJsonNull()) && !jsonObj.get("stringValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stringValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stringValue").toString())); + } + if (jsonObj.get("listValue") != null && !jsonObj.get("listValue").isJsonNull()) { + JsonArray jsonArraylistValue = jsonObj.getAsJsonArray("listValue"); + if (jsonArraylistValue != null) { + // ensure the json data is an array + if (!jsonObj.get("listValue").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `listValue` to be an array in the JSON string but got `%s`", jsonObj.get("listValue").toString())); + } + + // validate the optional field `listValue` (array) + for (int i = 0; i < jsonArraylistValue.size(); i++) { + ComparisonValueListModel.validateJsonElement(jsonArraylistValue.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ComparisonValueModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ComparisonValueModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ComparisonValueModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ComparisonValueModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ComparisonValueModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ComparisonValueModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ComparisonValueModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ComparisonValueModel + * @throws IOException if the JSON string is invalid with respect to ComparisonValueModel + */ + public static ComparisonValueModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ComparisonValueModel.class); + } + + /** + * Convert an instance of ComparisonValueModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ConditionModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ConditionModel.java new file mode 100644 index 0000000..00c11d4 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/ConditionModel.java @@ -0,0 +1,355 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.PrerequisiteFlagConditionModel; +import com.configcat.publicapi.java.client.model.SegmentConditionModel; +import com.configcat.publicapi.java.client.model.UserConditionModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * ConditionModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ConditionModel { + public static final String SERIALIZED_NAME_USER_CONDITION = "userCondition"; + @SerializedName(SERIALIZED_NAME_USER_CONDITION) + private UserConditionModel userCondition; + + public static final String SERIALIZED_NAME_SEGMENT_CONDITION = "segmentCondition"; + @SerializedName(SERIALIZED_NAME_SEGMENT_CONDITION) + private SegmentConditionModel segmentCondition; + + public static final String SERIALIZED_NAME_PREREQUISITE_FLAG_CONDITION = "prerequisiteFlagCondition"; + @SerializedName(SERIALIZED_NAME_PREREQUISITE_FLAG_CONDITION) + private PrerequisiteFlagConditionModel prerequisiteFlagCondition; + + public ConditionModel() { + } + + public ConditionModel userCondition(UserConditionModel userCondition) { + this.userCondition = userCondition; + return this; + } + + /** + * Get userCondition + * @return userCondition + */ + @javax.annotation.Nullable + public UserConditionModel getUserCondition() { + return userCondition; + } + + public void setUserCondition(UserConditionModel userCondition) { + this.userCondition = userCondition; + } + + + public ConditionModel segmentCondition(SegmentConditionModel segmentCondition) { + this.segmentCondition = segmentCondition; + return this; + } + + /** + * Get segmentCondition + * @return segmentCondition + */ + @javax.annotation.Nullable + public SegmentConditionModel getSegmentCondition() { + return segmentCondition; + } + + public void setSegmentCondition(SegmentConditionModel segmentCondition) { + this.segmentCondition = segmentCondition; + } + + + public ConditionModel prerequisiteFlagCondition(PrerequisiteFlagConditionModel prerequisiteFlagCondition) { + this.prerequisiteFlagCondition = prerequisiteFlagCondition; + return this; + } + + /** + * Get prerequisiteFlagCondition + * @return prerequisiteFlagCondition + */ + @javax.annotation.Nullable + public PrerequisiteFlagConditionModel getPrerequisiteFlagCondition() { + return prerequisiteFlagCondition; + } + + public void setPrerequisiteFlagCondition(PrerequisiteFlagConditionModel prerequisiteFlagCondition) { + this.prerequisiteFlagCondition = prerequisiteFlagCondition; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConditionModel instance itself + */ + public ConditionModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConditionModel conditionModel = (ConditionModel) o; + return Objects.equals(this.userCondition, conditionModel.userCondition) && + Objects.equals(this.segmentCondition, conditionModel.segmentCondition) && + Objects.equals(this.prerequisiteFlagCondition, conditionModel.prerequisiteFlagCondition)&& + Objects.equals(this.additionalProperties, conditionModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(userCondition, segmentCondition, prerequisiteFlagCondition, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConditionModel {\n"); + sb.append(" userCondition: ").append(toIndentedString(userCondition)).append("\n"); + sb.append(" segmentCondition: ").append(toIndentedString(segmentCondition)).append("\n"); + sb.append(" prerequisiteFlagCondition: ").append(toIndentedString(prerequisiteFlagCondition)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("userCondition"); + openapiFields.add("segmentCondition"); + openapiFields.add("prerequisiteFlagCondition"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("userCondition"); + openapiRequiredFields.add("segmentCondition"); + openapiRequiredFields.add("prerequisiteFlagCondition"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ConditionModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConditionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConditionModel is not found in the empty JSON string", ConditionModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConditionModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `userCondition` + UserConditionModel.validateJsonElement(jsonObj.get("userCondition")); + // validate the required field `segmentCondition` + SegmentConditionModel.validateJsonElement(jsonObj.get("segmentCondition")); + // validate the required field `prerequisiteFlagCondition` + PrerequisiteFlagConditionModel.validateJsonElement(jsonObj.get("prerequisiteFlagCondition")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConditionModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConditionModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConditionModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConditionModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConditionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConditionModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConditionModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConditionModel + * @throws IOException if the JSON string is invalid with respect to ConditionModel + */ + public static ConditionModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConditionModel.class); + } + + /** + * Convert an instance of ConditionModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ConfigModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ConfigModel.java new file mode 100644 index 0000000..8669153 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/ConfigModel.java @@ -0,0 +1,473 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.EvaluationVersion; +import com.configcat.publicapi.java.client.model.ProductModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Details of the Config. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ConfigModel { + public static final String SERIALIZED_NAME_PRODUCT = "product"; + @SerializedName(SERIALIZED_NAME_PRODUCT) + private ProductModel product; + + public static final String SERIALIZED_NAME_CONFIG_ID = "configId"; + @SerializedName(SERIALIZED_NAME_CONFIG_ID) + private UUID configId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_ORDER = "order"; + @SerializedName(SERIALIZED_NAME_ORDER) + private Integer order; + + public static final String SERIALIZED_NAME_MIGRATED_CONFIG_ID = "migratedConfigId"; + @SerializedName(SERIALIZED_NAME_MIGRATED_CONFIG_ID) + private UUID migratedConfigId; + + public static final String SERIALIZED_NAME_EVALUATION_VERSION = "evaluationVersion"; + @SerializedName(SERIALIZED_NAME_EVALUATION_VERSION) + private EvaluationVersion evaluationVersion; + + public ConfigModel() { + } + + public ConfigModel product(ProductModel product) { + this.product = product; + return this; + } + + /** + * Get product + * @return product + */ + @javax.annotation.Nonnull + public ProductModel getProduct() { + return product; + } + + public void setProduct(ProductModel product) { + this.product = product; + } + + + public ConfigModel configId(UUID configId) { + this.configId = configId; + return this; + } + + /** + * Identifier of the Config. + * @return configId + */ + @javax.annotation.Nonnull + public UUID getConfigId() { + return configId; + } + + public void setConfigId(UUID configId) { + this.configId = configId; + } + + + public ConfigModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Config. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public ConfigModel description(String description) { + this.description = description; + return this; + } + + /** + * Description of the Config. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + + public ConfigModel order(Integer order) { + this.order = order; + return this; + } + + /** + * The order of the Config represented on the ConfigCat Dashboard. + * @return order + */ + @javax.annotation.Nonnull + public Integer getOrder() { + return order; + } + + public void setOrder(Integer order) { + this.order = order; + } + + + public ConfigModel migratedConfigId(UUID migratedConfigId) { + this.migratedConfigId = migratedConfigId; + return this; + } + + /** + * Get migratedConfigId + * @return migratedConfigId + */ + @javax.annotation.Nullable + public UUID getMigratedConfigId() { + return migratedConfigId; + } + + public void setMigratedConfigId(UUID migratedConfigId) { + this.migratedConfigId = migratedConfigId; + } + + + public ConfigModel evaluationVersion(EvaluationVersion evaluationVersion) { + this.evaluationVersion = evaluationVersion; + return this; + } + + /** + * Get evaluationVersion + * @return evaluationVersion + */ + @javax.annotation.Nonnull + public EvaluationVersion getEvaluationVersion() { + return evaluationVersion; + } + + public void setEvaluationVersion(EvaluationVersion evaluationVersion) { + this.evaluationVersion = evaluationVersion; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConfigModel instance itself + */ + public ConfigModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConfigModel configModel = (ConfigModel) o; + return Objects.equals(this.product, configModel.product) && + Objects.equals(this.configId, configModel.configId) && + Objects.equals(this.name, configModel.name) && + Objects.equals(this.description, configModel.description) && + Objects.equals(this.order, configModel.order) && + Objects.equals(this.migratedConfigId, configModel.migratedConfigId) && + Objects.equals(this.evaluationVersion, configModel.evaluationVersion)&& + Objects.equals(this.additionalProperties, configModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(product, configId, name, description, order, migratedConfigId, evaluationVersion, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConfigModel {\n"); + sb.append(" product: ").append(toIndentedString(product)).append("\n"); + sb.append(" configId: ").append(toIndentedString(configId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append(" migratedConfigId: ").append(toIndentedString(migratedConfigId)).append("\n"); + sb.append(" evaluationVersion: ").append(toIndentedString(evaluationVersion)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("product"); + openapiFields.add("configId"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("order"); + openapiFields.add("migratedConfigId"); + openapiFields.add("evaluationVersion"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("product"); + openapiRequiredFields.add("configId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("order"); + openapiRequiredFields.add("migratedConfigId"); + openapiRequiredFields.add("evaluationVersion"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ConfigModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConfigModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConfigModel is not found in the empty JSON string", ConfigModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConfigModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `product` + ProductModel.validateJsonElement(jsonObj.get("product")); + if (!jsonObj.get("configId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `configId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("configId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if ((jsonObj.get("migratedConfigId") != null && !jsonObj.get("migratedConfigId").isJsonNull()) && !jsonObj.get("migratedConfigId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `migratedConfigId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("migratedConfigId").toString())); + } + // validate the required field `evaluationVersion` + EvaluationVersion.validateJsonElement(jsonObj.get("evaluationVersion")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConfigModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConfigModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConfigModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConfigModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConfigModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConfigModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConfigModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConfigModel + * @throws IOException if the JSON string is invalid with respect to ConfigModel + */ + public static ConfigModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConfigModel.class); + } + + /** + * Convert an instance of ConfigModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulaModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulaModel.java new file mode 100644 index 0000000..c916ec6 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulaModel.java @@ -0,0 +1,655 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.IntegrationLinkModel; +import com.configcat.publicapi.java.client.model.SettingDataModel; +import com.configcat.publicapi.java.client.model.SettingTagModel; +import com.configcat.publicapi.java.client.model.TargetingRuleModel; +import com.configcat.publicapi.java.client.model.ValueModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * ConfigSettingFormulaModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ConfigSettingFormulaModel { + public static final String SERIALIZED_NAME_LAST_VERSION_ID = "lastVersionId"; + @SerializedName(SERIALIZED_NAME_LAST_VERSION_ID) + private UUID lastVersionId; + + public static final String SERIALIZED_NAME_DEFAULT_VALUE = "defaultValue"; + @SerializedName(SERIALIZED_NAME_DEFAULT_VALUE) + private ValueModel defaultValue; + + public static final String SERIALIZED_NAME_TARGETING_RULES = "targetingRules"; + @SerializedName(SERIALIZED_NAME_TARGETING_RULES) + private List targetingRules = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SETTING = "setting"; + @SerializedName(SERIALIZED_NAME_SETTING) + private SettingDataModel setting; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_PERCENTAGE_EVALUATION_ATTRIBUTE = "percentageEvaluationAttribute"; + @SerializedName(SERIALIZED_NAME_PERCENTAGE_EVALUATION_ATTRIBUTE) + private String percentageEvaluationAttribute; + + public static final String SERIALIZED_NAME_LAST_UPDATER_USER_EMAIL = "lastUpdaterUserEmail"; + @SerializedName(SERIALIZED_NAME_LAST_UPDATER_USER_EMAIL) + private String lastUpdaterUserEmail; + + public static final String SERIALIZED_NAME_LAST_UPDATER_USER_FULL_NAME = "lastUpdaterUserFullName"; + @SerializedName(SERIALIZED_NAME_LAST_UPDATER_USER_FULL_NAME) + private String lastUpdaterUserFullName; + + public static final String SERIALIZED_NAME_INTEGRATION_LINKS = "integrationLinks"; + @SerializedName(SERIALIZED_NAME_INTEGRATION_LINKS) + private List integrationLinks = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SETTING_TAGS = "settingTags"; + @SerializedName(SERIALIZED_NAME_SETTING_TAGS) + private List settingTags = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SETTING_IDS_WHERE_PREREQUISITE = "settingIdsWherePrerequisite"; + @SerializedName(SERIALIZED_NAME_SETTING_IDS_WHERE_PREREQUISITE) + private List settingIdsWherePrerequisite = new ArrayList<>(); + + public ConfigSettingFormulaModel() { + } + + public ConfigSettingFormulaModel lastVersionId(UUID lastVersionId) { + this.lastVersionId = lastVersionId; + return this; + } + + /** + * Get lastVersionId + * @return lastVersionId + */ + @javax.annotation.Nonnull + public UUID getLastVersionId() { + return lastVersionId; + } + + public void setLastVersionId(UUID lastVersionId) { + this.lastVersionId = lastVersionId; + } + + + public ConfigSettingFormulaModel defaultValue(ValueModel defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + /** + * Get defaultValue + * @return defaultValue + */ + @javax.annotation.Nonnull + public ValueModel getDefaultValue() { + return defaultValue; + } + + public void setDefaultValue(ValueModel defaultValue) { + this.defaultValue = defaultValue; + } + + + public ConfigSettingFormulaModel targetingRules(List targetingRules) { + this.targetingRules = targetingRules; + return this; + } + + public ConfigSettingFormulaModel addTargetingRulesItem(TargetingRuleModel targetingRulesItem) { + if (this.targetingRules == null) { + this.targetingRules = new ArrayList<>(); + } + this.targetingRules.add(targetingRulesItem); + return this; + } + + /** + * The targeting rules of the Feature Flag or Setting. + * @return targetingRules + */ + @javax.annotation.Nonnull + public List getTargetingRules() { + return targetingRules; + } + + public void setTargetingRules(List targetingRules) { + this.targetingRules = targetingRules; + } + + + public ConfigSettingFormulaModel setting(SettingDataModel setting) { + this.setting = setting; + return this; + } + + /** + * Get setting + * @return setting + */ + @javax.annotation.Nonnull + public SettingDataModel getSetting() { + return setting; + } + + public void setSetting(SettingDataModel setting) { + this.setting = setting; + } + + + public ConfigSettingFormulaModel updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * The last updated date and time when the Feature Flag or Setting. + * @return updatedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + public ConfigSettingFormulaModel percentageEvaluationAttribute(String percentageEvaluationAttribute) { + this.percentageEvaluationAttribute = percentageEvaluationAttribute; + return this; + } + + /** + * The user attribute used for percentage evaluation. If not set, it defaults to the `Identifier` user object attribute. + * @return percentageEvaluationAttribute + */ + @javax.annotation.Nullable + public String getPercentageEvaluationAttribute() { + return percentageEvaluationAttribute; + } + + public void setPercentageEvaluationAttribute(String percentageEvaluationAttribute) { + this.percentageEvaluationAttribute = percentageEvaluationAttribute; + } + + + public ConfigSettingFormulaModel lastUpdaterUserEmail(String lastUpdaterUserEmail) { + this.lastUpdaterUserEmail = lastUpdaterUserEmail; + return this; + } + + /** + * The email of the user who last updated the Feature Flag or Setting. + * @return lastUpdaterUserEmail + */ + @javax.annotation.Nullable + public String getLastUpdaterUserEmail() { + return lastUpdaterUserEmail; + } + + public void setLastUpdaterUserEmail(String lastUpdaterUserEmail) { + this.lastUpdaterUserEmail = lastUpdaterUserEmail; + } + + + public ConfigSettingFormulaModel lastUpdaterUserFullName(String lastUpdaterUserFullName) { + this.lastUpdaterUserFullName = lastUpdaterUserFullName; + return this; + } + + /** + * The name of the user who last updated the Feature Flag or Setting. + * @return lastUpdaterUserFullName + */ + @javax.annotation.Nullable + public String getLastUpdaterUserFullName() { + return lastUpdaterUserFullName; + } + + public void setLastUpdaterUserFullName(String lastUpdaterUserFullName) { + this.lastUpdaterUserFullName = lastUpdaterUserFullName; + } + + + public ConfigSettingFormulaModel integrationLinks(List integrationLinks) { + this.integrationLinks = integrationLinks; + return this; + } + + public ConfigSettingFormulaModel addIntegrationLinksItem(IntegrationLinkModel integrationLinksItem) { + if (this.integrationLinks == null) { + this.integrationLinks = new ArrayList<>(); + } + this.integrationLinks.add(integrationLinksItem); + return this; + } + + /** + * The integration links attached to the Feature Flag or Setting. + * @return integrationLinks + */ + @javax.annotation.Nonnull + public List getIntegrationLinks() { + return integrationLinks; + } + + public void setIntegrationLinks(List integrationLinks) { + this.integrationLinks = integrationLinks; + } + + + public ConfigSettingFormulaModel settingTags(List settingTags) { + this.settingTags = settingTags; + return this; + } + + public ConfigSettingFormulaModel addSettingTagsItem(SettingTagModel settingTagsItem) { + if (this.settingTags == null) { + this.settingTags = new ArrayList<>(); + } + this.settingTags.add(settingTagsItem); + return this; + } + + /** + * The tags attached to the Feature Flag or Setting. + * @return settingTags + */ + @javax.annotation.Nonnull + public List getSettingTags() { + return settingTags; + } + + public void setSettingTags(List settingTags) { + this.settingTags = settingTags; + } + + + public ConfigSettingFormulaModel settingIdsWherePrerequisite(List settingIdsWherePrerequisite) { + this.settingIdsWherePrerequisite = settingIdsWherePrerequisite; + return this; + } + + public ConfigSettingFormulaModel addSettingIdsWherePrerequisiteItem(Integer settingIdsWherePrerequisiteItem) { + if (this.settingIdsWherePrerequisite == null) { + this.settingIdsWherePrerequisite = new ArrayList<>(); + } + this.settingIdsWherePrerequisite.add(settingIdsWherePrerequisiteItem); + return this; + } + + /** + * List of Feature Flag and Setting IDs where the actual Feature Flag or Setting is prerequisite. + * @return settingIdsWherePrerequisite + */ + @javax.annotation.Nonnull + public List getSettingIdsWherePrerequisite() { + return settingIdsWherePrerequisite; + } + + public void setSettingIdsWherePrerequisite(List settingIdsWherePrerequisite) { + this.settingIdsWherePrerequisite = settingIdsWherePrerequisite; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConfigSettingFormulaModel instance itself + */ + public ConfigSettingFormulaModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConfigSettingFormulaModel configSettingFormulaModel = (ConfigSettingFormulaModel) o; + return Objects.equals(this.lastVersionId, configSettingFormulaModel.lastVersionId) && + Objects.equals(this.defaultValue, configSettingFormulaModel.defaultValue) && + Objects.equals(this.targetingRules, configSettingFormulaModel.targetingRules) && + Objects.equals(this.setting, configSettingFormulaModel.setting) && + Objects.equals(this.updatedAt, configSettingFormulaModel.updatedAt) && + Objects.equals(this.percentageEvaluationAttribute, configSettingFormulaModel.percentageEvaluationAttribute) && + Objects.equals(this.lastUpdaterUserEmail, configSettingFormulaModel.lastUpdaterUserEmail) && + Objects.equals(this.lastUpdaterUserFullName, configSettingFormulaModel.lastUpdaterUserFullName) && + Objects.equals(this.integrationLinks, configSettingFormulaModel.integrationLinks) && + Objects.equals(this.settingTags, configSettingFormulaModel.settingTags) && + Objects.equals(this.settingIdsWherePrerequisite, configSettingFormulaModel.settingIdsWherePrerequisite)&& + Objects.equals(this.additionalProperties, configSettingFormulaModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(lastVersionId, defaultValue, targetingRules, setting, updatedAt, percentageEvaluationAttribute, lastUpdaterUserEmail, lastUpdaterUserFullName, integrationLinks, settingTags, settingIdsWherePrerequisite, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConfigSettingFormulaModel {\n"); + sb.append(" lastVersionId: ").append(toIndentedString(lastVersionId)).append("\n"); + sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); + sb.append(" targetingRules: ").append(toIndentedString(targetingRules)).append("\n"); + sb.append(" setting: ").append(toIndentedString(setting)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" percentageEvaluationAttribute: ").append(toIndentedString(percentageEvaluationAttribute)).append("\n"); + sb.append(" lastUpdaterUserEmail: ").append(toIndentedString(lastUpdaterUserEmail)).append("\n"); + sb.append(" lastUpdaterUserFullName: ").append(toIndentedString(lastUpdaterUserFullName)).append("\n"); + sb.append(" integrationLinks: ").append(toIndentedString(integrationLinks)).append("\n"); + sb.append(" settingTags: ").append(toIndentedString(settingTags)).append("\n"); + sb.append(" settingIdsWherePrerequisite: ").append(toIndentedString(settingIdsWherePrerequisite)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("lastVersionId"); + openapiFields.add("defaultValue"); + openapiFields.add("targetingRules"); + openapiFields.add("setting"); + openapiFields.add("updatedAt"); + openapiFields.add("percentageEvaluationAttribute"); + openapiFields.add("lastUpdaterUserEmail"); + openapiFields.add("lastUpdaterUserFullName"); + openapiFields.add("integrationLinks"); + openapiFields.add("settingTags"); + openapiFields.add("settingIdsWherePrerequisite"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("lastVersionId"); + openapiRequiredFields.add("defaultValue"); + openapiRequiredFields.add("targetingRules"); + openapiRequiredFields.add("setting"); + openapiRequiredFields.add("updatedAt"); + openapiRequiredFields.add("percentageEvaluationAttribute"); + openapiRequiredFields.add("lastUpdaterUserEmail"); + openapiRequiredFields.add("lastUpdaterUserFullName"); + openapiRequiredFields.add("integrationLinks"); + openapiRequiredFields.add("settingTags"); + openapiRequiredFields.add("settingIdsWherePrerequisite"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ConfigSettingFormulaModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConfigSettingFormulaModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConfigSettingFormulaModel is not found in the empty JSON string", ConfigSettingFormulaModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConfigSettingFormulaModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("lastVersionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastVersionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastVersionId").toString())); + } + // validate the required field `defaultValue` + ValueModel.validateJsonElement(jsonObj.get("defaultValue")); + // ensure the json data is an array + if (!jsonObj.get("targetingRules").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `targetingRules` to be an array in the JSON string but got `%s`", jsonObj.get("targetingRules").toString())); + } + + JsonArray jsonArraytargetingRules = jsonObj.getAsJsonArray("targetingRules"); + // validate the required field `targetingRules` (array) + for (int i = 0; i < jsonArraytargetingRules.size(); i++) { + TargetingRuleModel.validateJsonElement(jsonArraytargetingRules.get(i)); + }; + // validate the required field `setting` + SettingDataModel.validateJsonElement(jsonObj.get("setting")); + if ((jsonObj.get("percentageEvaluationAttribute") != null && !jsonObj.get("percentageEvaluationAttribute").isJsonNull()) && !jsonObj.get("percentageEvaluationAttribute").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `percentageEvaluationAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("percentageEvaluationAttribute").toString())); + } + if ((jsonObj.get("lastUpdaterUserEmail") != null && !jsonObj.get("lastUpdaterUserEmail").isJsonNull()) && !jsonObj.get("lastUpdaterUserEmail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterUserEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterUserEmail").toString())); + } + if ((jsonObj.get("lastUpdaterUserFullName") != null && !jsonObj.get("lastUpdaterUserFullName").isJsonNull()) && !jsonObj.get("lastUpdaterUserFullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterUserFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterUserFullName").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("integrationLinks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `integrationLinks` to be an array in the JSON string but got `%s`", jsonObj.get("integrationLinks").toString())); + } + + JsonArray jsonArrayintegrationLinks = jsonObj.getAsJsonArray("integrationLinks"); + // validate the required field `integrationLinks` (array) + for (int i = 0; i < jsonArrayintegrationLinks.size(); i++) { + IntegrationLinkModel.validateJsonElement(jsonArrayintegrationLinks.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("settingTags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `settingTags` to be an array in the JSON string but got `%s`", jsonObj.get("settingTags").toString())); + } + + JsonArray jsonArraysettingTags = jsonObj.getAsJsonArray("settingTags"); + // validate the required field `settingTags` (array) + for (int i = 0; i < jsonArraysettingTags.size(); i++) { + SettingTagModel.validateJsonElement(jsonArraysettingTags.get(i)); + }; + // ensure the required json array is present + if (jsonObj.get("settingIdsWherePrerequisite") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("settingIdsWherePrerequisite").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `settingIdsWherePrerequisite` to be an array in the JSON string but got `%s`", jsonObj.get("settingIdsWherePrerequisite").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConfigSettingFormulaModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConfigSettingFormulaModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConfigSettingFormulaModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConfigSettingFormulaModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConfigSettingFormulaModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConfigSettingFormulaModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConfigSettingFormulaModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConfigSettingFormulaModel + * @throws IOException if the JSON string is invalid with respect to ConfigSettingFormulaModel + */ + public static ConfigSettingFormulaModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConfigSettingFormulaModel.class); + } + + /** + * Convert an instance of ConfigSettingFormulaModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulasModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulasModel.java new file mode 100644 index 0000000..149991c --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulasModel.java @@ -0,0 +1,430 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.ConfigModel; +import com.configcat.publicapi.java.client.model.ConfigSettingFormulaModel; +import com.configcat.publicapi.java.client.model.EnvironmentModel; +import com.configcat.publicapi.java.client.model.FeatureFlagLimitations; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * ConfigSettingFormulasModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ConfigSettingFormulasModel { + public static final String SERIALIZED_NAME_CONFIG = "config"; + @SerializedName(SERIALIZED_NAME_CONFIG) + private ConfigModel config; + + public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT) + private EnvironmentModel environment; + + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public static final String SERIALIZED_NAME_SETTING_FORMULAS = "settingFormulas"; + @SerializedName(SERIALIZED_NAME_SETTING_FORMULAS) + private List settingFormulas = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FEATURE_FLAG_LIMITATIONS = "featureFlagLimitations"; + @SerializedName(SERIALIZED_NAME_FEATURE_FLAG_LIMITATIONS) + private FeatureFlagLimitations featureFlagLimitations; + + public ConfigSettingFormulasModel() { + } + + public ConfigSettingFormulasModel config(ConfigModel config) { + this.config = config; + return this; + } + + /** + * Get config + * @return config + */ + @javax.annotation.Nonnull + public ConfigModel getConfig() { + return config; + } + + public void setConfig(ConfigModel config) { + this.config = config; + } + + + public ConfigSettingFormulasModel environment(EnvironmentModel environment) { + this.environment = environment; + return this; + } + + /** + * Get environment + * @return environment + */ + @javax.annotation.Nonnull + public EnvironmentModel getEnvironment() { + return environment; + } + + public void setEnvironment(EnvironmentModel environment) { + this.environment = environment; + } + + + public ConfigSettingFormulasModel readOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Get readOnly + * @return readOnly + */ + @javax.annotation.Nonnull + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + + public ConfigSettingFormulasModel settingFormulas(List settingFormulas) { + this.settingFormulas = settingFormulas; + return this; + } + + public ConfigSettingFormulasModel addSettingFormulasItem(ConfigSettingFormulaModel settingFormulasItem) { + if (this.settingFormulas == null) { + this.settingFormulas = new ArrayList<>(); + } + this.settingFormulas.add(settingFormulasItem); + return this; + } + + /** + * Evaluation descriptors of each updated Feature Flag and Setting. + * @return settingFormulas + */ + @javax.annotation.Nonnull + public List getSettingFormulas() { + return settingFormulas; + } + + public void setSettingFormulas(List settingFormulas) { + this.settingFormulas = settingFormulas; + } + + + public ConfigSettingFormulasModel featureFlagLimitations(FeatureFlagLimitations featureFlagLimitations) { + this.featureFlagLimitations = featureFlagLimitations; + return this; + } + + /** + * Get featureFlagLimitations + * @return featureFlagLimitations + */ + @javax.annotation.Nonnull + public FeatureFlagLimitations getFeatureFlagLimitations() { + return featureFlagLimitations; + } + + public void setFeatureFlagLimitations(FeatureFlagLimitations featureFlagLimitations) { + this.featureFlagLimitations = featureFlagLimitations; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConfigSettingFormulasModel instance itself + */ + public ConfigSettingFormulasModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConfigSettingFormulasModel configSettingFormulasModel = (ConfigSettingFormulasModel) o; + return Objects.equals(this.config, configSettingFormulasModel.config) && + Objects.equals(this.environment, configSettingFormulasModel.environment) && + Objects.equals(this.readOnly, configSettingFormulasModel.readOnly) && + Objects.equals(this.settingFormulas, configSettingFormulasModel.settingFormulas) && + Objects.equals(this.featureFlagLimitations, configSettingFormulasModel.featureFlagLimitations)&& + Objects.equals(this.additionalProperties, configSettingFormulasModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(config, environment, readOnly, settingFormulas, featureFlagLimitations, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConfigSettingFormulasModel {\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); + sb.append(" settingFormulas: ").append(toIndentedString(settingFormulas)).append("\n"); + sb.append(" featureFlagLimitations: ").append(toIndentedString(featureFlagLimitations)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("config"); + openapiFields.add("environment"); + openapiFields.add("readOnly"); + openapiFields.add("settingFormulas"); + openapiFields.add("featureFlagLimitations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("config"); + openapiRequiredFields.add("environment"); + openapiRequiredFields.add("readOnly"); + openapiRequiredFields.add("settingFormulas"); + openapiRequiredFields.add("featureFlagLimitations"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ConfigSettingFormulasModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConfigSettingFormulasModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConfigSettingFormulasModel is not found in the empty JSON string", ConfigSettingFormulasModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConfigSettingFormulasModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `config` + ConfigModel.validateJsonElement(jsonObj.get("config")); + // validate the required field `environment` + EnvironmentModel.validateJsonElement(jsonObj.get("environment")); + // ensure the json data is an array + if (!jsonObj.get("settingFormulas").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `settingFormulas` to be an array in the JSON string but got `%s`", jsonObj.get("settingFormulas").toString())); + } + + JsonArray jsonArraysettingFormulas = jsonObj.getAsJsonArray("settingFormulas"); + // validate the required field `settingFormulas` (array) + for (int i = 0; i < jsonArraysettingFormulas.size(); i++) { + ConfigSettingFormulaModel.validateJsonElement(jsonArraysettingFormulas.get(i)); + }; + // validate the required field `featureFlagLimitations` + FeatureFlagLimitations.validateJsonElement(jsonObj.get("featureFlagLimitations")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConfigSettingFormulasModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConfigSettingFormulasModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConfigSettingFormulasModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConfigSettingFormulasModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConfigSettingFormulasModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConfigSettingFormulasModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConfigSettingFormulasModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConfigSettingFormulasModel + * @throws IOException if the JSON string is invalid with respect to ConfigSettingFormulasModel + */ + public static ConfigSettingFormulasModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConfigSettingFormulasModel.class); + } + + /** + * Convert an instance of ConfigSettingFormulasModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingValueModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingValueModel.java new file mode 100644 index 0000000..9dc292a --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingValueModel.java @@ -0,0 +1,599 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.IntegrationLinkModel; +import com.configcat.publicapi.java.client.model.RolloutPercentageItemModel; +import com.configcat.publicapi.java.client.model.RolloutRuleModel; +import com.configcat.publicapi.java.client.model.SettingDataModel; +import com.configcat.publicapi.java.client.model.SettingTagModel; +import com.configcat.publicapi.java.client.model.SettingValueType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * ConfigSettingValueModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ConfigSettingValueModel { + public static final String SERIALIZED_NAME_SETTING = "setting"; + @SerializedName(SERIALIZED_NAME_SETTING) + private SettingDataModel setting; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_LAST_UPDATER_USER_EMAIL = "lastUpdaterUserEmail"; + @SerializedName(SERIALIZED_NAME_LAST_UPDATER_USER_EMAIL) + private String lastUpdaterUserEmail; + + public static final String SERIALIZED_NAME_LAST_UPDATER_USER_FULL_NAME = "lastUpdaterUserFullName"; + @SerializedName(SERIALIZED_NAME_LAST_UPDATER_USER_FULL_NAME) + private String lastUpdaterUserFullName; + + public static final String SERIALIZED_NAME_INTEGRATION_LINKS = "integrationLinks"; + @SerializedName(SERIALIZED_NAME_INTEGRATION_LINKS) + private List integrationLinks = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SETTING_TAGS = "settingTags"; + @SerializedName(SERIALIZED_NAME_SETTING_TAGS) + private List settingTags = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ROLLOUT_RULES = "rolloutRules"; + @SerializedName(SERIALIZED_NAME_ROLLOUT_RULES) + private List rolloutRules = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS = "rolloutPercentageItems"; + @SerializedName(SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS) + private List rolloutPercentageItems = new ArrayList<>(); + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private SettingValueType value; + + public ConfigSettingValueModel() { + } + + public ConfigSettingValueModel setting(SettingDataModel setting) { + this.setting = setting; + return this; + } + + /** + * Get setting + * @return setting + */ + @javax.annotation.Nonnull + public SettingDataModel getSetting() { + return setting; + } + + public void setSetting(SettingDataModel setting) { + this.setting = setting; + } + + + public ConfigSettingValueModel updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * The last updated date and time when the Feature Flag or Setting. + * @return updatedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + public ConfigSettingValueModel lastUpdaterUserEmail(String lastUpdaterUserEmail) { + this.lastUpdaterUserEmail = lastUpdaterUserEmail; + return this; + } + + /** + * The email of the user who last updated the Feature Flag or Setting. + * @return lastUpdaterUserEmail + */ + @javax.annotation.Nullable + public String getLastUpdaterUserEmail() { + return lastUpdaterUserEmail; + } + + public void setLastUpdaterUserEmail(String lastUpdaterUserEmail) { + this.lastUpdaterUserEmail = lastUpdaterUserEmail; + } + + + public ConfigSettingValueModel lastUpdaterUserFullName(String lastUpdaterUserFullName) { + this.lastUpdaterUserFullName = lastUpdaterUserFullName; + return this; + } + + /** + * The name of the user who last updated the Feature Flag or Setting. + * @return lastUpdaterUserFullName + */ + @javax.annotation.Nullable + public String getLastUpdaterUserFullName() { + return lastUpdaterUserFullName; + } + + public void setLastUpdaterUserFullName(String lastUpdaterUserFullName) { + this.lastUpdaterUserFullName = lastUpdaterUserFullName; + } + + + public ConfigSettingValueModel integrationLinks(List integrationLinks) { + this.integrationLinks = integrationLinks; + return this; + } + + public ConfigSettingValueModel addIntegrationLinksItem(IntegrationLinkModel integrationLinksItem) { + if (this.integrationLinks == null) { + this.integrationLinks = new ArrayList<>(); + } + this.integrationLinks.add(integrationLinksItem); + return this; + } + + /** + * The integration links attached to the Feature Flag or Setting. + * @return integrationLinks + */ + @javax.annotation.Nonnull + public List getIntegrationLinks() { + return integrationLinks; + } + + public void setIntegrationLinks(List integrationLinks) { + this.integrationLinks = integrationLinks; + } + + + public ConfigSettingValueModel settingTags(List settingTags) { + this.settingTags = settingTags; + return this; + } + + public ConfigSettingValueModel addSettingTagsItem(SettingTagModel settingTagsItem) { + if (this.settingTags == null) { + this.settingTags = new ArrayList<>(); + } + this.settingTags.add(settingTagsItem); + return this; + } + + /** + * The tags attached to the Feature Flag or Setting. + * @return settingTags + */ + @javax.annotation.Nonnull + public List getSettingTags() { + return settingTags; + } + + public void setSettingTags(List settingTags) { + this.settingTags = settingTags; + } + + + public ConfigSettingValueModel rolloutRules(List rolloutRules) { + this.rolloutRules = rolloutRules; + return this; + } + + public ConfigSettingValueModel addRolloutRulesItem(RolloutRuleModel rolloutRulesItem) { + if (this.rolloutRules == null) { + this.rolloutRules = new ArrayList<>(); + } + this.rolloutRules.add(rolloutRulesItem); + return this; + } + + /** + * The targeting rule collection. + * @return rolloutRules + */ + @javax.annotation.Nonnull + public List getRolloutRules() { + return rolloutRules; + } + + public void setRolloutRules(List rolloutRules) { + this.rolloutRules = rolloutRules; + } + + + public ConfigSettingValueModel rolloutPercentageItems(List rolloutPercentageItems) { + this.rolloutPercentageItems = rolloutPercentageItems; + return this; + } + + public ConfigSettingValueModel addRolloutPercentageItemsItem(RolloutPercentageItemModel rolloutPercentageItemsItem) { + if (this.rolloutPercentageItems == null) { + this.rolloutPercentageItems = new ArrayList<>(); + } + this.rolloutPercentageItems.add(rolloutPercentageItemsItem); + return this; + } + + /** + * The percentage rule collection. + * @return rolloutPercentageItems + */ + @javax.annotation.Nonnull + public List getRolloutPercentageItems() { + return rolloutPercentageItems; + } + + public void setRolloutPercentageItems(List rolloutPercentageItems) { + this.rolloutPercentageItems = rolloutPercentageItems; + } + + + public ConfigSettingValueModel value(SettingValueType value) { + this.value = value; + return this; + } + + /** + * The value to serve. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. + * @return value + */ + @javax.annotation.Nonnull + public SettingValueType getValue() { + return value; + } + + public void setValue(SettingValueType value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConfigSettingValueModel instance itself + */ + public ConfigSettingValueModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConfigSettingValueModel configSettingValueModel = (ConfigSettingValueModel) o; + return Objects.equals(this.setting, configSettingValueModel.setting) && + Objects.equals(this.updatedAt, configSettingValueModel.updatedAt) && + Objects.equals(this.lastUpdaterUserEmail, configSettingValueModel.lastUpdaterUserEmail) && + Objects.equals(this.lastUpdaterUserFullName, configSettingValueModel.lastUpdaterUserFullName) && + Objects.equals(this.integrationLinks, configSettingValueModel.integrationLinks) && + Objects.equals(this.settingTags, configSettingValueModel.settingTags) && + Objects.equals(this.rolloutRules, configSettingValueModel.rolloutRules) && + Objects.equals(this.rolloutPercentageItems, configSettingValueModel.rolloutPercentageItems) && + Objects.equals(this.value, configSettingValueModel.value)&& + Objects.equals(this.additionalProperties, configSettingValueModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(setting, updatedAt, lastUpdaterUserEmail, lastUpdaterUserFullName, integrationLinks, settingTags, rolloutRules, rolloutPercentageItems, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConfigSettingValueModel {\n"); + sb.append(" setting: ").append(toIndentedString(setting)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" lastUpdaterUserEmail: ").append(toIndentedString(lastUpdaterUserEmail)).append("\n"); + sb.append(" lastUpdaterUserFullName: ").append(toIndentedString(lastUpdaterUserFullName)).append("\n"); + sb.append(" integrationLinks: ").append(toIndentedString(integrationLinks)).append("\n"); + sb.append(" settingTags: ").append(toIndentedString(settingTags)).append("\n"); + sb.append(" rolloutRules: ").append(toIndentedString(rolloutRules)).append("\n"); + sb.append(" rolloutPercentageItems: ").append(toIndentedString(rolloutPercentageItems)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("setting"); + openapiFields.add("updatedAt"); + openapiFields.add("lastUpdaterUserEmail"); + openapiFields.add("lastUpdaterUserFullName"); + openapiFields.add("integrationLinks"); + openapiFields.add("settingTags"); + openapiFields.add("rolloutRules"); + openapiFields.add("rolloutPercentageItems"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("setting"); + openapiRequiredFields.add("updatedAt"); + openapiRequiredFields.add("lastUpdaterUserEmail"); + openapiRequiredFields.add("lastUpdaterUserFullName"); + openapiRequiredFields.add("integrationLinks"); + openapiRequiredFields.add("settingTags"); + openapiRequiredFields.add("rolloutRules"); + openapiRequiredFields.add("rolloutPercentageItems"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ConfigSettingValueModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConfigSettingValueModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConfigSettingValueModel is not found in the empty JSON string", ConfigSettingValueModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConfigSettingValueModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `setting` + SettingDataModel.validateJsonElement(jsonObj.get("setting")); + if ((jsonObj.get("lastUpdaterUserEmail") != null && !jsonObj.get("lastUpdaterUserEmail").isJsonNull()) && !jsonObj.get("lastUpdaterUserEmail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterUserEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterUserEmail").toString())); + } + if ((jsonObj.get("lastUpdaterUserFullName") != null && !jsonObj.get("lastUpdaterUserFullName").isJsonNull()) && !jsonObj.get("lastUpdaterUserFullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterUserFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterUserFullName").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("integrationLinks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `integrationLinks` to be an array in the JSON string but got `%s`", jsonObj.get("integrationLinks").toString())); + } + + JsonArray jsonArrayintegrationLinks = jsonObj.getAsJsonArray("integrationLinks"); + // validate the required field `integrationLinks` (array) + for (int i = 0; i < jsonArrayintegrationLinks.size(); i++) { + IntegrationLinkModel.validateJsonElement(jsonArrayintegrationLinks.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("settingTags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `settingTags` to be an array in the JSON string but got `%s`", jsonObj.get("settingTags").toString())); + } + + JsonArray jsonArraysettingTags = jsonObj.getAsJsonArray("settingTags"); + // validate the required field `settingTags` (array) + for (int i = 0; i < jsonArraysettingTags.size(); i++) { + SettingTagModel.validateJsonElement(jsonArraysettingTags.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("rolloutRules").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rolloutRules` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutRules").toString())); + } + + JsonArray jsonArrayrolloutRules = jsonObj.getAsJsonArray("rolloutRules"); + // validate the required field `rolloutRules` (array) + for (int i = 0; i < jsonArrayrolloutRules.size(); i++) { + RolloutRuleModel.validateJsonElement(jsonArrayrolloutRules.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("rolloutPercentageItems").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rolloutPercentageItems` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutPercentageItems").toString())); + } + + JsonArray jsonArrayrolloutPercentageItems = jsonObj.getAsJsonArray("rolloutPercentageItems"); + // validate the required field `rolloutPercentageItems` (array) + for (int i = 0; i < jsonArrayrolloutPercentageItems.size(); i++) { + RolloutPercentageItemModel.validateJsonElement(jsonArrayrolloutPercentageItems.get(i)); + }; + // validate the required field `value` + SettingValueType.validateJsonElement(jsonObj.get("value")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConfigSettingValueModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConfigSettingValueModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConfigSettingValueModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConfigSettingValueModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConfigSettingValueModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConfigSettingValueModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConfigSettingValueModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConfigSettingValueModel + * @throws IOException if the JSON string is invalid with respect to ConfigSettingValueModel + */ + public static ConfigSettingValueModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConfigSettingValueModel.class); + } + + /** + * Convert an instance of ConfigSettingValueModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingValuesModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingValuesModel.java new file mode 100644 index 0000000..ee9ab73 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingValuesModel.java @@ -0,0 +1,430 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.ConfigModel; +import com.configcat.publicapi.java.client.model.ConfigSettingValueModel; +import com.configcat.publicapi.java.client.model.EnvironmentModel; +import com.configcat.publicapi.java.client.model.FeatureFlagLimitations; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * ConfigSettingValuesModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ConfigSettingValuesModel { + public static final String SERIALIZED_NAME_CONFIG = "config"; + @SerializedName(SERIALIZED_NAME_CONFIG) + private ConfigModel config; + + public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT) + private EnvironmentModel environment; + + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public static final String SERIALIZED_NAME_SETTING_VALUES = "settingValues"; + @SerializedName(SERIALIZED_NAME_SETTING_VALUES) + private List settingValues = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FEATURE_FLAG_LIMITATIONS = "featureFlagLimitations"; + @SerializedName(SERIALIZED_NAME_FEATURE_FLAG_LIMITATIONS) + private FeatureFlagLimitations featureFlagLimitations; + + public ConfigSettingValuesModel() { + } + + public ConfigSettingValuesModel config(ConfigModel config) { + this.config = config; + return this; + } + + /** + * Get config + * @return config + */ + @javax.annotation.Nonnull + public ConfigModel getConfig() { + return config; + } + + public void setConfig(ConfigModel config) { + this.config = config; + } + + + public ConfigSettingValuesModel environment(EnvironmentModel environment) { + this.environment = environment; + return this; + } + + /** + * Get environment + * @return environment + */ + @javax.annotation.Nonnull + public EnvironmentModel getEnvironment() { + return environment; + } + + public void setEnvironment(EnvironmentModel environment) { + this.environment = environment; + } + + + public ConfigSettingValuesModel readOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Get readOnly + * @return readOnly + */ + @javax.annotation.Nonnull + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + + public ConfigSettingValuesModel settingValues(List settingValues) { + this.settingValues = settingValues; + return this; + } + + public ConfigSettingValuesModel addSettingValuesItem(ConfigSettingValueModel settingValuesItem) { + if (this.settingValues == null) { + this.settingValues = new ArrayList<>(); + } + this.settingValues.add(settingValuesItem); + return this; + } + + /** + * Get settingValues + * @return settingValues + */ + @javax.annotation.Nonnull + public List getSettingValues() { + return settingValues; + } + + public void setSettingValues(List settingValues) { + this.settingValues = settingValues; + } + + + public ConfigSettingValuesModel featureFlagLimitations(FeatureFlagLimitations featureFlagLimitations) { + this.featureFlagLimitations = featureFlagLimitations; + return this; + } + + /** + * Get featureFlagLimitations + * @return featureFlagLimitations + */ + @javax.annotation.Nonnull + public FeatureFlagLimitations getFeatureFlagLimitations() { + return featureFlagLimitations; + } + + public void setFeatureFlagLimitations(FeatureFlagLimitations featureFlagLimitations) { + this.featureFlagLimitations = featureFlagLimitations; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConfigSettingValuesModel instance itself + */ + public ConfigSettingValuesModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConfigSettingValuesModel configSettingValuesModel = (ConfigSettingValuesModel) o; + return Objects.equals(this.config, configSettingValuesModel.config) && + Objects.equals(this.environment, configSettingValuesModel.environment) && + Objects.equals(this.readOnly, configSettingValuesModel.readOnly) && + Objects.equals(this.settingValues, configSettingValuesModel.settingValues) && + Objects.equals(this.featureFlagLimitations, configSettingValuesModel.featureFlagLimitations)&& + Objects.equals(this.additionalProperties, configSettingValuesModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(config, environment, readOnly, settingValues, featureFlagLimitations, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConfigSettingValuesModel {\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); + sb.append(" settingValues: ").append(toIndentedString(settingValues)).append("\n"); + sb.append(" featureFlagLimitations: ").append(toIndentedString(featureFlagLimitations)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("config"); + openapiFields.add("environment"); + openapiFields.add("readOnly"); + openapiFields.add("settingValues"); + openapiFields.add("featureFlagLimitations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("config"); + openapiRequiredFields.add("environment"); + openapiRequiredFields.add("readOnly"); + openapiRequiredFields.add("settingValues"); + openapiRequiredFields.add("featureFlagLimitations"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ConfigSettingValuesModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConfigSettingValuesModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConfigSettingValuesModel is not found in the empty JSON string", ConfigSettingValuesModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConfigSettingValuesModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `config` + ConfigModel.validateJsonElement(jsonObj.get("config")); + // validate the required field `environment` + EnvironmentModel.validateJsonElement(jsonObj.get("environment")); + // ensure the json data is an array + if (!jsonObj.get("settingValues").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `settingValues` to be an array in the JSON string but got `%s`", jsonObj.get("settingValues").toString())); + } + + JsonArray jsonArraysettingValues = jsonObj.getAsJsonArray("settingValues"); + // validate the required field `settingValues` (array) + for (int i = 0; i < jsonArraysettingValues.size(); i++) { + ConfigSettingValueModel.validateJsonElement(jsonArraysettingValues.get(i)); + }; + // validate the required field `featureFlagLimitations` + FeatureFlagLimitations.validateJsonElement(jsonObj.get("featureFlagLimitations")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConfigSettingValuesModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConfigSettingValuesModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConfigSettingValuesModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConfigSettingValuesModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConfigSettingValuesModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConfigSettingValuesModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConfigSettingValuesModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConfigSettingValuesModel + * @throws IOException if the JSON string is invalid with respect to ConfigSettingValuesModel + */ + public static ConfigSettingValuesModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConfigSettingValuesModel.class); + } + + /** + * Convert an instance of ConfigSettingValuesModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ConnectRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/ConnectRequest.java new file mode 100644 index 0000000..f7369cd --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/ConnectRequest.java @@ -0,0 +1,325 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * ConnectRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ConnectRequest { + public static final String SERIALIZED_NAME_CLIENT_KEY = "clientKey"; + @SerializedName(SERIALIZED_NAME_CLIENT_KEY) + private String clientKey; + + public static final String SERIALIZED_NAME_JIRA_JWT_TOKEN = "jiraJwtToken"; + @SerializedName(SERIALIZED_NAME_JIRA_JWT_TOKEN) + private String jiraJwtToken; + + public ConnectRequest() { + } + + public ConnectRequest clientKey(String clientKey) { + this.clientKey = clientKey; + return this; + } + + /** + * Get clientKey + * @return clientKey + */ + @javax.annotation.Nonnull + public String getClientKey() { + return clientKey; + } + + public void setClientKey(String clientKey) { + this.clientKey = clientKey; + } + + + public ConnectRequest jiraJwtToken(String jiraJwtToken) { + this.jiraJwtToken = jiraJwtToken; + return this; + } + + /** + * Get jiraJwtToken + * @return jiraJwtToken + */ + @javax.annotation.Nonnull + public String getJiraJwtToken() { + return jiraJwtToken; + } + + public void setJiraJwtToken(String jiraJwtToken) { + this.jiraJwtToken = jiraJwtToken; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConnectRequest instance itself + */ + public ConnectRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectRequest connectRequest = (ConnectRequest) o; + return Objects.equals(this.clientKey, connectRequest.clientKey) && + Objects.equals(this.jiraJwtToken, connectRequest.jiraJwtToken)&& + Objects.equals(this.additionalProperties, connectRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(clientKey, jiraJwtToken, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectRequest {\n"); + sb.append(" clientKey: ").append(toIndentedString(clientKey)).append("\n"); + sb.append(" jiraJwtToken: ").append(toIndentedString(jiraJwtToken)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("clientKey"); + openapiFields.add("jiraJwtToken"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("clientKey"); + openapiRequiredFields.add("jiraJwtToken"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ConnectRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConnectRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectRequest is not found in the empty JSON string", ConnectRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConnectRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("clientKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientKey").toString())); + } + if (!jsonObj.get("jiraJwtToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `jiraJwtToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jiraJwtToken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConnectRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConnectRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConnectRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConnectRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConnectRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConnectRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConnectRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConnectRequest + * @throws IOException if the JSON string is invalid with respect to ConnectRequest + */ + public static ConnectRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConnectRequest.class); + } + + /** + * Convert an instance of ConnectRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/CreateConfigRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/CreateConfigRequest.java new file mode 100644 index 0000000..cb2799d --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/CreateConfigRequest.java @@ -0,0 +1,393 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.EvaluationVersion; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * CreateConfigRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class CreateConfigRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_ORDER = "order"; + @SerializedName(SERIALIZED_NAME_ORDER) + private Integer order; + + public static final String SERIALIZED_NAME_EVALUATION_VERSION = "evaluationVersion"; + @SerializedName(SERIALIZED_NAME_EVALUATION_VERSION) + private EvaluationVersion evaluationVersion; + + public CreateConfigRequest() { + } + + public CreateConfigRequest name(String name) { + this.name = name; + return this; + } + + /** + * The name of the Config. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public CreateConfigRequest description(String description) { + this.description = description; + return this; + } + + /** + * The description of the Config. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + + public CreateConfigRequest order(Integer order) { + this.order = order; + return this; + } + + /** + * The order of the Config represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. + * @return order + */ + @javax.annotation.Nullable + public Integer getOrder() { + return order; + } + + public void setOrder(Integer order) { + this.order = order; + } + + + public CreateConfigRequest evaluationVersion(EvaluationVersion evaluationVersion) { + this.evaluationVersion = evaluationVersion; + return this; + } + + /** + * Get evaluationVersion + * @return evaluationVersion + */ + @javax.annotation.Nullable + public EvaluationVersion getEvaluationVersion() { + return evaluationVersion; + } + + public void setEvaluationVersion(EvaluationVersion evaluationVersion) { + this.evaluationVersion = evaluationVersion; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateConfigRequest instance itself + */ + public CreateConfigRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateConfigRequest createConfigRequest = (CreateConfigRequest) o; + return Objects.equals(this.name, createConfigRequest.name) && + Objects.equals(this.description, createConfigRequest.description) && + Objects.equals(this.order, createConfigRequest.order) && + Objects.equals(this.evaluationVersion, createConfigRequest.evaluationVersion)&& + Objects.equals(this.additionalProperties, createConfigRequest.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, order, evaluationVersion, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateConfigRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append(" evaluationVersion: ").append(toIndentedString(evaluationVersion)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("order"); + openapiFields.add("evaluationVersion"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateConfigRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateConfigRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateConfigRequest is not found in the empty JSON string", CreateConfigRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateConfigRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + // validate the optional field `evaluationVersion` + if (jsonObj.get("evaluationVersion") != null && !jsonObj.get("evaluationVersion").isJsonNull()) { + EvaluationVersion.validateJsonElement(jsonObj.get("evaluationVersion")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateConfigRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateConfigRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateConfigRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateConfigRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateConfigRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateConfigRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateConfigRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateConfigRequest + * @throws IOException if the JSON string is invalid with respect to CreateConfigRequest + */ + public static CreateConfigRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateConfigRequest.class); + } + + /** + * Convert an instance of CreateConfigRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/CreateEnvironmentModel.java b/src/main/java/com/configcat/publicapi/java/client/model/CreateEnvironmentModel.java new file mode 100644 index 0000000..7489de8 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/CreateEnvironmentModel.java @@ -0,0 +1,391 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * CreateEnvironmentModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class CreateEnvironmentModel { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_COLOR = "color"; + @SerializedName(SERIALIZED_NAME_COLOR) + private String color; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_ORDER = "order"; + @SerializedName(SERIALIZED_NAME_ORDER) + private Integer order; + + public CreateEnvironmentModel() { + } + + public CreateEnvironmentModel name(String name) { + this.name = name; + return this; + } + + /** + * The name of the Environment. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public CreateEnvironmentModel color(String color) { + this.color = color; + return this; + } + + /** + * The color of the Environment. RGB or HTML color codes are allowed. + * @return color + */ + @javax.annotation.Nullable + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + + public CreateEnvironmentModel description(String description) { + this.description = description; + return this; + } + + /** + * The description of the Environment. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + + public CreateEnvironmentModel order(Integer order) { + this.order = order; + return this; + } + + /** + * The order of the Environment represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. + * @return order + */ + @javax.annotation.Nullable + public Integer getOrder() { + return order; + } + + public void setOrder(Integer order) { + this.order = order; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateEnvironmentModel instance itself + */ + public CreateEnvironmentModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEnvironmentModel createEnvironmentModel = (CreateEnvironmentModel) o; + return Objects.equals(this.name, createEnvironmentModel.name) && + Objects.equals(this.color, createEnvironmentModel.color) && + Objects.equals(this.description, createEnvironmentModel.description) && + Objects.equals(this.order, createEnvironmentModel.order)&& + Objects.equals(this.additionalProperties, createEnvironmentModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, color, description, order, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEnvironmentModel {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("color"); + openapiFields.add("description"); + openapiFields.add("order"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateEnvironmentModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateEnvironmentModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateEnvironmentModel is not found in the empty JSON string", CreateEnvironmentModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateEnvironmentModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("color") != null && !jsonObj.get("color").isJsonNull()) && !jsonObj.get("color").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateEnvironmentModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateEnvironmentModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateEnvironmentModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateEnvironmentModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateEnvironmentModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateEnvironmentModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateEnvironmentModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateEnvironmentModel + * @throws IOException if the JSON string is invalid with respect to CreateEnvironmentModel + */ + public static CreateEnvironmentModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateEnvironmentModel.class); + } + + /** + * Convert an instance of CreateEnvironmentModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/CreateIntegrationModel.java b/src/main/java/com/configcat/publicapi/java/client/model/CreateIntegrationModel.java new file mode 100644 index 0000000..52dc209 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/CreateIntegrationModel.java @@ -0,0 +1,447 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.IntegrationType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * CreateIntegrationModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class CreateIntegrationModel { + public static final String SERIALIZED_NAME_INTEGRATION_TYPE = "integrationType"; + @SerializedName(SERIALIZED_NAME_INTEGRATION_TYPE) + private IntegrationType integrationType; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_PARAMETERS = "parameters"; + @SerializedName(SERIALIZED_NAME_PARAMETERS) + private Map parameters = new HashMap<>(); + + public static final String SERIALIZED_NAME_ENVIRONMENT_IDS = "environmentIds"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT_IDS) + private List environmentIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CONFIG_IDS = "configIds"; + @SerializedName(SERIALIZED_NAME_CONFIG_IDS) + private List configIds = new ArrayList<>(); + + public CreateIntegrationModel() { + } + + public CreateIntegrationModel integrationType(IntegrationType integrationType) { + this.integrationType = integrationType; + return this; + } + + /** + * Get integrationType + * @return integrationType + */ + @javax.annotation.Nonnull + public IntegrationType getIntegrationType() { + return integrationType; + } + + public void setIntegrationType(IntegrationType integrationType) { + this.integrationType = integrationType; + } + + + public CreateIntegrationModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Integration. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public CreateIntegrationModel parameters(Map parameters) { + this.parameters = parameters; + return this; + } + + public CreateIntegrationModel putParametersItem(String key, String parametersItem) { + if (this.parameters == null) { + this.parameters = new HashMap<>(); + } + this.parameters.put(key, parametersItem); + return this; + } + + /** + * Parameters of the Integration. + * @return parameters + */ + @javax.annotation.Nonnull + public Map getParameters() { + return parameters; + } + + public void setParameters(Map parameters) { + this.parameters = parameters; + } + + + public CreateIntegrationModel environmentIds(List environmentIds) { + this.environmentIds = environmentIds; + return this; + } + + public CreateIntegrationModel addEnvironmentIdsItem(UUID environmentIdsItem) { + if (this.environmentIds == null) { + this.environmentIds = new ArrayList<>(); + } + this.environmentIds.add(environmentIdsItem); + return this; + } + + /** + * List of Environment IDs that are connected with this Integration. If the list is empty, all of the Environments are connected. + * @return environmentIds + */ + @javax.annotation.Nonnull + public List getEnvironmentIds() { + return environmentIds; + } + + public void setEnvironmentIds(List environmentIds) { + this.environmentIds = environmentIds; + } + + + public CreateIntegrationModel configIds(List configIds) { + this.configIds = configIds; + return this; + } + + public CreateIntegrationModel addConfigIdsItem(UUID configIdsItem) { + if (this.configIds == null) { + this.configIds = new ArrayList<>(); + } + this.configIds.add(configIdsItem); + return this; + } + + /** + * List of Config IDs that are connected with this Integration. If the list is empty, all of the Configs are connected. + * @return configIds + */ + @javax.annotation.Nonnull + public List getConfigIds() { + return configIds; + } + + public void setConfigIds(List configIds) { + this.configIds = configIds; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateIntegrationModel instance itself + */ + public CreateIntegrationModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateIntegrationModel createIntegrationModel = (CreateIntegrationModel) o; + return Objects.equals(this.integrationType, createIntegrationModel.integrationType) && + Objects.equals(this.name, createIntegrationModel.name) && + Objects.equals(this.parameters, createIntegrationModel.parameters) && + Objects.equals(this.environmentIds, createIntegrationModel.environmentIds) && + Objects.equals(this.configIds, createIntegrationModel.configIds)&& + Objects.equals(this.additionalProperties, createIntegrationModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(integrationType, name, parameters, environmentIds, configIds, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateIntegrationModel {\n"); + sb.append(" integrationType: ").append(toIndentedString(integrationType)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); + sb.append(" environmentIds: ").append(toIndentedString(environmentIds)).append("\n"); + sb.append(" configIds: ").append(toIndentedString(configIds)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("integrationType"); + openapiFields.add("name"); + openapiFields.add("parameters"); + openapiFields.add("environmentIds"); + openapiFields.add("configIds"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("integrationType"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("parameters"); + openapiRequiredFields.add("environmentIds"); + openapiRequiredFields.add("configIds"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateIntegrationModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateIntegrationModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateIntegrationModel is not found in the empty JSON string", CreateIntegrationModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateIntegrationModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `integrationType` + IntegrationType.validateJsonElement(jsonObj.get("integrationType")); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + // ensure the required json array is present + if (jsonObj.get("environmentIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("environmentIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `environmentIds` to be an array in the JSON string but got `%s`", jsonObj.get("environmentIds").toString())); + } + // ensure the required json array is present + if (jsonObj.get("configIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("configIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `configIds` to be an array in the JSON string but got `%s`", jsonObj.get("configIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateIntegrationModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateIntegrationModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateIntegrationModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateIntegrationModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateIntegrationModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateIntegrationModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateIntegrationModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateIntegrationModel + * @throws IOException if the JSON string is invalid with respect to CreateIntegrationModel + */ + public static CreateIntegrationModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateIntegrationModel.class); + } + + /** + * Convert an instance of CreateIntegrationModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/CreateOrUpdateEnvironmentAccessModel.java b/src/main/java/com/configcat/publicapi/java/client/model/CreateOrUpdateEnvironmentAccessModel.java new file mode 100644 index 0000000..a21c779 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/CreateOrUpdateEnvironmentAccessModel.java @@ -0,0 +1,319 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.EnvironmentAccessType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * CreateOrUpdateEnvironmentAccessModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class CreateOrUpdateEnvironmentAccessModel { + public static final String SERIALIZED_NAME_ENVIRONMENT_ID = "environmentId"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) + private UUID environmentId; + + public static final String SERIALIZED_NAME_ENVIRONMENT_ACCESS_TYPE = "environmentAccessType"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ACCESS_TYPE) + private EnvironmentAccessType environmentAccessType; + + public CreateOrUpdateEnvironmentAccessModel() { + } + + public CreateOrUpdateEnvironmentAccessModel environmentId(UUID environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Identifier of the Environment. + * @return environmentId + */ + @javax.annotation.Nullable + public UUID getEnvironmentId() { + return environmentId; + } + + public void setEnvironmentId(UUID environmentId) { + this.environmentId = environmentId; + } + + + public CreateOrUpdateEnvironmentAccessModel environmentAccessType(EnvironmentAccessType environmentAccessType) { + this.environmentAccessType = environmentAccessType; + return this; + } + + /** + * Get environmentAccessType + * @return environmentAccessType + */ + @javax.annotation.Nullable + public EnvironmentAccessType getEnvironmentAccessType() { + return environmentAccessType; + } + + public void setEnvironmentAccessType(EnvironmentAccessType environmentAccessType) { + this.environmentAccessType = environmentAccessType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateOrUpdateEnvironmentAccessModel instance itself + */ + public CreateOrUpdateEnvironmentAccessModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateOrUpdateEnvironmentAccessModel createOrUpdateEnvironmentAccessModel = (CreateOrUpdateEnvironmentAccessModel) o; + return Objects.equals(this.environmentId, createOrUpdateEnvironmentAccessModel.environmentId) && + Objects.equals(this.environmentAccessType, createOrUpdateEnvironmentAccessModel.environmentAccessType)&& + Objects.equals(this.additionalProperties, createOrUpdateEnvironmentAccessModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(environmentId, environmentAccessType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateOrUpdateEnvironmentAccessModel {\n"); + sb.append(" environmentId: ").append(toIndentedString(environmentId)).append("\n"); + sb.append(" environmentAccessType: ").append(toIndentedString(environmentAccessType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("environmentId"); + openapiFields.add("environmentAccessType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateOrUpdateEnvironmentAccessModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateOrUpdateEnvironmentAccessModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateOrUpdateEnvironmentAccessModel is not found in the empty JSON string", CreateOrUpdateEnvironmentAccessModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("environmentId") != null && !jsonObj.get("environmentId").isJsonNull()) && !jsonObj.get("environmentId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `environmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentId").toString())); + } + // validate the optional field `environmentAccessType` + if (jsonObj.get("environmentAccessType") != null && !jsonObj.get("environmentAccessType").isJsonNull()) { + EnvironmentAccessType.validateJsonElement(jsonObj.get("environmentAccessType")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateOrUpdateEnvironmentAccessModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateOrUpdateEnvironmentAccessModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateOrUpdateEnvironmentAccessModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateOrUpdateEnvironmentAccessModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateOrUpdateEnvironmentAccessModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateOrUpdateEnvironmentAccessModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateOrUpdateEnvironmentAccessModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateOrUpdateEnvironmentAccessModel + * @throws IOException if the JSON string is invalid with respect to CreateOrUpdateEnvironmentAccessModel + */ + public static CreateOrUpdateEnvironmentAccessModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateOrUpdateEnvironmentAccessModel.class); + } + + /** + * Convert an instance of CreateOrUpdateEnvironmentAccessModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/CreatePermissionGroupRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/CreatePermissionGroupRequest.java new file mode 100644 index 0000000..723e7dc --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/CreatePermissionGroupRequest.java @@ -0,0 +1,966 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.AccessType; +import com.configcat.publicapi.java.client.model.CreateOrUpdateEnvironmentAccessModel; +import com.configcat.publicapi.java.client.model.EnvironmentAccessType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * CreatePermissionGroupRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class CreatePermissionGroupRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_CAN_MANAGE_MEMBERS = "canManageMembers"; + @SerializedName(SERIALIZED_NAME_CAN_MANAGE_MEMBERS) + private Boolean canManageMembers; + + public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_CONFIG = "canCreateOrUpdateConfig"; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_CONFIG) + private Boolean canCreateOrUpdateConfig; + + public static final String SERIALIZED_NAME_CAN_DELETE_CONFIG = "canDeleteConfig"; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_CONFIG) + private Boolean canDeleteConfig; + + public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_ENVIRONMENT = "canCreateOrUpdateEnvironment"; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_ENVIRONMENT) + private Boolean canCreateOrUpdateEnvironment; + + public static final String SERIALIZED_NAME_CAN_DELETE_ENVIRONMENT = "canDeleteEnvironment"; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_ENVIRONMENT) + private Boolean canDeleteEnvironment; + + public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SETTING = "canCreateOrUpdateSetting"; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SETTING) + private Boolean canCreateOrUpdateSetting; + + public static final String SERIALIZED_NAME_CAN_TAG_SETTING = "canTagSetting"; + @SerializedName(SERIALIZED_NAME_CAN_TAG_SETTING) + private Boolean canTagSetting; + + public static final String SERIALIZED_NAME_CAN_DELETE_SETTING = "canDeleteSetting"; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_SETTING) + private Boolean canDeleteSetting; + + public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_TAG = "canCreateOrUpdateTag"; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_TAG) + private Boolean canCreateOrUpdateTag; + + public static final String SERIALIZED_NAME_CAN_DELETE_TAG = "canDeleteTag"; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_TAG) + private Boolean canDeleteTag; + + public static final String SERIALIZED_NAME_CAN_MANAGE_WEBHOOK = "canManageWebhook"; + @SerializedName(SERIALIZED_NAME_CAN_MANAGE_WEBHOOK) + private Boolean canManageWebhook; + + public static final String SERIALIZED_NAME_CAN_USE_EXPORT_IMPORT = "canUseExportImport"; + @SerializedName(SERIALIZED_NAME_CAN_USE_EXPORT_IMPORT) + private Boolean canUseExportImport; + + public static final String SERIALIZED_NAME_CAN_MANAGE_PRODUCT_PREFERENCES = "canManageProductPreferences"; + @SerializedName(SERIALIZED_NAME_CAN_MANAGE_PRODUCT_PREFERENCES) + private Boolean canManageProductPreferences; + + public static final String SERIALIZED_NAME_CAN_MANAGE_INTEGRATIONS = "canManageIntegrations"; + @SerializedName(SERIALIZED_NAME_CAN_MANAGE_INTEGRATIONS) + private Boolean canManageIntegrations; + + public static final String SERIALIZED_NAME_CAN_VIEW_SDK_KEY = "canViewSdkKey"; + @SerializedName(SERIALIZED_NAME_CAN_VIEW_SDK_KEY) + private Boolean canViewSdkKey; + + public static final String SERIALIZED_NAME_CAN_ROTATE_SDK_KEY = "canRotateSdkKey"; + @SerializedName(SERIALIZED_NAME_CAN_ROTATE_SDK_KEY) + private Boolean canRotateSdkKey; + + public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SEGMENTS = "canCreateOrUpdateSegments"; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SEGMENTS) + private Boolean canCreateOrUpdateSegments; + + public static final String SERIALIZED_NAME_CAN_DELETE_SEGMENTS = "canDeleteSegments"; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_SEGMENTS) + private Boolean canDeleteSegments; + + public static final String SERIALIZED_NAME_CAN_VIEW_PRODUCT_AUDIT_LOG = "canViewProductAuditLog"; + @SerializedName(SERIALIZED_NAME_CAN_VIEW_PRODUCT_AUDIT_LOG) + private Boolean canViewProductAuditLog; + + public static final String SERIALIZED_NAME_CAN_VIEW_PRODUCT_STATISTICS = "canViewProductStatistics"; + @SerializedName(SERIALIZED_NAME_CAN_VIEW_PRODUCT_STATISTICS) + private Boolean canViewProductStatistics; + + public static final String SERIALIZED_NAME_ACCESS_TYPE = "accessType"; + @SerializedName(SERIALIZED_NAME_ACCESS_TYPE) + private AccessType accessType; + + public static final String SERIALIZED_NAME_NEW_ENVIRONMENT_ACCESS_TYPE = "newEnvironmentAccessType"; + @SerializedName(SERIALIZED_NAME_NEW_ENVIRONMENT_ACCESS_TYPE) + private EnvironmentAccessType newEnvironmentAccessType; + + public static final String SERIALIZED_NAME_ENVIRONMENT_ACCESSES = "environmentAccesses"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ACCESSES) + private List environmentAccesses; + + public static final String SERIALIZED_NAME_CAN_DISABLE2_F_A = "canDisable2FA"; + @SerializedName(SERIALIZED_NAME_CAN_DISABLE2_F_A) + private Boolean canDisable2FA; + + public CreatePermissionGroupRequest() { + } + + public CreatePermissionGroupRequest name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Permission Group. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public CreatePermissionGroupRequest canManageMembers(Boolean canManageMembers) { + this.canManageMembers = canManageMembers; + return this; + } + + /** + * Group members can manage team members. + * @return canManageMembers + */ + @javax.annotation.Nullable + public Boolean getCanManageMembers() { + return canManageMembers; + } + + public void setCanManageMembers(Boolean canManageMembers) { + this.canManageMembers = canManageMembers; + } + + + public CreatePermissionGroupRequest canCreateOrUpdateConfig(Boolean canCreateOrUpdateConfig) { + this.canCreateOrUpdateConfig = canCreateOrUpdateConfig; + return this; + } + + /** + * Group members can create/update Configs. + * @return canCreateOrUpdateConfig + */ + @javax.annotation.Nullable + public Boolean getCanCreateOrUpdateConfig() { + return canCreateOrUpdateConfig; + } + + public void setCanCreateOrUpdateConfig(Boolean canCreateOrUpdateConfig) { + this.canCreateOrUpdateConfig = canCreateOrUpdateConfig; + } + + + public CreatePermissionGroupRequest canDeleteConfig(Boolean canDeleteConfig) { + this.canDeleteConfig = canDeleteConfig; + return this; + } + + /** + * Group members can delete Configs. + * @return canDeleteConfig + */ + @javax.annotation.Nullable + public Boolean getCanDeleteConfig() { + return canDeleteConfig; + } + + public void setCanDeleteConfig(Boolean canDeleteConfig) { + this.canDeleteConfig = canDeleteConfig; + } + + + public CreatePermissionGroupRequest canCreateOrUpdateEnvironment(Boolean canCreateOrUpdateEnvironment) { + this.canCreateOrUpdateEnvironment = canCreateOrUpdateEnvironment; + return this; + } + + /** + * Group members can create/update Environments. + * @return canCreateOrUpdateEnvironment + */ + @javax.annotation.Nullable + public Boolean getCanCreateOrUpdateEnvironment() { + return canCreateOrUpdateEnvironment; + } + + public void setCanCreateOrUpdateEnvironment(Boolean canCreateOrUpdateEnvironment) { + this.canCreateOrUpdateEnvironment = canCreateOrUpdateEnvironment; + } + + + public CreatePermissionGroupRequest canDeleteEnvironment(Boolean canDeleteEnvironment) { + this.canDeleteEnvironment = canDeleteEnvironment; + return this; + } + + /** + * Group members can delete Environments. + * @return canDeleteEnvironment + */ + @javax.annotation.Nullable + public Boolean getCanDeleteEnvironment() { + return canDeleteEnvironment; + } + + public void setCanDeleteEnvironment(Boolean canDeleteEnvironment) { + this.canDeleteEnvironment = canDeleteEnvironment; + } + + + public CreatePermissionGroupRequest canCreateOrUpdateSetting(Boolean canCreateOrUpdateSetting) { + this.canCreateOrUpdateSetting = canCreateOrUpdateSetting; + return this; + } + + /** + * Group members can create/update Feature Flags and Settings. + * @return canCreateOrUpdateSetting + */ + @javax.annotation.Nullable + public Boolean getCanCreateOrUpdateSetting() { + return canCreateOrUpdateSetting; + } + + public void setCanCreateOrUpdateSetting(Boolean canCreateOrUpdateSetting) { + this.canCreateOrUpdateSetting = canCreateOrUpdateSetting; + } + + + public CreatePermissionGroupRequest canTagSetting(Boolean canTagSetting) { + this.canTagSetting = canTagSetting; + return this; + } + + /** + * Group members can attach/detach Tags to Feature Flags and Settings. + * @return canTagSetting + */ + @javax.annotation.Nullable + public Boolean getCanTagSetting() { + return canTagSetting; + } + + public void setCanTagSetting(Boolean canTagSetting) { + this.canTagSetting = canTagSetting; + } + + + public CreatePermissionGroupRequest canDeleteSetting(Boolean canDeleteSetting) { + this.canDeleteSetting = canDeleteSetting; + return this; + } + + /** + * Group members can delete Feature Flags and Settings. + * @return canDeleteSetting + */ + @javax.annotation.Nullable + public Boolean getCanDeleteSetting() { + return canDeleteSetting; + } + + public void setCanDeleteSetting(Boolean canDeleteSetting) { + this.canDeleteSetting = canDeleteSetting; + } + + + public CreatePermissionGroupRequest canCreateOrUpdateTag(Boolean canCreateOrUpdateTag) { + this.canCreateOrUpdateTag = canCreateOrUpdateTag; + return this; + } + + /** + * Group members can create/update Tags. + * @return canCreateOrUpdateTag + */ + @javax.annotation.Nullable + public Boolean getCanCreateOrUpdateTag() { + return canCreateOrUpdateTag; + } + + public void setCanCreateOrUpdateTag(Boolean canCreateOrUpdateTag) { + this.canCreateOrUpdateTag = canCreateOrUpdateTag; + } + + + public CreatePermissionGroupRequest canDeleteTag(Boolean canDeleteTag) { + this.canDeleteTag = canDeleteTag; + return this; + } + + /** + * Group members can delete Tags. + * @return canDeleteTag + */ + @javax.annotation.Nullable + public Boolean getCanDeleteTag() { + return canDeleteTag; + } + + public void setCanDeleteTag(Boolean canDeleteTag) { + this.canDeleteTag = canDeleteTag; + } + + + public CreatePermissionGroupRequest canManageWebhook(Boolean canManageWebhook) { + this.canManageWebhook = canManageWebhook; + return this; + } + + /** + * Group members can create/update/delete Webhooks. + * @return canManageWebhook + */ + @javax.annotation.Nullable + public Boolean getCanManageWebhook() { + return canManageWebhook; + } + + public void setCanManageWebhook(Boolean canManageWebhook) { + this.canManageWebhook = canManageWebhook; + } + + + public CreatePermissionGroupRequest canUseExportImport(Boolean canUseExportImport) { + this.canUseExportImport = canUseExportImport; + return this; + } + + /** + * Group members can use the export/import feature. + * @return canUseExportImport + */ + @javax.annotation.Nullable + public Boolean getCanUseExportImport() { + return canUseExportImport; + } + + public void setCanUseExportImport(Boolean canUseExportImport) { + this.canUseExportImport = canUseExportImport; + } + + + public CreatePermissionGroupRequest canManageProductPreferences(Boolean canManageProductPreferences) { + this.canManageProductPreferences = canManageProductPreferences; + return this; + } + + /** + * Group members can update Product preferences. + * @return canManageProductPreferences + */ + @javax.annotation.Nullable + public Boolean getCanManageProductPreferences() { + return canManageProductPreferences; + } + + public void setCanManageProductPreferences(Boolean canManageProductPreferences) { + this.canManageProductPreferences = canManageProductPreferences; + } + + + public CreatePermissionGroupRequest canManageIntegrations(Boolean canManageIntegrations) { + this.canManageIntegrations = canManageIntegrations; + return this; + } + + /** + * Group members can add and configure integrations. + * @return canManageIntegrations + */ + @javax.annotation.Nullable + public Boolean getCanManageIntegrations() { + return canManageIntegrations; + } + + public void setCanManageIntegrations(Boolean canManageIntegrations) { + this.canManageIntegrations = canManageIntegrations; + } + + + public CreatePermissionGroupRequest canViewSdkKey(Boolean canViewSdkKey) { + this.canViewSdkKey = canViewSdkKey; + return this; + } + + /** + * Group members has access to SDK keys. + * @return canViewSdkKey + */ + @javax.annotation.Nullable + public Boolean getCanViewSdkKey() { + return canViewSdkKey; + } + + public void setCanViewSdkKey(Boolean canViewSdkKey) { + this.canViewSdkKey = canViewSdkKey; + } + + + public CreatePermissionGroupRequest canRotateSdkKey(Boolean canRotateSdkKey) { + this.canRotateSdkKey = canRotateSdkKey; + return this; + } + + /** + * Group members can rotate SDK keys. + * @return canRotateSdkKey + */ + @javax.annotation.Nullable + public Boolean getCanRotateSdkKey() { + return canRotateSdkKey; + } + + public void setCanRotateSdkKey(Boolean canRotateSdkKey) { + this.canRotateSdkKey = canRotateSdkKey; + } + + + public CreatePermissionGroupRequest canCreateOrUpdateSegments(Boolean canCreateOrUpdateSegments) { + this.canCreateOrUpdateSegments = canCreateOrUpdateSegments; + return this; + } + + /** + * Group members can create/update Segments. + * @return canCreateOrUpdateSegments + */ + @javax.annotation.Nullable + public Boolean getCanCreateOrUpdateSegments() { + return canCreateOrUpdateSegments; + } + + public void setCanCreateOrUpdateSegments(Boolean canCreateOrUpdateSegments) { + this.canCreateOrUpdateSegments = canCreateOrUpdateSegments; + } + + + public CreatePermissionGroupRequest canDeleteSegments(Boolean canDeleteSegments) { + this.canDeleteSegments = canDeleteSegments; + return this; + } + + /** + * Group members can delete Segments. + * @return canDeleteSegments + */ + @javax.annotation.Nullable + public Boolean getCanDeleteSegments() { + return canDeleteSegments; + } + + public void setCanDeleteSegments(Boolean canDeleteSegments) { + this.canDeleteSegments = canDeleteSegments; + } + + + public CreatePermissionGroupRequest canViewProductAuditLog(Boolean canViewProductAuditLog) { + this.canViewProductAuditLog = canViewProductAuditLog; + return this; + } + + /** + * Group members has access to audit logs. + * @return canViewProductAuditLog + */ + @javax.annotation.Nullable + public Boolean getCanViewProductAuditLog() { + return canViewProductAuditLog; + } + + public void setCanViewProductAuditLog(Boolean canViewProductAuditLog) { + this.canViewProductAuditLog = canViewProductAuditLog; + } + + + public CreatePermissionGroupRequest canViewProductStatistics(Boolean canViewProductStatistics) { + this.canViewProductStatistics = canViewProductStatistics; + return this; + } + + /** + * Group members has access to product statistics. + * @return canViewProductStatistics + */ + @javax.annotation.Nullable + public Boolean getCanViewProductStatistics() { + return canViewProductStatistics; + } + + public void setCanViewProductStatistics(Boolean canViewProductStatistics) { + this.canViewProductStatistics = canViewProductStatistics; + } + + + public CreatePermissionGroupRequest accessType(AccessType accessType) { + this.accessType = accessType; + return this; + } + + /** + * Get accessType + * @return accessType + */ + @javax.annotation.Nullable + public AccessType getAccessType() { + return accessType; + } + + public void setAccessType(AccessType accessType) { + this.accessType = accessType; + } + + + public CreatePermissionGroupRequest newEnvironmentAccessType(EnvironmentAccessType newEnvironmentAccessType) { + this.newEnvironmentAccessType = newEnvironmentAccessType; + return this; + } + + /** + * Get newEnvironmentAccessType + * @return newEnvironmentAccessType + */ + @javax.annotation.Nullable + public EnvironmentAccessType getNewEnvironmentAccessType() { + return newEnvironmentAccessType; + } + + public void setNewEnvironmentAccessType(EnvironmentAccessType newEnvironmentAccessType) { + this.newEnvironmentAccessType = newEnvironmentAccessType; + } + + + public CreatePermissionGroupRequest environmentAccesses(List environmentAccesses) { + this.environmentAccesses = environmentAccesses; + return this; + } + + public CreatePermissionGroupRequest addEnvironmentAccessesItem(CreateOrUpdateEnvironmentAccessModel environmentAccessesItem) { + if (this.environmentAccesses == null) { + this.environmentAccesses = new ArrayList<>(); + } + this.environmentAccesses.add(environmentAccessesItem); + return this; + } + + /** + * List of environment specific permissions. + * @return environmentAccesses + */ + @javax.annotation.Nullable + public List getEnvironmentAccesses() { + return environmentAccesses; + } + + public void setEnvironmentAccesses(List environmentAccesses) { + this.environmentAccesses = environmentAccesses; + } + + + public CreatePermissionGroupRequest canDisable2FA(Boolean canDisable2FA) { + this.canDisable2FA = canDisable2FA; + return this; + } + + /** + * Group members can disable two-factor authentication for other members. + * @return canDisable2FA + */ + @javax.annotation.Nullable + public Boolean getCanDisable2FA() { + return canDisable2FA; + } + + public void setCanDisable2FA(Boolean canDisable2FA) { + this.canDisable2FA = canDisable2FA; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreatePermissionGroupRequest instance itself + */ + public CreatePermissionGroupRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreatePermissionGroupRequest createPermissionGroupRequest = (CreatePermissionGroupRequest) o; + return Objects.equals(this.name, createPermissionGroupRequest.name) && + Objects.equals(this.canManageMembers, createPermissionGroupRequest.canManageMembers) && + Objects.equals(this.canCreateOrUpdateConfig, createPermissionGroupRequest.canCreateOrUpdateConfig) && + Objects.equals(this.canDeleteConfig, createPermissionGroupRequest.canDeleteConfig) && + Objects.equals(this.canCreateOrUpdateEnvironment, createPermissionGroupRequest.canCreateOrUpdateEnvironment) && + Objects.equals(this.canDeleteEnvironment, createPermissionGroupRequest.canDeleteEnvironment) && + Objects.equals(this.canCreateOrUpdateSetting, createPermissionGroupRequest.canCreateOrUpdateSetting) && + Objects.equals(this.canTagSetting, createPermissionGroupRequest.canTagSetting) && + Objects.equals(this.canDeleteSetting, createPermissionGroupRequest.canDeleteSetting) && + Objects.equals(this.canCreateOrUpdateTag, createPermissionGroupRequest.canCreateOrUpdateTag) && + Objects.equals(this.canDeleteTag, createPermissionGroupRequest.canDeleteTag) && + Objects.equals(this.canManageWebhook, createPermissionGroupRequest.canManageWebhook) && + Objects.equals(this.canUseExportImport, createPermissionGroupRequest.canUseExportImport) && + Objects.equals(this.canManageProductPreferences, createPermissionGroupRequest.canManageProductPreferences) && + Objects.equals(this.canManageIntegrations, createPermissionGroupRequest.canManageIntegrations) && + Objects.equals(this.canViewSdkKey, createPermissionGroupRequest.canViewSdkKey) && + Objects.equals(this.canRotateSdkKey, createPermissionGroupRequest.canRotateSdkKey) && + Objects.equals(this.canCreateOrUpdateSegments, createPermissionGroupRequest.canCreateOrUpdateSegments) && + Objects.equals(this.canDeleteSegments, createPermissionGroupRequest.canDeleteSegments) && + Objects.equals(this.canViewProductAuditLog, createPermissionGroupRequest.canViewProductAuditLog) && + Objects.equals(this.canViewProductStatistics, createPermissionGroupRequest.canViewProductStatistics) && + Objects.equals(this.accessType, createPermissionGroupRequest.accessType) && + Objects.equals(this.newEnvironmentAccessType, createPermissionGroupRequest.newEnvironmentAccessType) && + Objects.equals(this.environmentAccesses, createPermissionGroupRequest.environmentAccesses) && + Objects.equals(this.canDisable2FA, createPermissionGroupRequest.canDisable2FA)&& + Objects.equals(this.additionalProperties, createPermissionGroupRequest.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, canManageMembers, canCreateOrUpdateConfig, canDeleteConfig, canCreateOrUpdateEnvironment, canDeleteEnvironment, canCreateOrUpdateSetting, canTagSetting, canDeleteSetting, canCreateOrUpdateTag, canDeleteTag, canManageWebhook, canUseExportImport, canManageProductPreferences, canManageIntegrations, canViewSdkKey, canRotateSdkKey, canCreateOrUpdateSegments, canDeleteSegments, canViewProductAuditLog, canViewProductStatistics, accessType, newEnvironmentAccessType, environmentAccesses, canDisable2FA, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreatePermissionGroupRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" canManageMembers: ").append(toIndentedString(canManageMembers)).append("\n"); + sb.append(" canCreateOrUpdateConfig: ").append(toIndentedString(canCreateOrUpdateConfig)).append("\n"); + sb.append(" canDeleteConfig: ").append(toIndentedString(canDeleteConfig)).append("\n"); + sb.append(" canCreateOrUpdateEnvironment: ").append(toIndentedString(canCreateOrUpdateEnvironment)).append("\n"); + sb.append(" canDeleteEnvironment: ").append(toIndentedString(canDeleteEnvironment)).append("\n"); + sb.append(" canCreateOrUpdateSetting: ").append(toIndentedString(canCreateOrUpdateSetting)).append("\n"); + sb.append(" canTagSetting: ").append(toIndentedString(canTagSetting)).append("\n"); + sb.append(" canDeleteSetting: ").append(toIndentedString(canDeleteSetting)).append("\n"); + sb.append(" canCreateOrUpdateTag: ").append(toIndentedString(canCreateOrUpdateTag)).append("\n"); + sb.append(" canDeleteTag: ").append(toIndentedString(canDeleteTag)).append("\n"); + sb.append(" canManageWebhook: ").append(toIndentedString(canManageWebhook)).append("\n"); + sb.append(" canUseExportImport: ").append(toIndentedString(canUseExportImport)).append("\n"); + sb.append(" canManageProductPreferences: ").append(toIndentedString(canManageProductPreferences)).append("\n"); + sb.append(" canManageIntegrations: ").append(toIndentedString(canManageIntegrations)).append("\n"); + sb.append(" canViewSdkKey: ").append(toIndentedString(canViewSdkKey)).append("\n"); + sb.append(" canRotateSdkKey: ").append(toIndentedString(canRotateSdkKey)).append("\n"); + sb.append(" canCreateOrUpdateSegments: ").append(toIndentedString(canCreateOrUpdateSegments)).append("\n"); + sb.append(" canDeleteSegments: ").append(toIndentedString(canDeleteSegments)).append("\n"); + sb.append(" canViewProductAuditLog: ").append(toIndentedString(canViewProductAuditLog)).append("\n"); + sb.append(" canViewProductStatistics: ").append(toIndentedString(canViewProductStatistics)).append("\n"); + sb.append(" accessType: ").append(toIndentedString(accessType)).append("\n"); + sb.append(" newEnvironmentAccessType: ").append(toIndentedString(newEnvironmentAccessType)).append("\n"); + sb.append(" environmentAccesses: ").append(toIndentedString(environmentAccesses)).append("\n"); + sb.append(" canDisable2FA: ").append(toIndentedString(canDisable2FA)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("canManageMembers"); + openapiFields.add("canCreateOrUpdateConfig"); + openapiFields.add("canDeleteConfig"); + openapiFields.add("canCreateOrUpdateEnvironment"); + openapiFields.add("canDeleteEnvironment"); + openapiFields.add("canCreateOrUpdateSetting"); + openapiFields.add("canTagSetting"); + openapiFields.add("canDeleteSetting"); + openapiFields.add("canCreateOrUpdateTag"); + openapiFields.add("canDeleteTag"); + openapiFields.add("canManageWebhook"); + openapiFields.add("canUseExportImport"); + openapiFields.add("canManageProductPreferences"); + openapiFields.add("canManageIntegrations"); + openapiFields.add("canViewSdkKey"); + openapiFields.add("canRotateSdkKey"); + openapiFields.add("canCreateOrUpdateSegments"); + openapiFields.add("canDeleteSegments"); + openapiFields.add("canViewProductAuditLog"); + openapiFields.add("canViewProductStatistics"); + openapiFields.add("accessType"); + openapiFields.add("newEnvironmentAccessType"); + openapiFields.add("environmentAccesses"); + openapiFields.add("canDisable2FA"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreatePermissionGroupRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreatePermissionGroupRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreatePermissionGroupRequest is not found in the empty JSON string", CreatePermissionGroupRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreatePermissionGroupRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + // validate the optional field `accessType` + if (jsonObj.get("accessType") != null && !jsonObj.get("accessType").isJsonNull()) { + AccessType.validateJsonElement(jsonObj.get("accessType")); + } + // validate the optional field `newEnvironmentAccessType` + if (jsonObj.get("newEnvironmentAccessType") != null && !jsonObj.get("newEnvironmentAccessType").isJsonNull()) { + EnvironmentAccessType.validateJsonElement(jsonObj.get("newEnvironmentAccessType")); + } + if (jsonObj.get("environmentAccesses") != null && !jsonObj.get("environmentAccesses").isJsonNull()) { + JsonArray jsonArrayenvironmentAccesses = jsonObj.getAsJsonArray("environmentAccesses"); + if (jsonArrayenvironmentAccesses != null) { + // ensure the json data is an array + if (!jsonObj.get("environmentAccesses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `environmentAccesses` to be an array in the JSON string but got `%s`", jsonObj.get("environmentAccesses").toString())); + } + + // validate the optional field `environmentAccesses` (array) + for (int i = 0; i < jsonArrayenvironmentAccesses.size(); i++) { + CreateOrUpdateEnvironmentAccessModel.validateJsonElement(jsonArrayenvironmentAccesses.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreatePermissionGroupRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreatePermissionGroupRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreatePermissionGroupRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreatePermissionGroupRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreatePermissionGroupRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreatePermissionGroupRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreatePermissionGroupRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreatePermissionGroupRequest + * @throws IOException if the JSON string is invalid with respect to CreatePermissionGroupRequest + */ + public static CreatePermissionGroupRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreatePermissionGroupRequest.class); + } + + /** + * Convert an instance of CreatePermissionGroupRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/CreateProductRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/CreateProductRequest.java new file mode 100644 index 0000000..cc1a2d6 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/CreateProductRequest.java @@ -0,0 +1,362 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * CreateProductRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class CreateProductRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_ORDER = "order"; + @SerializedName(SERIALIZED_NAME_ORDER) + private Integer order; + + public CreateProductRequest() { + } + + public CreateProductRequest name(String name) { + this.name = name; + return this; + } + + /** + * The name of the Product. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public CreateProductRequest description(String description) { + this.description = description; + return this; + } + + /** + * The description of the Product. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + + public CreateProductRequest order(Integer order) { + this.order = order; + return this; + } + + /** + * The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. + * @return order + */ + @javax.annotation.Nullable + public Integer getOrder() { + return order; + } + + public void setOrder(Integer order) { + this.order = order; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateProductRequest instance itself + */ + public CreateProductRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateProductRequest createProductRequest = (CreateProductRequest) o; + return Objects.equals(this.name, createProductRequest.name) && + Objects.equals(this.description, createProductRequest.description) && + Objects.equals(this.order, createProductRequest.order)&& + Objects.equals(this.additionalProperties, createProductRequest.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, order, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateProductRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("order"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateProductRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateProductRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateProductRequest is not found in the empty JSON string", CreateProductRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateProductRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateProductRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateProductRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateProductRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateProductRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateProductRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateProductRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateProductRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateProductRequest + * @throws IOException if the JSON string is invalid with respect to CreateProductRequest + */ + public static CreateProductRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateProductRequest.class); + } + + /** + * Convert an instance of CreateProductRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/CreateSegmentModel.java b/src/main/java/com/configcat/publicapi/java/client/model/CreateSegmentModel.java new file mode 100644 index 0000000..6cba1a2 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/CreateSegmentModel.java @@ -0,0 +1,426 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.RolloutRuleComparator; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * CreateSegmentModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class CreateSegmentModel { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_COMPARISON_ATTRIBUTE = "comparisonAttribute"; + @SerializedName(SERIALIZED_NAME_COMPARISON_ATTRIBUTE) + private String comparisonAttribute; + + public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; + @SerializedName(SERIALIZED_NAME_COMPARATOR) + private RolloutRuleComparator comparator; + + public static final String SERIALIZED_NAME_COMPARISON_VALUE = "comparisonValue"; + @SerializedName(SERIALIZED_NAME_COMPARISON_VALUE) + private String comparisonValue; + + public CreateSegmentModel() { + } + + public CreateSegmentModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Segment. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public CreateSegmentModel description(String description) { + this.description = description; + return this; + } + + /** + * Description of the Segment. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + + public CreateSegmentModel comparisonAttribute(String comparisonAttribute) { + this.comparisonAttribute = comparisonAttribute; + return this; + } + + /** + * The user's attribute the evaluation process must take into account. + * @return comparisonAttribute + */ + @javax.annotation.Nonnull + public String getComparisonAttribute() { + return comparisonAttribute; + } + + public void setComparisonAttribute(String comparisonAttribute) { + this.comparisonAttribute = comparisonAttribute; + } + + + public CreateSegmentModel comparator(RolloutRuleComparator comparator) { + this.comparator = comparator; + return this; + } + + /** + * Get comparator + * @return comparator + */ + @javax.annotation.Nonnull + public RolloutRuleComparator getComparator() { + return comparator; + } + + public void setComparator(RolloutRuleComparator comparator) { + this.comparator = comparator; + } + + + public CreateSegmentModel comparisonValue(String comparisonValue) { + this.comparisonValue = comparisonValue; + return this; + } + + /** + * The value to compare with the given user attribute's value. + * @return comparisonValue + */ + @javax.annotation.Nonnull + public String getComparisonValue() { + return comparisonValue; + } + + public void setComparisonValue(String comparisonValue) { + this.comparisonValue = comparisonValue; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateSegmentModel instance itself + */ + public CreateSegmentModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSegmentModel createSegmentModel = (CreateSegmentModel) o; + return Objects.equals(this.name, createSegmentModel.name) && + Objects.equals(this.description, createSegmentModel.description) && + Objects.equals(this.comparisonAttribute, createSegmentModel.comparisonAttribute) && + Objects.equals(this.comparator, createSegmentModel.comparator) && + Objects.equals(this.comparisonValue, createSegmentModel.comparisonValue)&& + Objects.equals(this.additionalProperties, createSegmentModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, comparisonAttribute, comparator, comparisonValue, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSegmentModel {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" comparisonAttribute: ").append(toIndentedString(comparisonAttribute)).append("\n"); + sb.append(" comparator: ").append(toIndentedString(comparator)).append("\n"); + sb.append(" comparisonValue: ").append(toIndentedString(comparisonValue)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("comparisonAttribute"); + openapiFields.add("comparator"); + openapiFields.add("comparisonValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("comparisonAttribute"); + openapiRequiredFields.add("comparator"); + openapiRequiredFields.add("comparisonValue"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSegmentModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateSegmentModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateSegmentModel is not found in the empty JSON string", CreateSegmentModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateSegmentModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if (!jsonObj.get("comparisonAttribute").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `comparisonAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonAttribute").toString())); + } + // validate the required field `comparator` + RolloutRuleComparator.validateJsonElement(jsonObj.get("comparator")); + if (!jsonObj.get("comparisonValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `comparisonValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonValue").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSegmentModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSegmentModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateSegmentModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSegmentModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateSegmentModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateSegmentModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSegmentModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSegmentModel + * @throws IOException if the JSON string is invalid with respect to CreateSegmentModel + */ + public static CreateSegmentModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSegmentModel.class); + } + + /** + * Convert an instance of CreateSegmentModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/CreateSettingInitialValues.java b/src/main/java/com/configcat/publicapi/java/client/model/CreateSettingInitialValues.java new file mode 100644 index 0000000..aef5085 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/CreateSettingInitialValues.java @@ -0,0 +1,537 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.InitialValue; +import com.configcat.publicapi.java.client.model.SettingType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * CreateSettingInitialValues + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class CreateSettingInitialValues { + public static final String SERIALIZED_NAME_HINT = "hint"; + @SerializedName(SERIALIZED_NAME_HINT) + private String hint; + + public static final String SERIALIZED_NAME_TAGS = "tags"; + @SerializedName(SERIALIZED_NAME_TAGS) + private List tags; + + public static final String SERIALIZED_NAME_ORDER = "order"; + @SerializedName(SERIALIZED_NAME_ORDER) + private Integer order; + + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SETTING_TYPE = "settingType"; + @SerializedName(SERIALIZED_NAME_SETTING_TYPE) + private SettingType settingType; + + public static final String SERIALIZED_NAME_INITIAL_VALUES = "initialValues"; + @SerializedName(SERIALIZED_NAME_INITIAL_VALUES) + private List initialValues; + + public static final String SERIALIZED_NAME_SETTING_ID_TO_INIT_FROM = "settingIdToInitFrom"; + @SerializedName(SERIALIZED_NAME_SETTING_ID_TO_INIT_FROM) + private Integer settingIdToInitFrom; + + public CreateSettingInitialValues() { + } + + public CreateSettingInitialValues hint(String hint) { + this.hint = hint; + return this; + } + + /** + * A short description for the setting, shown on the Dashboard UI. + * @return hint + */ + @javax.annotation.Nullable + public String getHint() { + return hint; + } + + public void setHint(String hint) { + this.hint = hint; + } + + + public CreateSettingInitialValues tags(List tags) { + this.tags = tags; + return this; + } + + public CreateSettingInitialValues addTagsItem(Long tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * The IDs of the tags which are attached to the setting. + * @return tags + */ + @javax.annotation.Nullable + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + + public CreateSettingInitialValues order(Integer order) { + this.order = order; + return this; + } + + /** + * The order of the Setting represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. + * @return order + */ + @javax.annotation.Nullable + public Integer getOrder() { + return order; + } + + public void setOrder(Integer order) { + this.order = order; + } + + + public CreateSettingInitialValues key(String key) { + this.key = key; + return this; + } + + /** + * The key of the Feature Flag or Setting. + * @return key + */ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + + public CreateSettingInitialValues name(String name) { + this.name = name; + return this; + } + + /** + * The name of the Feature Flag or Setting. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public CreateSettingInitialValues settingType(SettingType settingType) { + this.settingType = settingType; + return this; + } + + /** + * Get settingType + * @return settingType + */ + @javax.annotation.Nonnull + public SettingType getSettingType() { + return settingType; + } + + public void setSettingType(SettingType settingType) { + this.settingType = settingType; + } + + + public CreateSettingInitialValues initialValues(List initialValues) { + this.initialValues = initialValues; + return this; + } + + public CreateSettingInitialValues addInitialValuesItem(InitialValue initialValuesItem) { + if (this.initialValues == null) { + this.initialValues = new ArrayList<>(); + } + this.initialValues.add(initialValuesItem); + return this; + } + + /** + * Optional, initial value of the Feature Flag or Setting in the given Environments. Only one of the SettingIdToInitFrom or the InitialValues properties can be set. + * @return initialValues + */ + @javax.annotation.Nullable + public List getInitialValues() { + return initialValues; + } + + public void setInitialValues(List initialValues) { + this.initialValues = initialValues; + } + + + public CreateSettingInitialValues settingIdToInitFrom(Integer settingIdToInitFrom) { + this.settingIdToInitFrom = settingIdToInitFrom; + return this; + } + + /** + * Optional, the SettingId to initialize the values and tags of the Feature Flag or Setting from. Only can be set if you have at least ReadOnly access in all the Environments. Only one of the SettingIdToInitFrom or the InitialValues properties can be set. + * @return settingIdToInitFrom + */ + @javax.annotation.Nullable + public Integer getSettingIdToInitFrom() { + return settingIdToInitFrom; + } + + public void setSettingIdToInitFrom(Integer settingIdToInitFrom) { + this.settingIdToInitFrom = settingIdToInitFrom; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateSettingInitialValues instance itself + */ + public CreateSettingInitialValues putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSettingInitialValues createSettingInitialValues = (CreateSettingInitialValues) o; + return Objects.equals(this.hint, createSettingInitialValues.hint) && + Objects.equals(this.tags, createSettingInitialValues.tags) && + Objects.equals(this.order, createSettingInitialValues.order) && + Objects.equals(this.key, createSettingInitialValues.key) && + Objects.equals(this.name, createSettingInitialValues.name) && + Objects.equals(this.settingType, createSettingInitialValues.settingType) && + Objects.equals(this.initialValues, createSettingInitialValues.initialValues) && + Objects.equals(this.settingIdToInitFrom, createSettingInitialValues.settingIdToInitFrom)&& + Objects.equals(this.additionalProperties, createSettingInitialValues.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hint, tags, order, key, name, settingType, initialValues, settingIdToInitFrom, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSettingInitialValues {\n"); + sb.append(" hint: ").append(toIndentedString(hint)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" settingType: ").append(toIndentedString(settingType)).append("\n"); + sb.append(" initialValues: ").append(toIndentedString(initialValues)).append("\n"); + sb.append(" settingIdToInitFrom: ").append(toIndentedString(settingIdToInitFrom)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("hint"); + openapiFields.add("tags"); + openapiFields.add("order"); + openapiFields.add("key"); + openapiFields.add("name"); + openapiFields.add("settingType"); + openapiFields.add("initialValues"); + openapiFields.add("settingIdToInitFrom"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("settingType"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSettingInitialValues + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateSettingInitialValues.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateSettingInitialValues is not found in the empty JSON string", CreateSettingInitialValues.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateSettingInitialValues.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("hint") != null && !jsonObj.get("hint").isJsonNull()) && !jsonObj.get("hint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hint").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull() && !jsonObj.get("tags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + // validate the required field `settingType` + SettingType.validateJsonElement(jsonObj.get("settingType")); + if (jsonObj.get("initialValues") != null && !jsonObj.get("initialValues").isJsonNull()) { + JsonArray jsonArrayinitialValues = jsonObj.getAsJsonArray("initialValues"); + if (jsonArrayinitialValues != null) { + // ensure the json data is an array + if (!jsonObj.get("initialValues").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `initialValues` to be an array in the JSON string but got `%s`", jsonObj.get("initialValues").toString())); + } + + // validate the optional field `initialValues` (array) + for (int i = 0; i < jsonArrayinitialValues.size(); i++) { + InitialValue.validateJsonElement(jsonArrayinitialValues.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSettingInitialValues.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSettingInitialValues' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateSettingInitialValues.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSettingInitialValues value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateSettingInitialValues read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateSettingInitialValues instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSettingInitialValues given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSettingInitialValues + * @throws IOException if the JSON string is invalid with respect to CreateSettingInitialValues + */ + public static CreateSettingInitialValues fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSettingInitialValues.class); + } + + /** + * Convert an instance of CreateSettingInitialValues to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/CreateTagModel.java b/src/main/java/com/configcat/publicapi/java/client/model/CreateTagModel.java new file mode 100644 index 0000000..62040b7 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/CreateTagModel.java @@ -0,0 +1,336 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * CreateTagModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class CreateTagModel { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_COLOR = "color"; + @SerializedName(SERIALIZED_NAME_COLOR) + private String color; + + public CreateTagModel() { + } + + public CreateTagModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Tag. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public CreateTagModel color(String color) { + this.color = color; + return this; + } + + /** + * Color of the Tag. Possible values: `panther`, `whale`, `salmon`, `lizard`, `canary`, `koala`, or any HTML color code. + * @return color + */ + @javax.annotation.Nullable + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateTagModel instance itself + */ + public CreateTagModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTagModel createTagModel = (CreateTagModel) o; + return Objects.equals(this.name, createTagModel.name) && + Objects.equals(this.color, createTagModel.color)&& + Objects.equals(this.additionalProperties, createTagModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, color, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTagModel {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("color"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateTagModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateTagModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateTagModel is not found in the empty JSON string", CreateTagModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateTagModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("color") != null && !jsonObj.get("color").isJsonNull()) && !jsonObj.get("color").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateTagModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateTagModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateTagModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateTagModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateTagModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateTagModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateTagModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateTagModel + * @throws IOException if the JSON string is invalid with respect to CreateTagModel + */ + public static CreateTagModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateTagModel.class); + } + + /** + * Convert an instance of CreateTagModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/DeleteIntegrationLinkModel.java b/src/main/java/com/configcat/publicapi/java/client/model/DeleteIntegrationLinkModel.java new file mode 100644 index 0000000..3f07e51 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/DeleteIntegrationLinkModel.java @@ -0,0 +1,292 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * DeleteIntegrationLinkModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class DeleteIntegrationLinkModel { + public static final String SERIALIZED_NAME_HAS_REMAINING_INTEGRATION_LINK = "hasRemainingIntegrationLink"; + @SerializedName(SERIALIZED_NAME_HAS_REMAINING_INTEGRATION_LINK) + private Boolean hasRemainingIntegrationLink; + + public DeleteIntegrationLinkModel() { + } + + public DeleteIntegrationLinkModel hasRemainingIntegrationLink(Boolean hasRemainingIntegrationLink) { + this.hasRemainingIntegrationLink = hasRemainingIntegrationLink; + return this; + } + + /** + * Get hasRemainingIntegrationLink + * @return hasRemainingIntegrationLink + */ + @javax.annotation.Nonnull + public Boolean getHasRemainingIntegrationLink() { + return hasRemainingIntegrationLink; + } + + public void setHasRemainingIntegrationLink(Boolean hasRemainingIntegrationLink) { + this.hasRemainingIntegrationLink = hasRemainingIntegrationLink; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DeleteIntegrationLinkModel instance itself + */ + public DeleteIntegrationLinkModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteIntegrationLinkModel deleteIntegrationLinkModel = (DeleteIntegrationLinkModel) o; + return Objects.equals(this.hasRemainingIntegrationLink, deleteIntegrationLinkModel.hasRemainingIntegrationLink)&& + Objects.equals(this.additionalProperties, deleteIntegrationLinkModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(hasRemainingIntegrationLink, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteIntegrationLinkModel {\n"); + sb.append(" hasRemainingIntegrationLink: ").append(toIndentedString(hasRemainingIntegrationLink)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("hasRemainingIntegrationLink"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("hasRemainingIntegrationLink"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteIntegrationLinkModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DeleteIntegrationLinkModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteIntegrationLinkModel is not found in the empty JSON string", DeleteIntegrationLinkModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteIntegrationLinkModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteIntegrationLinkModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteIntegrationLinkModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteIntegrationLinkModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteIntegrationLinkModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DeleteIntegrationLinkModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DeleteIntegrationLinkModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteIntegrationLinkModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteIntegrationLinkModel + * @throws IOException if the JSON string is invalid with respect to DeleteIntegrationLinkModel + */ + public static DeleteIntegrationLinkModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteIntegrationLinkModel.class); + } + + /** + * Convert an instance of DeleteIntegrationLinkModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/DeleteRepositoryReportsRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/DeleteRepositoryReportsRequest.java new file mode 100644 index 0000000..f937624 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/DeleteRepositoryReportsRequest.java @@ -0,0 +1,393 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * DeleteRepositoryReportsRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class DeleteRepositoryReportsRequest { + public static final String SERIALIZED_NAME_CONFIG_ID = "configId"; + @SerializedName(SERIALIZED_NAME_CONFIG_ID) + private UUID configId; + + public static final String SERIALIZED_NAME_REPOSITORY = "repository"; + @SerializedName(SERIALIZED_NAME_REPOSITORY) + private String repository; + + public static final String SERIALIZED_NAME_BRANCH = "branch"; + @SerializedName(SERIALIZED_NAME_BRANCH) + private String branch; + + public static final String SERIALIZED_NAME_SETTING_ID = "settingId"; + @SerializedName(SERIALIZED_NAME_SETTING_ID) + private Integer settingId; + + public DeleteRepositoryReportsRequest() { + } + + public DeleteRepositoryReportsRequest configId(UUID configId) { + this.configId = configId; + return this; + } + + /** + * The Config's identifier from where the reports should be deleted. + * @return configId + */ + @javax.annotation.Nonnull + public UUID getConfigId() { + return configId; + } + + public void setConfigId(UUID configId) { + this.configId = configId; + } + + + public DeleteRepositoryReportsRequest repository(String repository) { + this.repository = repository; + return this; + } + + /** + * The source control repository which's reports should be deleted. + * @return repository + */ + @javax.annotation.Nonnull + public String getRepository() { + return repository; + } + + public void setRepository(String repository) { + this.repository = repository; + } + + + public DeleteRepositoryReportsRequest branch(String branch) { + this.branch = branch; + return this; + } + + /** + * If it's set, only this branch's reports belonging to the given repository will be deleted. + * @return branch + */ + @javax.annotation.Nullable + public String getBranch() { + return branch; + } + + public void setBranch(String branch) { + this.branch = branch; + } + + + public DeleteRepositoryReportsRequest settingId(Integer settingId) { + this.settingId = settingId; + return this; + } + + /** + * If it's set, only this setting's reports belonging to the given repository will be deleted. + * @return settingId + */ + @javax.annotation.Nullable + public Integer getSettingId() { + return settingId; + } + + public void setSettingId(Integer settingId) { + this.settingId = settingId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DeleteRepositoryReportsRequest instance itself + */ + public DeleteRepositoryReportsRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteRepositoryReportsRequest deleteRepositoryReportsRequest = (DeleteRepositoryReportsRequest) o; + return Objects.equals(this.configId, deleteRepositoryReportsRequest.configId) && + Objects.equals(this.repository, deleteRepositoryReportsRequest.repository) && + Objects.equals(this.branch, deleteRepositoryReportsRequest.branch) && + Objects.equals(this.settingId, deleteRepositoryReportsRequest.settingId)&& + Objects.equals(this.additionalProperties, deleteRepositoryReportsRequest.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(configId, repository, branch, settingId, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteRepositoryReportsRequest {\n"); + sb.append(" configId: ").append(toIndentedString(configId)).append("\n"); + sb.append(" repository: ").append(toIndentedString(repository)).append("\n"); + sb.append(" branch: ").append(toIndentedString(branch)).append("\n"); + sb.append(" settingId: ").append(toIndentedString(settingId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("configId"); + openapiFields.add("repository"); + openapiFields.add("branch"); + openapiFields.add("settingId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("configId"); + openapiRequiredFields.add("repository"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteRepositoryReportsRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DeleteRepositoryReportsRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteRepositoryReportsRequest is not found in the empty JSON string", DeleteRepositoryReportsRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteRepositoryReportsRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("configId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `configId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("configId").toString())); + } + if (!jsonObj.get("repository").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `repository` to be a primitive type in the JSON string but got `%s`", jsonObj.get("repository").toString())); + } + if ((jsonObj.get("branch") != null && !jsonObj.get("branch").isJsonNull()) && !jsonObj.get("branch").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `branch` to be a primitive type in the JSON string but got `%s`", jsonObj.get("branch").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteRepositoryReportsRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteRepositoryReportsRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteRepositoryReportsRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteRepositoryReportsRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DeleteRepositoryReportsRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DeleteRepositoryReportsRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteRepositoryReportsRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteRepositoryReportsRequest + * @throws IOException if the JSON string is invalid with respect to DeleteRepositoryReportsRequest + */ + public static DeleteRepositoryReportsRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteRepositoryReportsRequest.class); + } + + /** + * Convert an instance of DeleteRepositoryReportsRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/DeletedSettingModel.java b/src/main/java/com/configcat/publicapi/java/client/model/DeletedSettingModel.java new file mode 100644 index 0000000..bccf6df --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/DeletedSettingModel.java @@ -0,0 +1,372 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.SettingType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * DeletedSettingModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class DeletedSettingModel { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_HINT = "hint"; + @SerializedName(SERIALIZED_NAME_HINT) + private String hint; + + public static final String SERIALIZED_NAME_SETTING_TYPE = "settingType"; + @SerializedName(SERIALIZED_NAME_SETTING_TYPE) + private SettingType settingType; + + public DeletedSettingModel() { + } + + public DeletedSettingModel( + String key, + String name, + String hint + ) { + this(); + this.key = key; + this.name = name; + this.hint = hint; + } + + /** + * Key of the Feature Flag or Setting. + * @return key + */ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + + /** + * Name of the Feature Flag or Setting. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + + /** + * Description of the Feature Flag or Setting. + * @return hint + */ + @javax.annotation.Nullable + public String getHint() { + return hint; + } + + + + public DeletedSettingModel settingType(SettingType settingType) { + this.settingType = settingType; + return this; + } + + /** + * Get settingType + * @return settingType + */ + @javax.annotation.Nonnull + public SettingType getSettingType() { + return settingType; + } + + public void setSettingType(SettingType settingType) { + this.settingType = settingType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DeletedSettingModel instance itself + */ + public DeletedSettingModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeletedSettingModel deletedSettingModel = (DeletedSettingModel) o; + return Objects.equals(this.key, deletedSettingModel.key) && + Objects.equals(this.name, deletedSettingModel.name) && + Objects.equals(this.hint, deletedSettingModel.hint) && + Objects.equals(this.settingType, deletedSettingModel.settingType)&& + Objects.equals(this.additionalProperties, deletedSettingModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(key, name, hint, settingType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeletedSettingModel {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" hint: ").append(toIndentedString(hint)).append("\n"); + sb.append(" settingType: ").append(toIndentedString(settingType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("name"); + openapiFields.add("hint"); + openapiFields.add("settingType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("hint"); + openapiRequiredFields.add("settingType"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeletedSettingModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DeletedSettingModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeletedSettingModel is not found in the empty JSON string", DeletedSettingModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeletedSettingModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("hint") != null && !jsonObj.get("hint").isJsonNull()) && !jsonObj.get("hint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hint").toString())); + } + // validate the required field `settingType` + SettingType.validateJsonElement(jsonObj.get("settingType")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeletedSettingModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeletedSettingModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeletedSettingModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeletedSettingModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DeletedSettingModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DeletedSettingModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeletedSettingModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeletedSettingModel + * @throws IOException if the JSON string is invalid with respect to DeletedSettingModel + */ + public static DeletedSettingModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeletedSettingModel.class); + } + + /** + * Convert an instance of DeletedSettingModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessModel.java b/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessModel.java new file mode 100644 index 0000000..a1b8751 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessModel.java @@ -0,0 +1,470 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.EnvironmentAccessType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * EnvironmentAccessModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class EnvironmentAccessModel { + public static final String SERIALIZED_NAME_ENVIRONMENT_ID = "environmentId"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) + private UUID environmentId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_COLOR = "color"; + @SerializedName(SERIALIZED_NAME_COLOR) + private String color; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_ORDER = "order"; + @SerializedName(SERIALIZED_NAME_ORDER) + private Integer order; + + public static final String SERIALIZED_NAME_REASON_REQUIRED = "reasonRequired"; + @SerializedName(SERIALIZED_NAME_REASON_REQUIRED) + private Boolean reasonRequired; + + public static final String SERIALIZED_NAME_ENVIRONMENT_ACCESS_TYPE = "environmentAccessType"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ACCESS_TYPE) + private EnvironmentAccessType environmentAccessType; + + public EnvironmentAccessModel() { + } + + public EnvironmentAccessModel environmentId(UUID environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Identifier of the Environment. + * @return environmentId + */ + @javax.annotation.Nonnull + public UUID getEnvironmentId() { + return environmentId; + } + + public void setEnvironmentId(UUID environmentId) { + this.environmentId = environmentId; + } + + + public EnvironmentAccessModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Environment. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public EnvironmentAccessModel color(String color) { + this.color = color; + return this; + } + + /** + * Color of the Environment. + * @return color + */ + @javax.annotation.Nullable + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + + public EnvironmentAccessModel description(String description) { + this.description = description; + return this; + } + + /** + * Description of the Environment. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + + public EnvironmentAccessModel order(Integer order) { + this.order = order; + return this; + } + + /** + * The order of the Environment represented on the ConfigCat Dashboard. + * @return order + */ + @javax.annotation.Nonnull + public Integer getOrder() { + return order; + } + + public void setOrder(Integer order) { + this.order = order; + } + + + public EnvironmentAccessModel reasonRequired(Boolean reasonRequired) { + this.reasonRequired = reasonRequired; + return this; + } + + /** + * Determines whether a mandatory reason must be given every time when the Feature Flags or Settings in the given Environment are saved. + * @return reasonRequired + */ + @javax.annotation.Nonnull + public Boolean getReasonRequired() { + return reasonRequired; + } + + public void setReasonRequired(Boolean reasonRequired) { + this.reasonRequired = reasonRequired; + } + + + public EnvironmentAccessModel environmentAccessType(EnvironmentAccessType environmentAccessType) { + this.environmentAccessType = environmentAccessType; + return this; + } + + /** + * Get environmentAccessType + * @return environmentAccessType + */ + @javax.annotation.Nonnull + public EnvironmentAccessType getEnvironmentAccessType() { + return environmentAccessType; + } + + public void setEnvironmentAccessType(EnvironmentAccessType environmentAccessType) { + this.environmentAccessType = environmentAccessType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the EnvironmentAccessModel instance itself + */ + public EnvironmentAccessModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnvironmentAccessModel environmentAccessModel = (EnvironmentAccessModel) o; + return Objects.equals(this.environmentId, environmentAccessModel.environmentId) && + Objects.equals(this.name, environmentAccessModel.name) && + Objects.equals(this.color, environmentAccessModel.color) && + Objects.equals(this.description, environmentAccessModel.description) && + Objects.equals(this.order, environmentAccessModel.order) && + Objects.equals(this.reasonRequired, environmentAccessModel.reasonRequired) && + Objects.equals(this.environmentAccessType, environmentAccessModel.environmentAccessType)&& + Objects.equals(this.additionalProperties, environmentAccessModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(environmentId, name, color, description, order, reasonRequired, environmentAccessType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnvironmentAccessModel {\n"); + sb.append(" environmentId: ").append(toIndentedString(environmentId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append(" reasonRequired: ").append(toIndentedString(reasonRequired)).append("\n"); + sb.append(" environmentAccessType: ").append(toIndentedString(environmentAccessType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("environmentId"); + openapiFields.add("name"); + openapiFields.add("color"); + openapiFields.add("description"); + openapiFields.add("order"); + openapiFields.add("reasonRequired"); + openapiFields.add("environmentAccessType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("environmentId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("color"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("order"); + openapiRequiredFields.add("reasonRequired"); + openapiRequiredFields.add("environmentAccessType"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EnvironmentAccessModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EnvironmentAccessModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EnvironmentAccessModel is not found in the empty JSON string", EnvironmentAccessModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EnvironmentAccessModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("environmentId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `environmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentId").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("color") != null && !jsonObj.get("color").isJsonNull()) && !jsonObj.get("color").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + // validate the required field `environmentAccessType` + EnvironmentAccessType.validateJsonElement(jsonObj.get("environmentAccessType")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EnvironmentAccessModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EnvironmentAccessModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EnvironmentAccessModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EnvironmentAccessModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public EnvironmentAccessModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EnvironmentAccessModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EnvironmentAccessModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of EnvironmentAccessModel + * @throws IOException if the JSON string is invalid with respect to EnvironmentAccessModel + */ + public static EnvironmentAccessModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EnvironmentAccessModel.class); + } + + /** + * Convert an instance of EnvironmentAccessModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessType.java b/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessType.java new file mode 100644 index 0000000..ccd5963 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessType.java @@ -0,0 +1,80 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Represent the environment specific Feature Management permission. + */ +@JsonAdapter(EnvironmentAccessType.Adapter.class) +public enum EnvironmentAccessType { + + FULL("full"), + + READ_ONLY("readOnly"), + + NONE("none"); + + private String value; + + EnvironmentAccessType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnvironmentAccessType fromValue(String value) { + for (EnvironmentAccessType b : EnvironmentAccessType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EnvironmentAccessType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EnvironmentAccessType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EnvironmentAccessType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EnvironmentAccessType.fromValue(value); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentModel.java b/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentModel.java new file mode 100644 index 0000000..cca082c --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentModel.java @@ -0,0 +1,470 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.ProductModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Details of the Environment. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class EnvironmentModel { + public static final String SERIALIZED_NAME_PRODUCT = "product"; + @SerializedName(SERIALIZED_NAME_PRODUCT) + private ProductModel product; + + public static final String SERIALIZED_NAME_ENVIRONMENT_ID = "environmentId"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) + private UUID environmentId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_COLOR = "color"; + @SerializedName(SERIALIZED_NAME_COLOR) + private String color; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_ORDER = "order"; + @SerializedName(SERIALIZED_NAME_ORDER) + private Integer order; + + public static final String SERIALIZED_NAME_REASON_REQUIRED = "reasonRequired"; + @SerializedName(SERIALIZED_NAME_REASON_REQUIRED) + private Boolean reasonRequired; + + public EnvironmentModel() { + } + + public EnvironmentModel product(ProductModel product) { + this.product = product; + return this; + } + + /** + * Get product + * @return product + */ + @javax.annotation.Nonnull + public ProductModel getProduct() { + return product; + } + + public void setProduct(ProductModel product) { + this.product = product; + } + + + public EnvironmentModel environmentId(UUID environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Identifier of the Environment. + * @return environmentId + */ + @javax.annotation.Nonnull + public UUID getEnvironmentId() { + return environmentId; + } + + public void setEnvironmentId(UUID environmentId) { + this.environmentId = environmentId; + } + + + public EnvironmentModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Environment. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public EnvironmentModel color(String color) { + this.color = color; + return this; + } + + /** + * The configured color of the Environment. + * @return color + */ + @javax.annotation.Nullable + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + + public EnvironmentModel description(String description) { + this.description = description; + return this; + } + + /** + * Description of the Environment. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + + public EnvironmentModel order(Integer order) { + this.order = order; + return this; + } + + /** + * The order of the Environment represented on the ConfigCat Dashboard. + * @return order + */ + @javax.annotation.Nonnull + public Integer getOrder() { + return order; + } + + public void setOrder(Integer order) { + this.order = order; + } + + + public EnvironmentModel reasonRequired(Boolean reasonRequired) { + this.reasonRequired = reasonRequired; + return this; + } + + /** + * Determines whether a mandatory reason must be given every time when the Feature Flags or Settings in the given Environment are saved. + * @return reasonRequired + */ + @javax.annotation.Nonnull + public Boolean getReasonRequired() { + return reasonRequired; + } + + public void setReasonRequired(Boolean reasonRequired) { + this.reasonRequired = reasonRequired; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the EnvironmentModel instance itself + */ + public EnvironmentModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnvironmentModel environmentModel = (EnvironmentModel) o; + return Objects.equals(this.product, environmentModel.product) && + Objects.equals(this.environmentId, environmentModel.environmentId) && + Objects.equals(this.name, environmentModel.name) && + Objects.equals(this.color, environmentModel.color) && + Objects.equals(this.description, environmentModel.description) && + Objects.equals(this.order, environmentModel.order) && + Objects.equals(this.reasonRequired, environmentModel.reasonRequired)&& + Objects.equals(this.additionalProperties, environmentModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(product, environmentId, name, color, description, order, reasonRequired, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnvironmentModel {\n"); + sb.append(" product: ").append(toIndentedString(product)).append("\n"); + sb.append(" environmentId: ").append(toIndentedString(environmentId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append(" reasonRequired: ").append(toIndentedString(reasonRequired)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("product"); + openapiFields.add("environmentId"); + openapiFields.add("name"); + openapiFields.add("color"); + openapiFields.add("description"); + openapiFields.add("order"); + openapiFields.add("reasonRequired"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("product"); + openapiRequiredFields.add("environmentId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("color"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("order"); + openapiRequiredFields.add("reasonRequired"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EnvironmentModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EnvironmentModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EnvironmentModel is not found in the empty JSON string", EnvironmentModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EnvironmentModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `product` + ProductModel.validateJsonElement(jsonObj.get("product")); + if (!jsonObj.get("environmentId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `environmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("color") != null && !jsonObj.get("color").isJsonNull()) && !jsonObj.get("color").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EnvironmentModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EnvironmentModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EnvironmentModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EnvironmentModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public EnvironmentModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EnvironmentModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EnvironmentModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of EnvironmentModel + * @throws IOException if the JSON string is invalid with respect to EnvironmentModel + */ + public static EnvironmentModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EnvironmentModel.class); + } + + /** + * Convert an instance of EnvironmentModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/EvaluationVersion.java b/src/main/java/com/configcat/publicapi/java/client/model/EvaluationVersion.java new file mode 100644 index 0000000..6a6d48d --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/EvaluationVersion.java @@ -0,0 +1,78 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Determines the evaluation version of a Config. Using `v2` enables the new features of Config V2 (https://configcat.com/docs/advanced/config-v2). + */ +@JsonAdapter(EvaluationVersion.Adapter.class) +public enum EvaluationVersion { + + V1("v1"), + + V2("v2"); + + private String value; + + EvaluationVersion(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EvaluationVersion fromValue(String value) { + for (EvaluationVersion b : EvaluationVersion.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EvaluationVersion enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EvaluationVersion read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EvaluationVersion.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EvaluationVersion.fromValue(value); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/FeatureFlagLimitations.java b/src/main/java/com/configcat/publicapi/java/client/model/FeatureFlagLimitations.java new file mode 100644 index 0000000..25e18a5 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/FeatureFlagLimitations.java @@ -0,0 +1,454 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Subscription limitations regarding Feature flag or Setting values and targeting. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class FeatureFlagLimitations { + public static final String SERIALIZED_NAME_MAX_PERCENTAGE_OPTION_COUNT = "maxPercentageOptionCount"; + @SerializedName(SERIALIZED_NAME_MAX_PERCENTAGE_OPTION_COUNT) + private Integer maxPercentageOptionCount; + + public static final String SERIALIZED_NAME_MAX_TARGETING_RULE_COUNT = "maxTargetingRuleCount"; + @SerializedName(SERIALIZED_NAME_MAX_TARGETING_RULE_COUNT) + private Integer maxTargetingRuleCount; + + public static final String SERIALIZED_NAME_MAX_COMPARISON_VALUE_LENGTH = "maxComparisonValueLength"; + @SerializedName(SERIALIZED_NAME_MAX_COMPARISON_VALUE_LENGTH) + private Integer maxComparisonValueLength; + + public static final String SERIALIZED_NAME_MAX_COMPARISON_VALUE_LIST_LENGTH = "maxComparisonValueListLength"; + @SerializedName(SERIALIZED_NAME_MAX_COMPARISON_VALUE_LIST_LENGTH) + private Integer maxComparisonValueListLength; + + public static final String SERIALIZED_NAME_MAX_COMPARISON_VALUE_LIST_ITEM_LENGTH = "maxComparisonValueListItemLength"; + @SerializedName(SERIALIZED_NAME_MAX_COMPARISON_VALUE_LIST_ITEM_LENGTH) + private Integer maxComparisonValueListItemLength; + + public static final String SERIALIZED_NAME_MAX_STRING_FLAG_VALUE_LENGTH = "maxStringFlagValueLength"; + @SerializedName(SERIALIZED_NAME_MAX_STRING_FLAG_VALUE_LENGTH) + private Integer maxStringFlagValueLength; + + public static final String SERIALIZED_NAME_MAX_CONDITION_PER_TARGETING_RULE_COUNT = "maxConditionPerTargetingRuleCount"; + @SerializedName(SERIALIZED_NAME_MAX_CONDITION_PER_TARGETING_RULE_COUNT) + private Integer maxConditionPerTargetingRuleCount; + + public FeatureFlagLimitations() { + } + + public FeatureFlagLimitations maxPercentageOptionCount(Integer maxPercentageOptionCount) { + this.maxPercentageOptionCount = maxPercentageOptionCount; + return this; + } + + /** + * Maximum number of percentage options a Feature Flag or Setting can have within a targeting rule. + * @return maxPercentageOptionCount + */ + @javax.annotation.Nonnull + public Integer getMaxPercentageOptionCount() { + return maxPercentageOptionCount; + } + + public void setMaxPercentageOptionCount(Integer maxPercentageOptionCount) { + this.maxPercentageOptionCount = maxPercentageOptionCount; + } + + + public FeatureFlagLimitations maxTargetingRuleCount(Integer maxTargetingRuleCount) { + this.maxTargetingRuleCount = maxTargetingRuleCount; + return this; + } + + /** + * Maximum number of targeting rules a Feature Flag or Setting can have. + * @return maxTargetingRuleCount + */ + @javax.annotation.Nonnull + public Integer getMaxTargetingRuleCount() { + return maxTargetingRuleCount; + } + + public void setMaxTargetingRuleCount(Integer maxTargetingRuleCount) { + this.maxTargetingRuleCount = maxTargetingRuleCount; + } + + + public FeatureFlagLimitations maxComparisonValueLength(Integer maxComparisonValueLength) { + this.maxComparisonValueLength = maxComparisonValueLength; + return this; + } + + /** + * Maximum length of a text comparison value. + * @return maxComparisonValueLength + */ + @javax.annotation.Nonnull + public Integer getMaxComparisonValueLength() { + return maxComparisonValueLength; + } + + public void setMaxComparisonValueLength(Integer maxComparisonValueLength) { + this.maxComparisonValueLength = maxComparisonValueLength; + } + + + public FeatureFlagLimitations maxComparisonValueListLength(Integer maxComparisonValueListLength) { + this.maxComparisonValueListLength = maxComparisonValueListLength; + return this; + } + + /** + * Maximum item count of a list comparison value. + * @return maxComparisonValueListLength + */ + @javax.annotation.Nonnull + public Integer getMaxComparisonValueListLength() { + return maxComparisonValueListLength; + } + + public void setMaxComparisonValueListLength(Integer maxComparisonValueListLength) { + this.maxComparisonValueListLength = maxComparisonValueListLength; + } + + + public FeatureFlagLimitations maxComparisonValueListItemLength(Integer maxComparisonValueListItemLength) { + this.maxComparisonValueListItemLength = maxComparisonValueListItemLength; + return this; + } + + /** + * Maximum length of a list comparison value's item. + * @return maxComparisonValueListItemLength + */ + @javax.annotation.Nonnull + public Integer getMaxComparisonValueListItemLength() { + return maxComparisonValueListItemLength; + } + + public void setMaxComparisonValueListItemLength(Integer maxComparisonValueListItemLength) { + this.maxComparisonValueListItemLength = maxComparisonValueListItemLength; + } + + + public FeatureFlagLimitations maxStringFlagValueLength(Integer maxStringFlagValueLength) { + this.maxStringFlagValueLength = maxStringFlagValueLength; + return this; + } + + /** + * Maximum length of a text Setting's value. + * @return maxStringFlagValueLength + */ + @javax.annotation.Nonnull + public Integer getMaxStringFlagValueLength() { + return maxStringFlagValueLength; + } + + public void setMaxStringFlagValueLength(Integer maxStringFlagValueLength) { + this.maxStringFlagValueLength = maxStringFlagValueLength; + } + + + public FeatureFlagLimitations maxConditionPerTargetingRuleCount(Integer maxConditionPerTargetingRuleCount) { + this.maxConditionPerTargetingRuleCount = maxConditionPerTargetingRuleCount; + return this; + } + + /** + * Maximum number of `AND` conditions a Feature Flag or Setting can have within a targeting rule. + * @return maxConditionPerTargetingRuleCount + */ + @javax.annotation.Nonnull + public Integer getMaxConditionPerTargetingRuleCount() { + return maxConditionPerTargetingRuleCount; + } + + public void setMaxConditionPerTargetingRuleCount(Integer maxConditionPerTargetingRuleCount) { + this.maxConditionPerTargetingRuleCount = maxConditionPerTargetingRuleCount; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the FeatureFlagLimitations instance itself + */ + public FeatureFlagLimitations putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FeatureFlagLimitations featureFlagLimitations = (FeatureFlagLimitations) o; + return Objects.equals(this.maxPercentageOptionCount, featureFlagLimitations.maxPercentageOptionCount) && + Objects.equals(this.maxTargetingRuleCount, featureFlagLimitations.maxTargetingRuleCount) && + Objects.equals(this.maxComparisonValueLength, featureFlagLimitations.maxComparisonValueLength) && + Objects.equals(this.maxComparisonValueListLength, featureFlagLimitations.maxComparisonValueListLength) && + Objects.equals(this.maxComparisonValueListItemLength, featureFlagLimitations.maxComparisonValueListItemLength) && + Objects.equals(this.maxStringFlagValueLength, featureFlagLimitations.maxStringFlagValueLength) && + Objects.equals(this.maxConditionPerTargetingRuleCount, featureFlagLimitations.maxConditionPerTargetingRuleCount)&& + Objects.equals(this.additionalProperties, featureFlagLimitations.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(maxPercentageOptionCount, maxTargetingRuleCount, maxComparisonValueLength, maxComparisonValueListLength, maxComparisonValueListItemLength, maxStringFlagValueLength, maxConditionPerTargetingRuleCount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FeatureFlagLimitations {\n"); + sb.append(" maxPercentageOptionCount: ").append(toIndentedString(maxPercentageOptionCount)).append("\n"); + sb.append(" maxTargetingRuleCount: ").append(toIndentedString(maxTargetingRuleCount)).append("\n"); + sb.append(" maxComparisonValueLength: ").append(toIndentedString(maxComparisonValueLength)).append("\n"); + sb.append(" maxComparisonValueListLength: ").append(toIndentedString(maxComparisonValueListLength)).append("\n"); + sb.append(" maxComparisonValueListItemLength: ").append(toIndentedString(maxComparisonValueListItemLength)).append("\n"); + sb.append(" maxStringFlagValueLength: ").append(toIndentedString(maxStringFlagValueLength)).append("\n"); + sb.append(" maxConditionPerTargetingRuleCount: ").append(toIndentedString(maxConditionPerTargetingRuleCount)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("maxPercentageOptionCount"); + openapiFields.add("maxTargetingRuleCount"); + openapiFields.add("maxComparisonValueLength"); + openapiFields.add("maxComparisonValueListLength"); + openapiFields.add("maxComparisonValueListItemLength"); + openapiFields.add("maxStringFlagValueLength"); + openapiFields.add("maxConditionPerTargetingRuleCount"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("maxPercentageOptionCount"); + openapiRequiredFields.add("maxTargetingRuleCount"); + openapiRequiredFields.add("maxComparisonValueLength"); + openapiRequiredFields.add("maxComparisonValueListLength"); + openapiRequiredFields.add("maxComparisonValueListItemLength"); + openapiRequiredFields.add("maxStringFlagValueLength"); + openapiRequiredFields.add("maxConditionPerTargetingRuleCount"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FeatureFlagLimitations + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FeatureFlagLimitations.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FeatureFlagLimitations is not found in the empty JSON string", FeatureFlagLimitations.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FeatureFlagLimitations.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FeatureFlagLimitations.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FeatureFlagLimitations' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FeatureFlagLimitations.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FeatureFlagLimitations value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public FeatureFlagLimitations read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + FeatureFlagLimitations instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FeatureFlagLimitations given an JSON string + * + * @param jsonString JSON string + * @return An instance of FeatureFlagLimitations + * @throws IOException if the JSON string is invalid with respect to FeatureFlagLimitations + */ + public static FeatureFlagLimitations fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FeatureFlagLimitations.class); + } + + /** + * Convert an instance of FeatureFlagLimitations to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/FlagReference.java b/src/main/java/com/configcat/publicapi/java/client/model/FlagReference.java new file mode 100644 index 0000000..804e9a4 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/FlagReference.java @@ -0,0 +1,340 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.ReferenceLinesRequest; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * FlagReference + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class FlagReference { + public static final String SERIALIZED_NAME_SETTING_ID = "settingId"; + @SerializedName(SERIALIZED_NAME_SETTING_ID) + private Integer settingId; + + public static final String SERIALIZED_NAME_REFERENCES = "references"; + @SerializedName(SERIALIZED_NAME_REFERENCES) + private List references = new ArrayList<>(); + + public FlagReference() { + } + + public FlagReference settingId(Integer settingId) { + this.settingId = settingId; + return this; + } + + /** + * The identifier of the Feature Flag or Setting the code reference belongs to. + * @return settingId + */ + @javax.annotation.Nonnull + public Integer getSettingId() { + return settingId; + } + + public void setSettingId(Integer settingId) { + this.settingId = settingId; + } + + + public FlagReference references(List references) { + this.references = references; + return this; + } + + public FlagReference addReferencesItem(ReferenceLinesRequest referencesItem) { + if (this.references == null) { + this.references = new ArrayList<>(); + } + this.references.add(referencesItem); + return this; + } + + /** + * The actual references to the given Feature Flag or Setting. + * @return references + */ + @javax.annotation.Nonnull + public List getReferences() { + return references; + } + + public void setReferences(List references) { + this.references = references; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the FlagReference instance itself + */ + public FlagReference putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FlagReference flagReference = (FlagReference) o; + return Objects.equals(this.settingId, flagReference.settingId) && + Objects.equals(this.references, flagReference.references)&& + Objects.equals(this.additionalProperties, flagReference.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(settingId, references, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FlagReference {\n"); + sb.append(" settingId: ").append(toIndentedString(settingId)).append("\n"); + sb.append(" references: ").append(toIndentedString(references)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("settingId"); + openapiFields.add("references"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("settingId"); + openapiRequiredFields.add("references"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FlagReference + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FlagReference.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FlagReference is not found in the empty JSON string", FlagReference.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FlagReference.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("references").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `references` to be an array in the JSON string but got `%s`", jsonObj.get("references").toString())); + } + + JsonArray jsonArrayreferences = jsonObj.getAsJsonArray("references"); + // validate the required field `references` (array) + for (int i = 0; i < jsonArrayreferences.size(); i++) { + ReferenceLinesRequest.validateJsonElement(jsonArrayreferences.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FlagReference.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FlagReference' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FlagReference.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FlagReference value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public FlagReference read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + FlagReference instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FlagReference given an JSON string + * + * @param jsonString JSON string + * @return An instance of FlagReference + * @throws IOException if the JSON string is invalid with respect to FlagReference + */ + public static FlagReference fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FlagReference.class); + } + + /** + * Convert an instance of FlagReference to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/InitialValue.java b/src/main/java/com/configcat/publicapi/java/client/model/InitialValue.java new file mode 100644 index 0000000..0255f5a --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/InitialValue.java @@ -0,0 +1,325 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.SettingValueType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * InitialValue + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class InitialValue { + public static final String SERIALIZED_NAME_ENVIRONMENT_ID = "environmentId"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) + private UUID environmentId; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private SettingValueType value; + + public InitialValue() { + } + + public InitialValue environmentId(UUID environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * The ID of the Environment where the initial value must be set. + * @return environmentId + */ + @javax.annotation.Nullable + public UUID getEnvironmentId() { + return environmentId; + } + + public void setEnvironmentId(UUID environmentId) { + this.environmentId = environmentId; + } + + + public InitialValue value(SettingValueType value) { + this.value = value; + return this; + } + + /** + * The initial value in the given Environment. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. + * @return value + */ + @javax.annotation.Nonnull + public SettingValueType getValue() { + return value; + } + + public void setValue(SettingValueType value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the InitialValue instance itself + */ + public InitialValue putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InitialValue initialValue = (InitialValue) o; + return Objects.equals(this.environmentId, initialValue.environmentId) && + Objects.equals(this.value, initialValue.value)&& + Objects.equals(this.additionalProperties, initialValue.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(environmentId, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InitialValue {\n"); + sb.append(" environmentId: ").append(toIndentedString(environmentId)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("environmentId"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to InitialValue + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!InitialValue.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InitialValue is not found in the empty JSON string", InitialValue.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InitialValue.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("environmentId") != null && !jsonObj.get("environmentId").isJsonNull()) && !jsonObj.get("environmentId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `environmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentId").toString())); + } + // validate the required field `value` + SettingValueType.validateJsonElement(jsonObj.get("value")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InitialValue.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InitialValue' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InitialValue.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InitialValue value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public InitialValue read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + InitialValue instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InitialValue given an JSON string + * + * @param jsonString JSON string + * @return An instance of InitialValue + * @throws IOException if the JSON string is invalid with respect to InitialValue + */ + public static InitialValue fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InitialValue.class); + } + + /** + * Convert an instance of InitialValue to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetail.java b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetail.java new file mode 100644 index 0000000..ed5c5e6 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetail.java @@ -0,0 +1,442 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.ConfigModel; +import com.configcat.publicapi.java.client.model.EnvironmentModel; +import com.configcat.publicapi.java.client.model.ProductModel; +import com.configcat.publicapi.java.client.model.SettingDataModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * IntegrationLinkDetail + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class IntegrationLinkDetail { + public static final String SERIALIZED_NAME_PRODUCT = "product"; + @SerializedName(SERIALIZED_NAME_PRODUCT) + private ProductModel product; + + public static final String SERIALIZED_NAME_CONFIG = "config"; + @SerializedName(SERIALIZED_NAME_CONFIG) + private ConfigModel config; + + public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT) + private EnvironmentModel environment; + + public static final String SERIALIZED_NAME_SETTING = "setting"; + @SerializedName(SERIALIZED_NAME_SETTING) + private SettingDataModel setting; + + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public IntegrationLinkDetail() { + } + + public IntegrationLinkDetail product(ProductModel product) { + this.product = product; + return this; + } + + /** + * Get product + * @return product + */ + @javax.annotation.Nonnull + public ProductModel getProduct() { + return product; + } + + public void setProduct(ProductModel product) { + this.product = product; + } + + + public IntegrationLinkDetail config(ConfigModel config) { + this.config = config; + return this; + } + + /** + * Get config + * @return config + */ + @javax.annotation.Nonnull + public ConfigModel getConfig() { + return config; + } + + public void setConfig(ConfigModel config) { + this.config = config; + } + + + public IntegrationLinkDetail environment(EnvironmentModel environment) { + this.environment = environment; + return this; + } + + /** + * Get environment + * @return environment + */ + @javax.annotation.Nonnull + public EnvironmentModel getEnvironment() { + return environment; + } + + public void setEnvironment(EnvironmentModel environment) { + this.environment = environment; + } + + + public IntegrationLinkDetail setting(SettingDataModel setting) { + this.setting = setting; + return this; + } + + /** + * Get setting + * @return setting + */ + @javax.annotation.Nonnull + public SettingDataModel getSetting() { + return setting; + } + + public void setSetting(SettingDataModel setting) { + this.setting = setting; + } + + + public IntegrationLinkDetail readOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Get readOnly + * @return readOnly + */ + @javax.annotation.Nonnull + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + + public IntegrationLinkDetail status(String status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nonnull + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IntegrationLinkDetail instance itself + */ + public IntegrationLinkDetail putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationLinkDetail integrationLinkDetail = (IntegrationLinkDetail) o; + return Objects.equals(this.product, integrationLinkDetail.product) && + Objects.equals(this.config, integrationLinkDetail.config) && + Objects.equals(this.environment, integrationLinkDetail.environment) && + Objects.equals(this.setting, integrationLinkDetail.setting) && + Objects.equals(this.readOnly, integrationLinkDetail.readOnly) && + Objects.equals(this.status, integrationLinkDetail.status)&& + Objects.equals(this.additionalProperties, integrationLinkDetail.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(product, config, environment, setting, readOnly, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationLinkDetail {\n"); + sb.append(" product: ").append(toIndentedString(product)).append("\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); + sb.append(" setting: ").append(toIndentedString(setting)).append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("product"); + openapiFields.add("config"); + openapiFields.add("environment"); + openapiFields.add("setting"); + openapiFields.add("readOnly"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("product"); + openapiRequiredFields.add("config"); + openapiRequiredFields.add("environment"); + openapiRequiredFields.add("setting"); + openapiRequiredFields.add("readOnly"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to IntegrationLinkDetail + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IntegrationLinkDetail.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IntegrationLinkDetail is not found in the empty JSON string", IntegrationLinkDetail.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IntegrationLinkDetail.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `product` + ProductModel.validateJsonElement(jsonObj.get("product")); + // validate the required field `config` + ConfigModel.validateJsonElement(jsonObj.get("config")); + // validate the required field `environment` + EnvironmentModel.validateJsonElement(jsonObj.get("environment")); + // validate the required field `setting` + SettingDataModel.validateJsonElement(jsonObj.get("setting")); + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IntegrationLinkDetail.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IntegrationLinkDetail' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IntegrationLinkDetail.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IntegrationLinkDetail value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IntegrationLinkDetail read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IntegrationLinkDetail instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IntegrationLinkDetail given an JSON string + * + * @param jsonString JSON string + * @return An instance of IntegrationLinkDetail + * @throws IOException if the JSON string is invalid with respect to IntegrationLinkDetail + */ + public static IntegrationLinkDetail fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IntegrationLinkDetail.class); + } + + /** + * Convert an instance of IntegrationLinkDetail to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetailsModel.java b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetailsModel.java new file mode 100644 index 0000000..3c8bdb4 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetailsModel.java @@ -0,0 +1,331 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.IntegrationLinkDetail; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * IntegrationLinkDetailsModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class IntegrationLinkDetailsModel { + public static final String SERIALIZED_NAME_DETAILS = "details"; + @SerializedName(SERIALIZED_NAME_DETAILS) + private List details; + + public static final String SERIALIZED_NAME_ALL_INTEGRATION_LINK_COUNT = "allIntegrationLinkCount"; + @SerializedName(SERIALIZED_NAME_ALL_INTEGRATION_LINK_COUNT) + private Integer allIntegrationLinkCount; + + public IntegrationLinkDetailsModel() { + } + + public IntegrationLinkDetailsModel( + List details + ) { + this(); + this.details = details; + } + + /** + * Get details + * @return details + */ + @javax.annotation.Nullable + public List getDetails() { + return details; + } + + + + public IntegrationLinkDetailsModel allIntegrationLinkCount(Integer allIntegrationLinkCount) { + this.allIntegrationLinkCount = allIntegrationLinkCount; + return this; + } + + /** + * Get allIntegrationLinkCount + * @return allIntegrationLinkCount + */ + @javax.annotation.Nonnull + public Integer getAllIntegrationLinkCount() { + return allIntegrationLinkCount; + } + + public void setAllIntegrationLinkCount(Integer allIntegrationLinkCount) { + this.allIntegrationLinkCount = allIntegrationLinkCount; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IntegrationLinkDetailsModel instance itself + */ + public IntegrationLinkDetailsModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationLinkDetailsModel integrationLinkDetailsModel = (IntegrationLinkDetailsModel) o; + return Objects.equals(this.details, integrationLinkDetailsModel.details) && + Objects.equals(this.allIntegrationLinkCount, integrationLinkDetailsModel.allIntegrationLinkCount)&& + Objects.equals(this.additionalProperties, integrationLinkDetailsModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(details, allIntegrationLinkCount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationLinkDetailsModel {\n"); + sb.append(" details: ").append(toIndentedString(details)).append("\n"); + sb.append(" allIntegrationLinkCount: ").append(toIndentedString(allIntegrationLinkCount)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("details"); + openapiFields.add("allIntegrationLinkCount"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("details"); + openapiRequiredFields.add("allIntegrationLinkCount"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to IntegrationLinkDetailsModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IntegrationLinkDetailsModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IntegrationLinkDetailsModel is not found in the empty JSON string", IntegrationLinkDetailsModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IntegrationLinkDetailsModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("details").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `details` to be an array in the JSON string but got `%s`", jsonObj.get("details").toString())); + } + + JsonArray jsonArraydetails = jsonObj.getAsJsonArray("details"); + // validate the required field `details` (array) + for (int i = 0; i < jsonArraydetails.size(); i++) { + IntegrationLinkDetail.validateJsonElement(jsonArraydetails.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IntegrationLinkDetailsModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IntegrationLinkDetailsModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IntegrationLinkDetailsModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IntegrationLinkDetailsModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IntegrationLinkDetailsModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IntegrationLinkDetailsModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IntegrationLinkDetailsModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of IntegrationLinkDetailsModel + * @throws IOException if the JSON string is invalid with respect to IntegrationLinkDetailsModel + */ + public static IntegrationLinkDetailsModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IntegrationLinkDetailsModel.class); + } + + /** + * Convert an instance of IntegrationLinkDetailsModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkModel.java b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkModel.java new file mode 100644 index 0000000..e2e7612 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkModel.java @@ -0,0 +1,385 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.IntegrationLinkType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * IntegrationLinkModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class IntegrationLinkModel { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_INTEGRATION_LINK_TYPE = "integrationLinkType"; + @SerializedName(SERIALIZED_NAME_INTEGRATION_LINK_TYPE) + private IntegrationLinkType integrationLinkType; + + public static final String SERIALIZED_NAME_URL = "url"; + @SerializedName(SERIALIZED_NAME_URL) + private String url; + + public IntegrationLinkModel() { + } + + public IntegrationLinkModel key(String key) { + this.key = key; + return this; + } + + /** + * Get key + * @return key + */ + @javax.annotation.Nullable + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + + public IntegrationLinkModel description(String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + + public IntegrationLinkModel integrationLinkType(IntegrationLinkType integrationLinkType) { + this.integrationLinkType = integrationLinkType; + return this; + } + + /** + * Get integrationLinkType + * @return integrationLinkType + */ + @javax.annotation.Nonnull + public IntegrationLinkType getIntegrationLinkType() { + return integrationLinkType; + } + + public void setIntegrationLinkType(IntegrationLinkType integrationLinkType) { + this.integrationLinkType = integrationLinkType; + } + + + public IntegrationLinkModel url(String url) { + this.url = url; + return this; + } + + /** + * Get url + * @return url + */ + @javax.annotation.Nullable + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IntegrationLinkModel instance itself + */ + public IntegrationLinkModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationLinkModel integrationLinkModel = (IntegrationLinkModel) o; + return Objects.equals(this.key, integrationLinkModel.key) && + Objects.equals(this.description, integrationLinkModel.description) && + Objects.equals(this.integrationLinkType, integrationLinkModel.integrationLinkType) && + Objects.equals(this.url, integrationLinkModel.url)&& + Objects.equals(this.additionalProperties, integrationLinkModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(key, description, integrationLinkType, url, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationLinkModel {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" integrationLinkType: ").append(toIndentedString(integrationLinkType)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("description"); + openapiFields.add("integrationLinkType"); + openapiFields.add("url"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("integrationLinkType"); + openapiRequiredFields.add("url"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to IntegrationLinkModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IntegrationLinkModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IntegrationLinkModel is not found in the empty JSON string", IntegrationLinkModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IntegrationLinkModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("key") != null && !jsonObj.get("key").isJsonNull()) && !jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + // validate the required field `integrationLinkType` + IntegrationLinkType.validateJsonElement(jsonObj.get("integrationLinkType")); + if ((jsonObj.get("url") != null && !jsonObj.get("url").isJsonNull()) && !jsonObj.get("url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IntegrationLinkModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IntegrationLinkModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IntegrationLinkModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IntegrationLinkModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IntegrationLinkModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IntegrationLinkModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IntegrationLinkModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of IntegrationLinkModel + * @throws IOException if the JSON string is invalid with respect to IntegrationLinkModel + */ + public static IntegrationLinkModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IntegrationLinkModel.class); + } + + /** + * Convert an instance of IntegrationLinkModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkType.java b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkType.java new file mode 100644 index 0000000..e7ab224 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkType.java @@ -0,0 +1,80 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets IntegrationLinkType + */ +@JsonAdapter(IntegrationLinkType.Adapter.class) +public enum IntegrationLinkType { + + TRELLO("trello"), + + JIRA("jira"), + + MONDAY("monday"); + + private String value; + + IntegrationLinkType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static IntegrationLinkType fromValue(String value) { + for (IntegrationLinkType b : IntegrationLinkType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final IntegrationLinkType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public IntegrationLinkType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return IntegrationLinkType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + IntegrationLinkType.fromValue(value); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationModel.java b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationModel.java new file mode 100644 index 0000000..8f5d055 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationModel.java @@ -0,0 +1,507 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.IntegrationType; +import com.configcat.publicapi.java.client.model.ProductModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Details of the Integration. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class IntegrationModel { + public static final String SERIALIZED_NAME_PRODUCT = "product"; + @SerializedName(SERIALIZED_NAME_PRODUCT) + private ProductModel product; + + public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; + @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) + private UUID integrationId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_INTEGRATION_TYPE = "integrationType"; + @SerializedName(SERIALIZED_NAME_INTEGRATION_TYPE) + private IntegrationType integrationType; + + public static final String SERIALIZED_NAME_PARAMETERS = "parameters"; + @SerializedName(SERIALIZED_NAME_PARAMETERS) + private Map parameters; + + public static final String SERIALIZED_NAME_ENVIRONMENT_IDS = "environmentIds"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT_IDS) + private List environmentIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CONFIG_IDS = "configIds"; + @SerializedName(SERIALIZED_NAME_CONFIG_IDS) + private List configIds = new ArrayList<>(); + + public IntegrationModel() { + } + + public IntegrationModel product(ProductModel product) { + this.product = product; + return this; + } + + /** + * Get product + * @return product + */ + @javax.annotation.Nonnull + public ProductModel getProduct() { + return product; + } + + public void setProduct(ProductModel product) { + this.product = product; + } + + + public IntegrationModel integrationId(UUID integrationId) { + this.integrationId = integrationId; + return this; + } + + /** + * Identifier of the Integration. + * @return integrationId + */ + @javax.annotation.Nonnull + public UUID getIntegrationId() { + return integrationId; + } + + public void setIntegrationId(UUID integrationId) { + this.integrationId = integrationId; + } + + + public IntegrationModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Integration. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public IntegrationModel integrationType(IntegrationType integrationType) { + this.integrationType = integrationType; + return this; + } + + /** + * Get integrationType + * @return integrationType + */ + @javax.annotation.Nonnull + public IntegrationType getIntegrationType() { + return integrationType; + } + + public void setIntegrationType(IntegrationType integrationType) { + this.integrationType = integrationType; + } + + + public IntegrationModel parameters(Map parameters) { + this.parameters = parameters; + return this; + } + + public IntegrationModel putParametersItem(String key, String parametersItem) { + if (this.parameters == null) { + this.parameters = new HashMap<>(); + } + this.parameters.put(key, parametersItem); + return this; + } + + /** + * Parameters of the Integration. + * @return parameters + */ + @javax.annotation.Nullable + public Map getParameters() { + return parameters; + } + + public void setParameters(Map parameters) { + this.parameters = parameters; + } + + + public IntegrationModel environmentIds(List environmentIds) { + this.environmentIds = environmentIds; + return this; + } + + public IntegrationModel addEnvironmentIdsItem(UUID environmentIdsItem) { + if (this.environmentIds == null) { + this.environmentIds = new ArrayList<>(); + } + this.environmentIds.add(environmentIdsItem); + return this; + } + + /** + * List of Environment IDs that are connected with this Integration. If the list is empty, all of the Environments are connected. + * @return environmentIds + */ + @javax.annotation.Nonnull + public List getEnvironmentIds() { + return environmentIds; + } + + public void setEnvironmentIds(List environmentIds) { + this.environmentIds = environmentIds; + } + + + public IntegrationModel configIds(List configIds) { + this.configIds = configIds; + return this; + } + + public IntegrationModel addConfigIdsItem(UUID configIdsItem) { + if (this.configIds == null) { + this.configIds = new ArrayList<>(); + } + this.configIds.add(configIdsItem); + return this; + } + + /** + * List of Config IDs that are connected with this Integration. If the list is empty, all of the Configs are connected. + * @return configIds + */ + @javax.annotation.Nonnull + public List getConfigIds() { + return configIds; + } + + public void setConfigIds(List configIds) { + this.configIds = configIds; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IntegrationModel instance itself + */ + public IntegrationModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationModel integrationModel = (IntegrationModel) o; + return Objects.equals(this.product, integrationModel.product) && + Objects.equals(this.integrationId, integrationModel.integrationId) && + Objects.equals(this.name, integrationModel.name) && + Objects.equals(this.integrationType, integrationModel.integrationType) && + Objects.equals(this.parameters, integrationModel.parameters) && + Objects.equals(this.environmentIds, integrationModel.environmentIds) && + Objects.equals(this.configIds, integrationModel.configIds)&& + Objects.equals(this.additionalProperties, integrationModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(product, integrationId, name, integrationType, parameters, environmentIds, configIds, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationModel {\n"); + sb.append(" product: ").append(toIndentedString(product)).append("\n"); + sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" integrationType: ").append(toIndentedString(integrationType)).append("\n"); + sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); + sb.append(" environmentIds: ").append(toIndentedString(environmentIds)).append("\n"); + sb.append(" configIds: ").append(toIndentedString(configIds)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("product"); + openapiFields.add("integrationId"); + openapiFields.add("name"); + openapiFields.add("integrationType"); + openapiFields.add("parameters"); + openapiFields.add("environmentIds"); + openapiFields.add("configIds"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("product"); + openapiRequiredFields.add("integrationId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("integrationType"); + openapiRequiredFields.add("parameters"); + openapiRequiredFields.add("environmentIds"); + openapiRequiredFields.add("configIds"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to IntegrationModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IntegrationModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IntegrationModel is not found in the empty JSON string", IntegrationModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IntegrationModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `product` + ProductModel.validateJsonElement(jsonObj.get("product")); + if (!jsonObj.get("integrationId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `integrationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("integrationId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + // validate the required field `integrationType` + IntegrationType.validateJsonElement(jsonObj.get("integrationType")); + // ensure the required json array is present + if (jsonObj.get("environmentIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("environmentIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `environmentIds` to be an array in the JSON string but got `%s`", jsonObj.get("environmentIds").toString())); + } + // ensure the required json array is present + if (jsonObj.get("configIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("configIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `configIds` to be an array in the JSON string but got `%s`", jsonObj.get("configIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IntegrationModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IntegrationModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IntegrationModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IntegrationModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IntegrationModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IntegrationModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IntegrationModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of IntegrationModel + * @throws IOException if the JSON string is invalid with respect to IntegrationModel + */ + public static IntegrationModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IntegrationModel.class); + } + + /** + * Convert an instance of IntegrationModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationType.java b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationType.java new file mode 100644 index 0000000..c4a6e09 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationType.java @@ -0,0 +1,86 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets IntegrationType + */ +@JsonAdapter(IntegrationType.Adapter.class) +public enum IntegrationType { + + DATA_DOG("dataDog"), + + SLACK("slack"), + + AMPLITUDE("amplitude"), + + MIX_PANEL("mixPanel"), + + SEGMENT("segment"), + + PUB_NUB("pubNub"); + + private String value; + + IntegrationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static IntegrationType fromValue(String value) { + for (IntegrationType b : IntegrationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final IntegrationType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public IntegrationType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return IntegrationType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + IntegrationType.fromValue(value); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationsModel.java b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationsModel.java new file mode 100644 index 0000000..6a05026 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationsModel.java @@ -0,0 +1,313 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.IntegrationModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * IntegrationsModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class IntegrationsModel { + public static final String SERIALIZED_NAME_INTEGRATIONS = "integrations"; + @SerializedName(SERIALIZED_NAME_INTEGRATIONS) + private List integrations; + + public IntegrationsModel() { + } + + public IntegrationsModel integrations(List integrations) { + this.integrations = integrations; + return this; + } + + public IntegrationsModel addIntegrationsItem(IntegrationModel integrationsItem) { + if (this.integrations == null) { + this.integrations = new ArrayList<>(); + } + this.integrations.add(integrationsItem); + return this; + } + + /** + * The Integrations of the Product. + * @return integrations + */ + @javax.annotation.Nullable + public List getIntegrations() { + return integrations; + } + + public void setIntegrations(List integrations) { + this.integrations = integrations; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IntegrationsModel instance itself + */ + public IntegrationsModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationsModel integrationsModel = (IntegrationsModel) o; + return Objects.equals(this.integrations, integrationsModel.integrations)&& + Objects.equals(this.additionalProperties, integrationsModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(integrations, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationsModel {\n"); + sb.append(" integrations: ").append(toIndentedString(integrations)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("integrations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("integrations"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to IntegrationsModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IntegrationsModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IntegrationsModel is not found in the empty JSON string", IntegrationsModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IntegrationsModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("integrations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `integrations` to be an array in the JSON string but got `%s`", jsonObj.get("integrations").toString())); + } + + JsonArray jsonArrayintegrations = jsonObj.getAsJsonArray("integrations"); + // validate the required field `integrations` (array) + for (int i = 0; i < jsonArrayintegrations.size(); i++) { + IntegrationModel.validateJsonElement(jsonArrayintegrations.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IntegrationsModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IntegrationsModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IntegrationsModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IntegrationsModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IntegrationsModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IntegrationsModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IntegrationsModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of IntegrationsModel + * @throws IOException if the JSON string is invalid with respect to IntegrationsModel + */ + public static IntegrationsModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IntegrationsModel.class); + } + + /** + * Convert an instance of IntegrationsModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/InvitationModel.java b/src/main/java/com/configcat/publicapi/java/client/model/InvitationModel.java new file mode 100644 index 0000000..c2716f4 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/InvitationModel.java @@ -0,0 +1,408 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * InvitationModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class InvitationModel { + public static final String SERIALIZED_NAME_INVITATION_ID = "invitationId"; + @SerializedName(SERIALIZED_NAME_INVITATION_ID) + private UUID invitationId; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_PERMISSION_GROUP_ID = "permissionGroupId"; + @SerializedName(SERIALIZED_NAME_PERMISSION_GROUP_ID) + private Long permissionGroupId; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_EXPIRED = "expired"; + @SerializedName(SERIALIZED_NAME_EXPIRED) + private Boolean expired; + + public InvitationModel() { + } + + public InvitationModel invitationId(UUID invitationId) { + this.invitationId = invitationId; + return this; + } + + /** + * The identifier of the Invitation. + * @return invitationId + */ + @javax.annotation.Nonnull + public UUID getInvitationId() { + return invitationId; + } + + public void setInvitationId(UUID invitationId) { + this.invitationId = invitationId; + } + + + public InvitationModel email(String email) { + this.email = email; + return this; + } + + /** + * The invited user's email address. + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + public InvitationModel permissionGroupId(Long permissionGroupId) { + this.permissionGroupId = permissionGroupId; + return this; + } + + /** + * The identifier of the Permission Group the user was invited to. + * @return permissionGroupId + */ + @javax.annotation.Nonnull + public Long getPermissionGroupId() { + return permissionGroupId; + } + + public void setPermissionGroupId(Long permissionGroupId) { + this.permissionGroupId = permissionGroupId; + } + + + public InvitationModel createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Creation time of the Invitation. + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public InvitationModel expired(Boolean expired) { + this.expired = expired; + return this; + } + + /** + * Determines whether the Invitation is expired. + * @return expired + */ + @javax.annotation.Nonnull + public Boolean getExpired() { + return expired; + } + + public void setExpired(Boolean expired) { + this.expired = expired; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the InvitationModel instance itself + */ + public InvitationModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvitationModel invitationModel = (InvitationModel) o; + return Objects.equals(this.invitationId, invitationModel.invitationId) && + Objects.equals(this.email, invitationModel.email) && + Objects.equals(this.permissionGroupId, invitationModel.permissionGroupId) && + Objects.equals(this.createdAt, invitationModel.createdAt) && + Objects.equals(this.expired, invitationModel.expired)&& + Objects.equals(this.additionalProperties, invitationModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(invitationId, email, permissionGroupId, createdAt, expired, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvitationModel {\n"); + sb.append(" invitationId: ").append(toIndentedString(invitationId)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" permissionGroupId: ").append(toIndentedString(permissionGroupId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" expired: ").append(toIndentedString(expired)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("invitationId"); + openapiFields.add("email"); + openapiFields.add("permissionGroupId"); + openapiFields.add("createdAt"); + openapiFields.add("expired"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("invitationId"); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("permissionGroupId"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("expired"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to InvitationModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!InvitationModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvitationModel is not found in the empty JSON string", InvitationModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvitationModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("invitationId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `invitationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invitationId").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvitationModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvitationModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvitationModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvitationModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public InvitationModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + InvitationModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvitationModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvitationModel + * @throws IOException if the JSON string is invalid with respect to InvitationModel + */ + public static InvitationModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvitationModel.class); + } + + /** + * Convert an instance of InvitationModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/InviteMembersRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/InviteMembersRequest.java new file mode 100644 index 0000000..93fc5f5 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/InviteMembersRequest.java @@ -0,0 +1,335 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * InviteMembersRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class InviteMembersRequest { + public static final String SERIALIZED_NAME_EMAILS = "emails"; + @SerializedName(SERIALIZED_NAME_EMAILS) + private List emails = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PERMISSION_GROUP_ID = "permissionGroupId"; + @SerializedName(SERIALIZED_NAME_PERMISSION_GROUP_ID) + private Long permissionGroupId; + + public InviteMembersRequest() { + } + + public InviteMembersRequest emails(List emails) { + this.emails = emails; + return this; + } + + public InviteMembersRequest addEmailsItem(String emailsItem) { + if (this.emails == null) { + this.emails = new ArrayList<>(); + } + this.emails.add(emailsItem); + return this; + } + + /** + * List of email addresses to invite. + * @return emails + */ + @javax.annotation.Nonnull + public List getEmails() { + return emails; + } + + public void setEmails(List emails) { + this.emails = emails; + } + + + public InviteMembersRequest permissionGroupId(Long permissionGroupId) { + this.permissionGroupId = permissionGroupId; + return this; + } + + /** + * Identifier of the Permission Group to where the invited users should be added. + * @return permissionGroupId + */ + @javax.annotation.Nonnull + public Long getPermissionGroupId() { + return permissionGroupId; + } + + public void setPermissionGroupId(Long permissionGroupId) { + this.permissionGroupId = permissionGroupId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the InviteMembersRequest instance itself + */ + public InviteMembersRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InviteMembersRequest inviteMembersRequest = (InviteMembersRequest) o; + return Objects.equals(this.emails, inviteMembersRequest.emails) && + Objects.equals(this.permissionGroupId, inviteMembersRequest.permissionGroupId)&& + Objects.equals(this.additionalProperties, inviteMembersRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(emails, permissionGroupId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InviteMembersRequest {\n"); + sb.append(" emails: ").append(toIndentedString(emails)).append("\n"); + sb.append(" permissionGroupId: ").append(toIndentedString(permissionGroupId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("emails"); + openapiFields.add("permissionGroupId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("emails"); + openapiRequiredFields.add("permissionGroupId"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to InviteMembersRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!InviteMembersRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InviteMembersRequest is not found in the empty JSON string", InviteMembersRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InviteMembersRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("emails") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("emails").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `emails` to be an array in the JSON string but got `%s`", jsonObj.get("emails").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InviteMembersRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InviteMembersRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InviteMembersRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InviteMembersRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public InviteMembersRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + InviteMembersRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InviteMembersRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of InviteMembersRequest + * @throws IOException if the JSON string is invalid with respect to InviteMembersRequest + */ + public static InviteMembersRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InviteMembersRequest.class); + } + + /** + * Convert an instance of InviteMembersRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/JsonPatchOperation.java b/src/main/java/com/configcat/publicapi/java/client/model/JsonPatchOperation.java new file mode 100644 index 0000000..274c358 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/JsonPatchOperation.java @@ -0,0 +1,392 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.OperationType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * JsonPatchOperation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class JsonPatchOperation { + public static final String SERIALIZED_NAME_OP = "op"; + @SerializedName(SERIALIZED_NAME_OP) + private OperationType op; + + public static final String SERIALIZED_NAME_PATH = "path"; + @SerializedName(SERIALIZED_NAME_PATH) + private String path; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private String from; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private Object value = null; + + public JsonPatchOperation() { + } + + public JsonPatchOperation op(OperationType op) { + this.op = op; + return this; + } + + /** + * Get op + * @return op + */ + @javax.annotation.Nonnull + public OperationType getOp() { + return op; + } + + public void setOp(OperationType op) { + this.op = op; + } + + + public JsonPatchOperation path(String path) { + this.path = path; + return this; + } + + /** + * The source path. + * @return path + */ + @javax.annotation.Nonnull + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + + public JsonPatchOperation from(String from) { + this.from = from; + return this; + } + + /** + * The target path. + * @return from + */ + @javax.annotation.Nullable + public String getFrom() { + return from; + } + + public void setFrom(String from) { + this.from = from; + } + + + public JsonPatchOperation value(Object value) { + this.value = value; + return this; + } + + /** + * The discrete value. + * @return value + */ + @javax.annotation.Nullable + public Object getValue() { + return value; + } + + public void setValue(Object value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the JsonPatchOperation instance itself + */ + public JsonPatchOperation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JsonPatchOperation jsonPatchOperation = (JsonPatchOperation) o; + return Objects.equals(this.op, jsonPatchOperation.op) && + Objects.equals(this.path, jsonPatchOperation.path) && + Objects.equals(this.from, jsonPatchOperation.from) && + Objects.equals(this.value, jsonPatchOperation.value)&& + Objects.equals(this.additionalProperties, jsonPatchOperation.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(op, path, from, value, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JsonPatchOperation {\n"); + sb.append(" op: ").append(toIndentedString(op)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("op"); + openapiFields.add("path"); + openapiFields.add("from"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("op"); + openapiRequiredFields.add("path"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to JsonPatchOperation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JsonPatchOperation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JsonPatchOperation is not found in the empty JSON string", JsonPatchOperation.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : JsonPatchOperation.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `op` + OperationType.validateJsonElement(jsonObj.get("op")); + if (!jsonObj.get("path").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); + } + if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) && !jsonObj.get("from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JsonPatchOperation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JsonPatchOperation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JsonPatchOperation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JsonPatchOperation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public JsonPatchOperation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + JsonPatchOperation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JsonPatchOperation given an JSON string + * + * @param jsonString JSON string + * @return An instance of JsonPatchOperation + * @throws IOException if the JSON string is invalid with respect to JsonPatchOperation + */ + public static JsonPatchOperation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JsonPatchOperation.class); + } + + /** + * Convert an instance of JsonPatchOperation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/KeyGenerationMode.java b/src/main/java/com/configcat/publicapi/java/client/model/KeyGenerationMode.java new file mode 100644 index 0000000..bbabc69 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/KeyGenerationMode.java @@ -0,0 +1,84 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Determines the Feature Flag key generation mode. + */ +@JsonAdapter(KeyGenerationMode.Adapter.class) +public enum KeyGenerationMode { + + CAMEL_CASE("camelCase"), + + LOWER_CASE("lowerCase"), + + UPPER_CASE("upperCase"), + + PASCAL_CASE("pascalCase"), + + KEBAB_CASE("kebabCase"); + + private String value; + + KeyGenerationMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KeyGenerationMode fromValue(String value) { + for (KeyGenerationMode b : KeyGenerationMode.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KeyGenerationMode enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KeyGenerationMode read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KeyGenerationMode.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + KeyGenerationMode.fromValue(value); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/MeModel.java b/src/main/java/com/configcat/publicapi/java/client/model/MeModel.java new file mode 100644 index 0000000..b275449 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/MeModel.java @@ -0,0 +1,318 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * MeModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class MeModel { + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; + @SerializedName(SERIALIZED_NAME_FULL_NAME) + private String fullName; + + public MeModel() { + } + + public MeModel( + String email, + String fullName + ) { + this(); + this.email = email; + this.fullName = fullName; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + + + /** + * Get fullName + * @return fullName + */ + @javax.annotation.Nonnull + public String getFullName() { + return fullName; + } + + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the MeModel instance itself + */ + public MeModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MeModel meModel = (MeModel) o; + return Objects.equals(this.email, meModel.email) && + Objects.equals(this.fullName, meModel.fullName)&& + Objects.equals(this.additionalProperties, meModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, fullName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MeModel {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("email"); + openapiFields.add("fullName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("fullName"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to MeModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MeModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in MeModel is not found in the empty JSON string", MeModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : MeModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if (!jsonObj.get("fullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MeModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MeModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MeModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MeModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public MeModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + MeModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MeModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of MeModel + * @throws IOException if the JSON string is invalid with respect to MeModel + */ + public static MeModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MeModel.class); + } + + /** + * Convert an instance of MeModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/MemberModel.java b/src/main/java/com/configcat/publicapi/java/client/model/MemberModel.java new file mode 100644 index 0000000..f0145b5 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/MemberModel.java @@ -0,0 +1,413 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * MemberModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class MemberModel { + public static final String SERIALIZED_NAME_USER_ID = "userId"; + @SerializedName(SERIALIZED_NAME_USER_ID) + private String userId; + + public static final String SERIALIZED_NAME_PRODUCT_ID = "productId"; + @SerializedName(SERIALIZED_NAME_PRODUCT_ID) + private UUID productId; + + public static final String SERIALIZED_NAME_PERMISSION_GROUP_ID = "permissionGroupId"; + @SerializedName(SERIALIZED_NAME_PERMISSION_GROUP_ID) + private Long permissionGroupId; + + public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; + @SerializedName(SERIALIZED_NAME_FULL_NAME) + private String fullName; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public MemberModel() { + } + + public MemberModel userId(String userId) { + this.userId = userId; + return this; + } + + /** + * Identifier of the Member. + * @return userId + */ + @javax.annotation.Nullable + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + + public MemberModel productId(UUID productId) { + this.productId = productId; + return this; + } + + /** + * Identifier of the Product where the Member has access. + * @return productId + */ + @javax.annotation.Nonnull + public UUID getProductId() { + return productId; + } + + public void setProductId(UUID productId) { + this.productId = productId; + } + + + public MemberModel permissionGroupId(Long permissionGroupId) { + this.permissionGroupId = permissionGroupId; + return this; + } + + /** + * Identifier of the Member's Permission Group. + * @return permissionGroupId + */ + @javax.annotation.Nonnull + public Long getPermissionGroupId() { + return permissionGroupId; + } + + public void setPermissionGroupId(Long permissionGroupId) { + this.permissionGroupId = permissionGroupId; + } + + + public MemberModel fullName(String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Name of the Member. + * @return fullName + */ + @javax.annotation.Nullable + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + + public MemberModel email(String email) { + this.email = email; + return this; + } + + /** + * Email of the Member. + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the MemberModel instance itself + */ + public MemberModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MemberModel memberModel = (MemberModel) o; + return Objects.equals(this.userId, memberModel.userId) && + Objects.equals(this.productId, memberModel.productId) && + Objects.equals(this.permissionGroupId, memberModel.permissionGroupId) && + Objects.equals(this.fullName, memberModel.fullName) && + Objects.equals(this.email, memberModel.email)&& + Objects.equals(this.additionalProperties, memberModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(userId, productId, permissionGroupId, fullName, email, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MemberModel {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" productId: ").append(toIndentedString(productId)).append("\n"); + sb.append(" permissionGroupId: ").append(toIndentedString(permissionGroupId)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("userId"); + openapiFields.add("productId"); + openapiFields.add("permissionGroupId"); + openapiFields.add("fullName"); + openapiFields.add("email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("userId"); + openapiRequiredFields.add("productId"); + openapiRequiredFields.add("permissionGroupId"); + openapiRequiredFields.add("fullName"); + openapiRequiredFields.add("email"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to MemberModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MemberModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in MemberModel is not found in the empty JSON string", MemberModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : MemberModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("userId") != null && !jsonObj.get("userId").isJsonNull()) && !jsonObj.get("userId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString())); + } + if (!jsonObj.get("productId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `productId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productId").toString())); + } + if ((jsonObj.get("fullName") != null && !jsonObj.get("fullName").isJsonNull()) && !jsonObj.get("fullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MemberModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MemberModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MemberModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MemberModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public MemberModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + MemberModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MemberModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of MemberModel + * @throws IOException if the JSON string is invalid with respect to MemberModel + */ + public static MemberModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MemberModel.class); + } + + /** + * Convert an instance of MemberModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ModifyIntegrationRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/ModifyIntegrationRequest.java new file mode 100644 index 0000000..f49817c --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/ModifyIntegrationRequest.java @@ -0,0 +1,417 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * ModifyIntegrationRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ModifyIntegrationRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_PARAMETERS = "parameters"; + @SerializedName(SERIALIZED_NAME_PARAMETERS) + private Map parameters = new HashMap<>(); + + public static final String SERIALIZED_NAME_ENVIRONMENT_IDS = "environmentIds"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT_IDS) + private List environmentIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CONFIG_IDS = "configIds"; + @SerializedName(SERIALIZED_NAME_CONFIG_IDS) + private List configIds = new ArrayList<>(); + + public ModifyIntegrationRequest() { + } + + public ModifyIntegrationRequest name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Integration. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public ModifyIntegrationRequest parameters(Map parameters) { + this.parameters = parameters; + return this; + } + + public ModifyIntegrationRequest putParametersItem(String key, String parametersItem) { + if (this.parameters == null) { + this.parameters = new HashMap<>(); + } + this.parameters.put(key, parametersItem); + return this; + } + + /** + * Parameters of the Integration. + * @return parameters + */ + @javax.annotation.Nonnull + public Map getParameters() { + return parameters; + } + + public void setParameters(Map parameters) { + this.parameters = parameters; + } + + + public ModifyIntegrationRequest environmentIds(List environmentIds) { + this.environmentIds = environmentIds; + return this; + } + + public ModifyIntegrationRequest addEnvironmentIdsItem(UUID environmentIdsItem) { + if (this.environmentIds == null) { + this.environmentIds = new ArrayList<>(); + } + this.environmentIds.add(environmentIdsItem); + return this; + } + + /** + * List of Environment IDs that are connected with this Integration. If the list is empty, all of the Environments are connected. + * @return environmentIds + */ + @javax.annotation.Nonnull + public List getEnvironmentIds() { + return environmentIds; + } + + public void setEnvironmentIds(List environmentIds) { + this.environmentIds = environmentIds; + } + + + public ModifyIntegrationRequest configIds(List configIds) { + this.configIds = configIds; + return this; + } + + public ModifyIntegrationRequest addConfigIdsItem(UUID configIdsItem) { + if (this.configIds == null) { + this.configIds = new ArrayList<>(); + } + this.configIds.add(configIdsItem); + return this; + } + + /** + * List of Config IDs that are connected with this Integration. If the list is empty, all of the Configs are connected. + * @return configIds + */ + @javax.annotation.Nonnull + public List getConfigIds() { + return configIds; + } + + public void setConfigIds(List configIds) { + this.configIds = configIds; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ModifyIntegrationRequest instance itself + */ + public ModifyIntegrationRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModifyIntegrationRequest modifyIntegrationRequest = (ModifyIntegrationRequest) o; + return Objects.equals(this.name, modifyIntegrationRequest.name) && + Objects.equals(this.parameters, modifyIntegrationRequest.parameters) && + Objects.equals(this.environmentIds, modifyIntegrationRequest.environmentIds) && + Objects.equals(this.configIds, modifyIntegrationRequest.configIds)&& + Objects.equals(this.additionalProperties, modifyIntegrationRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, parameters, environmentIds, configIds, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModifyIntegrationRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); + sb.append(" environmentIds: ").append(toIndentedString(environmentIds)).append("\n"); + sb.append(" configIds: ").append(toIndentedString(configIds)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("parameters"); + openapiFields.add("environmentIds"); + openapiFields.add("configIds"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("parameters"); + openapiRequiredFields.add("environmentIds"); + openapiRequiredFields.add("configIds"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ModifyIntegrationRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ModifyIntegrationRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ModifyIntegrationRequest is not found in the empty JSON string", ModifyIntegrationRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ModifyIntegrationRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + // ensure the required json array is present + if (jsonObj.get("environmentIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("environmentIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `environmentIds` to be an array in the JSON string but got `%s`", jsonObj.get("environmentIds").toString())); + } + // ensure the required json array is present + if (jsonObj.get("configIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("configIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `configIds` to be an array in the JSON string but got `%s`", jsonObj.get("configIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModifyIntegrationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModifyIntegrationRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModifyIntegrationRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModifyIntegrationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ModifyIntegrationRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ModifyIntegrationRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ModifyIntegrationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModifyIntegrationRequest + * @throws IOException if the JSON string is invalid with respect to ModifyIntegrationRequest + */ + public static ModifyIntegrationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModifyIntegrationRequest.class); + } + + /** + * Convert an instance of ModifyIntegrationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/OperationType.java b/src/main/java/com/configcat/publicapi/java/client/model/OperationType.java new file mode 100644 index 0000000..863d827 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/OperationType.java @@ -0,0 +1,88 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets OperationType + */ +@JsonAdapter(OperationType.Adapter.class) +public enum OperationType { + + UNKNOWN("unknown"), + + ADD("add"), + + REMOVE("remove"), + + REPLACE("replace"), + + MOVE("move"), + + COPY("copy"), + + TEST("test"); + + private String value; + + OperationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OperationType fromValue(String value) { + for (OperationType b : OperationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OperationType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OperationType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return OperationType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + OperationType.fromValue(value); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationAdminModel.java b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationAdminModel.java new file mode 100644 index 0000000..dab893d --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationAdminModel.java @@ -0,0 +1,382 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Describes an Organization Admin. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class OrganizationAdminModel { + public static final String SERIALIZED_NAME_USER_ID = "userId"; + @SerializedName(SERIALIZED_NAME_USER_ID) + private String userId; + + public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; + @SerializedName(SERIALIZED_NAME_FULL_NAME) + private String fullName; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_TWO_FACTOR_ENABLED = "twoFactorEnabled"; + @SerializedName(SERIALIZED_NAME_TWO_FACTOR_ENABLED) + private Boolean twoFactorEnabled; + + public OrganizationAdminModel() { + } + + public OrganizationAdminModel userId(String userId) { + this.userId = userId; + return this; + } + + /** + * Identifier of the Organization Admin. + * @return userId + */ + @javax.annotation.Nonnull + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + + public OrganizationAdminModel fullName(String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Name of the Organization Admin. + * @return fullName + */ + @javax.annotation.Nonnull + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + + public OrganizationAdminModel email(String email) { + this.email = email; + return this; + } + + /** + * Email of the OrganizationAdmin. + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + public OrganizationAdminModel twoFactorEnabled(Boolean twoFactorEnabled) { + this.twoFactorEnabled = twoFactorEnabled; + return this; + } + + /** + * Determines whether 2FA is enabled for the Organization Admin. + * @return twoFactorEnabled + */ + @javax.annotation.Nonnull + public Boolean getTwoFactorEnabled() { + return twoFactorEnabled; + } + + public void setTwoFactorEnabled(Boolean twoFactorEnabled) { + this.twoFactorEnabled = twoFactorEnabled; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationAdminModel instance itself + */ + public OrganizationAdminModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationAdminModel organizationAdminModel = (OrganizationAdminModel) o; + return Objects.equals(this.userId, organizationAdminModel.userId) && + Objects.equals(this.fullName, organizationAdminModel.fullName) && + Objects.equals(this.email, organizationAdminModel.email) && + Objects.equals(this.twoFactorEnabled, organizationAdminModel.twoFactorEnabled)&& + Objects.equals(this.additionalProperties, organizationAdminModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(userId, fullName, email, twoFactorEnabled, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationAdminModel {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" twoFactorEnabled: ").append(toIndentedString(twoFactorEnabled)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("userId"); + openapiFields.add("fullName"); + openapiFields.add("email"); + openapiFields.add("twoFactorEnabled"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("userId"); + openapiRequiredFields.add("fullName"); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("twoFactorEnabled"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OrganizationAdminModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationAdminModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationAdminModel is not found in the empty JSON string", OrganizationAdminModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OrganizationAdminModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("userId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString())); + } + if (!jsonObj.get("fullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); + } + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrganizationAdminModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationAdminModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationAdminModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OrganizationAdminModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationAdminModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationAdminModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationAdminModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationAdminModel + * @throws IOException if the JSON string is invalid with respect to OrganizationAdminModel + */ + public static OrganizationAdminModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationAdminModel.class); + } + + /** + * Convert an instance of OrganizationAdminModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationInvitationModel.java b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationInvitationModel.java new file mode 100644 index 0000000..2c92c70 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationInvitationModel.java @@ -0,0 +1,495 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * OrganizationInvitationModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class OrganizationInvitationModel { + public static final String SERIALIZED_NAME_INVITATION_ID = "invitationId"; + @SerializedName(SERIALIZED_NAME_INVITATION_ID) + private UUID invitationId; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_PRODUCT_ID = "productId"; + @SerializedName(SERIALIZED_NAME_PRODUCT_ID) + private UUID productId; + + public static final String SERIALIZED_NAME_PRODUCT_NAME = "productName"; + @SerializedName(SERIALIZED_NAME_PRODUCT_NAME) + private String productName; + + public static final String SERIALIZED_NAME_PERMISSION_GROUP_ID = "permissionGroupId"; + @SerializedName(SERIALIZED_NAME_PERMISSION_GROUP_ID) + private Long permissionGroupId; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_EXPIRED = "expired"; + @SerializedName(SERIALIZED_NAME_EXPIRED) + private Boolean expired; + + public static final String SERIALIZED_NAME_EXPIRES = "expires"; + @SerializedName(SERIALIZED_NAME_EXPIRES) + private OffsetDateTime expires; + + public OrganizationInvitationModel() { + } + + public OrganizationInvitationModel invitationId(UUID invitationId) { + this.invitationId = invitationId; + return this; + } + + /** + * The identifier of the Invitation. + * @return invitationId + */ + @javax.annotation.Nonnull + public UUID getInvitationId() { + return invitationId; + } + + public void setInvitationId(UUID invitationId) { + this.invitationId = invitationId; + } + + + public OrganizationInvitationModel email(String email) { + this.email = email; + return this; + } + + /** + * The invited user's email address. + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + public OrganizationInvitationModel productId(UUID productId) { + this.productId = productId; + return this; + } + + /** + * The identifier of the Product the user was invited to. + * @return productId + */ + @javax.annotation.Nonnull + public UUID getProductId() { + return productId; + } + + public void setProductId(UUID productId) { + this.productId = productId; + } + + + public OrganizationInvitationModel productName(String productName) { + this.productName = productName; + return this; + } + + /** + * The name of the Product the user was invited to. + * @return productName + */ + @javax.annotation.Nullable + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + + public OrganizationInvitationModel permissionGroupId(Long permissionGroupId) { + this.permissionGroupId = permissionGroupId; + return this; + } + + /** + * The identifier of the Permission Group the user was invited to. + * @return permissionGroupId + */ + @javax.annotation.Nonnull + public Long getPermissionGroupId() { + return permissionGroupId; + } + + public void setPermissionGroupId(Long permissionGroupId) { + this.permissionGroupId = permissionGroupId; + } + + + public OrganizationInvitationModel createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Creation time of the Invitation. + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public OrganizationInvitationModel expired(Boolean expired) { + this.expired = expired; + return this; + } + + /** + * Determines whether the Invitation is expired. + * @return expired + */ + @javax.annotation.Nonnull + public Boolean getExpired() { + return expired; + } + + public void setExpired(Boolean expired) { + this.expired = expired; + } + + + public OrganizationInvitationModel expires(OffsetDateTime expires) { + this.expires = expires; + return this; + } + + /** + * Expiration time of the Invitation. + * @return expires + */ + @javax.annotation.Nonnull + public OffsetDateTime getExpires() { + return expires; + } + + public void setExpires(OffsetDateTime expires) { + this.expires = expires; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationInvitationModel instance itself + */ + public OrganizationInvitationModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationInvitationModel organizationInvitationModel = (OrganizationInvitationModel) o; + return Objects.equals(this.invitationId, organizationInvitationModel.invitationId) && + Objects.equals(this.email, organizationInvitationModel.email) && + Objects.equals(this.productId, organizationInvitationModel.productId) && + Objects.equals(this.productName, organizationInvitationModel.productName) && + Objects.equals(this.permissionGroupId, organizationInvitationModel.permissionGroupId) && + Objects.equals(this.createdAt, organizationInvitationModel.createdAt) && + Objects.equals(this.expired, organizationInvitationModel.expired) && + Objects.equals(this.expires, organizationInvitationModel.expires)&& + Objects.equals(this.additionalProperties, organizationInvitationModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(invitationId, email, productId, productName, permissionGroupId, createdAt, expired, expires, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationInvitationModel {\n"); + sb.append(" invitationId: ").append(toIndentedString(invitationId)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" productId: ").append(toIndentedString(productId)).append("\n"); + sb.append(" productName: ").append(toIndentedString(productName)).append("\n"); + sb.append(" permissionGroupId: ").append(toIndentedString(permissionGroupId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" expired: ").append(toIndentedString(expired)).append("\n"); + sb.append(" expires: ").append(toIndentedString(expires)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("invitationId"); + openapiFields.add("email"); + openapiFields.add("productId"); + openapiFields.add("productName"); + openapiFields.add("permissionGroupId"); + openapiFields.add("createdAt"); + openapiFields.add("expired"); + openapiFields.add("expires"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("invitationId"); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("productId"); + openapiRequiredFields.add("productName"); + openapiRequiredFields.add("permissionGroupId"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("expired"); + openapiRequiredFields.add("expires"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OrganizationInvitationModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationInvitationModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationInvitationModel is not found in the empty JSON string", OrganizationInvitationModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OrganizationInvitationModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("invitationId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `invitationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invitationId").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if (!jsonObj.get("productId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `productId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productId").toString())); + } + if ((jsonObj.get("productName") != null && !jsonObj.get("productName").isJsonNull()) && !jsonObj.get("productName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `productName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrganizationInvitationModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationInvitationModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationInvitationModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OrganizationInvitationModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationInvitationModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationInvitationModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationInvitationModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationInvitationModel + * @throws IOException if the JSON string is invalid with respect to OrganizationInvitationModel + */ + public static OrganizationInvitationModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationInvitationModel.class); + } + + /** + * Convert an instance of OrganizationInvitationModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationMemberModel.java b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationMemberModel.java new file mode 100644 index 0000000..d458563 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationMemberModel.java @@ -0,0 +1,430 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.OrganizationPermissionModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Describes an Organization Member. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class OrganizationMemberModel { + public static final String SERIALIZED_NAME_USER_ID = "userId"; + @SerializedName(SERIALIZED_NAME_USER_ID) + private String userId; + + public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; + @SerializedName(SERIALIZED_NAME_FULL_NAME) + private String fullName; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_TWO_FACTOR_ENABLED = "twoFactorEnabled"; + @SerializedName(SERIALIZED_NAME_TWO_FACTOR_ENABLED) + private Boolean twoFactorEnabled; + + public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; + @SerializedName(SERIALIZED_NAME_PERMISSIONS) + private List permissions = new ArrayList<>(); + + public OrganizationMemberModel() { + } + + public OrganizationMemberModel userId(String userId) { + this.userId = userId; + return this; + } + + /** + * Identifier of the Organization Admin. + * @return userId + */ + @javax.annotation.Nonnull + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + + public OrganizationMemberModel fullName(String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Name of the Organization Admin. + * @return fullName + */ + @javax.annotation.Nonnull + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + + public OrganizationMemberModel email(String email) { + this.email = email; + return this; + } + + /** + * Email of the OrganizationAdmin. + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + public OrganizationMemberModel twoFactorEnabled(Boolean twoFactorEnabled) { + this.twoFactorEnabled = twoFactorEnabled; + return this; + } + + /** + * Determines whether 2FA is enabled for the Organization Admin. + * @return twoFactorEnabled + */ + @javax.annotation.Nonnull + public Boolean getTwoFactorEnabled() { + return twoFactorEnabled; + } + + public void setTwoFactorEnabled(Boolean twoFactorEnabled) { + this.twoFactorEnabled = twoFactorEnabled; + } + + + public OrganizationMemberModel permissions(List permissions) { + this.permissions = permissions; + return this; + } + + public OrganizationMemberModel addPermissionsItem(OrganizationPermissionModel permissionsItem) { + if (this.permissions == null) { + this.permissions = new ArrayList<>(); + } + this.permissions.add(permissionsItem); + return this; + } + + /** + * The permissions of the Member. + * @return permissions + */ + @javax.annotation.Nonnull + public List getPermissions() { + return permissions; + } + + public void setPermissions(List permissions) { + this.permissions = permissions; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationMemberModel instance itself + */ + public OrganizationMemberModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationMemberModel organizationMemberModel = (OrganizationMemberModel) o; + return Objects.equals(this.userId, organizationMemberModel.userId) && + Objects.equals(this.fullName, organizationMemberModel.fullName) && + Objects.equals(this.email, organizationMemberModel.email) && + Objects.equals(this.twoFactorEnabled, organizationMemberModel.twoFactorEnabled) && + Objects.equals(this.permissions, organizationMemberModel.permissions)&& + Objects.equals(this.additionalProperties, organizationMemberModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(userId, fullName, email, twoFactorEnabled, permissions, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationMemberModel {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" twoFactorEnabled: ").append(toIndentedString(twoFactorEnabled)).append("\n"); + sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("userId"); + openapiFields.add("fullName"); + openapiFields.add("email"); + openapiFields.add("twoFactorEnabled"); + openapiFields.add("permissions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("userId"); + openapiRequiredFields.add("fullName"); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("twoFactorEnabled"); + openapiRequiredFields.add("permissions"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OrganizationMemberModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationMemberModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationMemberModel is not found in the empty JSON string", OrganizationMemberModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OrganizationMemberModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("userId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString())); + } + if (!jsonObj.get("fullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); + } + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("permissions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `permissions` to be an array in the JSON string but got `%s`", jsonObj.get("permissions").toString())); + } + + JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); + // validate the required field `permissions` (array) + for (int i = 0; i < jsonArraypermissions.size(); i++) { + OrganizationPermissionModel.validateJsonElement(jsonArraypermissions.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrganizationMemberModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationMemberModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationMemberModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OrganizationMemberModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationMemberModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationMemberModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationMemberModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationMemberModel + * @throws IOException if the JSON string is invalid with respect to OrganizationMemberModel + */ + public static OrganizationMemberModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationMemberModel.class); + } + + /** + * Convert an instance of OrganizationMemberModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationMembersModel.java b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationMembersModel.java new file mode 100644 index 0000000..1f70504 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationMembersModel.java @@ -0,0 +1,404 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.OrganizationAdminModel; +import com.configcat.publicapi.java.client.model.OrganizationMemberModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * OrganizationMembersModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class OrganizationMembersModel { + public static final String SERIALIZED_NAME_ADMINS = "admins"; + @SerializedName(SERIALIZED_NAME_ADMINS) + private List admins = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BILLING_MANAGERS = "billingManagers"; + @SerializedName(SERIALIZED_NAME_BILLING_MANAGERS) + private List billingManagers = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MEMBERS = "members"; + @SerializedName(SERIALIZED_NAME_MEMBERS) + private List members = new ArrayList<>(); + + public OrganizationMembersModel() { + } + + public OrganizationMembersModel admins(List admins) { + this.admins = admins; + return this; + } + + public OrganizationMembersModel addAdminsItem(OrganizationAdminModel adminsItem) { + if (this.admins == null) { + this.admins = new ArrayList<>(); + } + this.admins.add(adminsItem); + return this; + } + + /** + * List of Organization Admins. + * @return admins + */ + @javax.annotation.Nonnull + public List getAdmins() { + return admins; + } + + public void setAdmins(List admins) { + this.admins = admins; + } + + + public OrganizationMembersModel billingManagers(List billingManagers) { + this.billingManagers = billingManagers; + return this; + } + + public OrganizationMembersModel addBillingManagersItem(OrganizationAdminModel billingManagersItem) { + if (this.billingManagers == null) { + this.billingManagers = new ArrayList<>(); + } + this.billingManagers.add(billingManagersItem); + return this; + } + + /** + * List of Billing Managers. + * @return billingManagers + */ + @javax.annotation.Nonnull + public List getBillingManagers() { + return billingManagers; + } + + public void setBillingManagers(List billingManagers) { + this.billingManagers = billingManagers; + } + + + public OrganizationMembersModel members(List members) { + this.members = members; + return this; + } + + public OrganizationMembersModel addMembersItem(OrganizationMemberModel membersItem) { + if (this.members == null) { + this.members = new ArrayList<>(); + } + this.members.add(membersItem); + return this; + } + + /** + * List of Organization Members. + * @return members + */ + @javax.annotation.Nonnull + public List getMembers() { + return members; + } + + public void setMembers(List members) { + this.members = members; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationMembersModel instance itself + */ + public OrganizationMembersModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationMembersModel organizationMembersModel = (OrganizationMembersModel) o; + return Objects.equals(this.admins, organizationMembersModel.admins) && + Objects.equals(this.billingManagers, organizationMembersModel.billingManagers) && + Objects.equals(this.members, organizationMembersModel.members)&& + Objects.equals(this.additionalProperties, organizationMembersModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(admins, billingManagers, members, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationMembersModel {\n"); + sb.append(" admins: ").append(toIndentedString(admins)).append("\n"); + sb.append(" billingManagers: ").append(toIndentedString(billingManagers)).append("\n"); + sb.append(" members: ").append(toIndentedString(members)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("admins"); + openapiFields.add("billingManagers"); + openapiFields.add("members"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("admins"); + openapiRequiredFields.add("billingManagers"); + openapiRequiredFields.add("members"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OrganizationMembersModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationMembersModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationMembersModel is not found in the empty JSON string", OrganizationMembersModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OrganizationMembersModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("admins").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `admins` to be an array in the JSON string but got `%s`", jsonObj.get("admins").toString())); + } + + JsonArray jsonArrayadmins = jsonObj.getAsJsonArray("admins"); + // validate the required field `admins` (array) + for (int i = 0; i < jsonArrayadmins.size(); i++) { + OrganizationAdminModel.validateJsonElement(jsonArrayadmins.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("billingManagers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `billingManagers` to be an array in the JSON string but got `%s`", jsonObj.get("billingManagers").toString())); + } + + JsonArray jsonArraybillingManagers = jsonObj.getAsJsonArray("billingManagers"); + // validate the required field `billingManagers` (array) + for (int i = 0; i < jsonArraybillingManagers.size(); i++) { + OrganizationAdminModel.validateJsonElement(jsonArraybillingManagers.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("members").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `members` to be an array in the JSON string but got `%s`", jsonObj.get("members").toString())); + } + + JsonArray jsonArraymembers = jsonObj.getAsJsonArray("members"); + // validate the required field `members` (array) + for (int i = 0; i < jsonArraymembers.size(); i++) { + OrganizationMemberModel.validateJsonElement(jsonArraymembers.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrganizationMembersModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationMembersModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationMembersModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OrganizationMembersModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationMembersModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationMembersModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationMembersModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationMembersModel + * @throws IOException if the JSON string is invalid with respect to OrganizationMembersModel + */ + public static OrganizationMembersModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationMembersModel.class); + } + + /** + * Convert an instance of OrganizationMembersModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationModel.java b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationModel.java new file mode 100644 index 0000000..341048c --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationModel.java @@ -0,0 +1,326 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Details of the Organization. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class OrganizationModel { + public static final String SERIALIZED_NAME_ORGANIZATION_ID = "organizationId"; + @SerializedName(SERIALIZED_NAME_ORGANIZATION_ID) + private UUID organizationId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public OrganizationModel() { + } + + public OrganizationModel organizationId(UUID organizationId) { + this.organizationId = organizationId; + return this; + } + + /** + * Identifier of the Organization. + * @return organizationId + */ + @javax.annotation.Nonnull + public UUID getOrganizationId() { + return organizationId; + } + + public void setOrganizationId(UUID organizationId) { + this.organizationId = organizationId; + } + + + public OrganizationModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Organization. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationModel instance itself + */ + public OrganizationModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationModel organizationModel = (OrganizationModel) o; + return Objects.equals(this.organizationId, organizationModel.organizationId) && + Objects.equals(this.name, organizationModel.name)&& + Objects.equals(this.additionalProperties, organizationModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(organizationId, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationModel {\n"); + sb.append(" organizationId: ").append(toIndentedString(organizationId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("organizationId"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("organizationId"); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OrganizationModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationModel is not found in the empty JSON string", OrganizationModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OrganizationModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("organizationId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `organizationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("organizationId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrganizationModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OrganizationModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationModel + * @throws IOException if the JSON string is invalid with respect to OrganizationModel + */ + public static OrganizationModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationModel.class); + } + + /** + * Convert an instance of OrganizationModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationPermissionGroupModel.java b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationPermissionGroupModel.java new file mode 100644 index 0000000..aed6e30 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationPermissionGroupModel.java @@ -0,0 +1,322 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Describes the Member's Permission Group within a Product. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class OrganizationPermissionGroupModel { + public static final String SERIALIZED_NAME_PERMISSION_GROUP_ID = "permissionGroupId"; + @SerializedName(SERIALIZED_NAME_PERMISSION_GROUP_ID) + private Long permissionGroupId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public OrganizationPermissionGroupModel() { + } + + public OrganizationPermissionGroupModel permissionGroupId(Long permissionGroupId) { + this.permissionGroupId = permissionGroupId; + return this; + } + + /** + * Identifier of the Member's Permission Group. + * @return permissionGroupId + */ + @javax.annotation.Nonnull + public Long getPermissionGroupId() { + return permissionGroupId; + } + + public void setPermissionGroupId(Long permissionGroupId) { + this.permissionGroupId = permissionGroupId; + } + + + public OrganizationPermissionGroupModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Member's Permission Group. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationPermissionGroupModel instance itself + */ + public OrganizationPermissionGroupModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationPermissionGroupModel organizationPermissionGroupModel = (OrganizationPermissionGroupModel) o; + return Objects.equals(this.permissionGroupId, organizationPermissionGroupModel.permissionGroupId) && + Objects.equals(this.name, organizationPermissionGroupModel.name)&& + Objects.equals(this.additionalProperties, organizationPermissionGroupModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(permissionGroupId, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationPermissionGroupModel {\n"); + sb.append(" permissionGroupId: ").append(toIndentedString(permissionGroupId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("permissionGroupId"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("permissionGroupId"); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OrganizationPermissionGroupModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationPermissionGroupModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationPermissionGroupModel is not found in the empty JSON string", OrganizationPermissionGroupModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OrganizationPermissionGroupModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrganizationPermissionGroupModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationPermissionGroupModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationPermissionGroupModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OrganizationPermissionGroupModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationPermissionGroupModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationPermissionGroupModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationPermissionGroupModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationPermissionGroupModel + * @throws IOException if the JSON string is invalid with respect to OrganizationPermissionGroupModel + */ + public static OrganizationPermissionGroupModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationPermissionGroupModel.class); + } + + /** + * Convert an instance of OrganizationPermissionGroupModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationPermissionModel.java b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationPermissionModel.java new file mode 100644 index 0000000..e23f065 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationPermissionModel.java @@ -0,0 +1,325 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.OrganizationPermissionGroupModel; +import com.configcat.publicapi.java.client.model.OrganizationProductModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Describes the Member's permission. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class OrganizationPermissionModel { + public static final String SERIALIZED_NAME_PRODUCT = "product"; + @SerializedName(SERIALIZED_NAME_PRODUCT) + private OrganizationProductModel product; + + public static final String SERIALIZED_NAME_PERMISSION_GROUP = "permissionGroup"; + @SerializedName(SERIALIZED_NAME_PERMISSION_GROUP) + private OrganizationPermissionGroupModel permissionGroup; + + public OrganizationPermissionModel() { + } + + public OrganizationPermissionModel product(OrganizationProductModel product) { + this.product = product; + return this; + } + + /** + * Get product + * @return product + */ + @javax.annotation.Nonnull + public OrganizationProductModel getProduct() { + return product; + } + + public void setProduct(OrganizationProductModel product) { + this.product = product; + } + + + public OrganizationPermissionModel permissionGroup(OrganizationPermissionGroupModel permissionGroup) { + this.permissionGroup = permissionGroup; + return this; + } + + /** + * Get permissionGroup + * @return permissionGroup + */ + @javax.annotation.Nonnull + public OrganizationPermissionGroupModel getPermissionGroup() { + return permissionGroup; + } + + public void setPermissionGroup(OrganizationPermissionGroupModel permissionGroup) { + this.permissionGroup = permissionGroup; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationPermissionModel instance itself + */ + public OrganizationPermissionModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationPermissionModel organizationPermissionModel = (OrganizationPermissionModel) o; + return Objects.equals(this.product, organizationPermissionModel.product) && + Objects.equals(this.permissionGroup, organizationPermissionModel.permissionGroup)&& + Objects.equals(this.additionalProperties, organizationPermissionModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(product, permissionGroup, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationPermissionModel {\n"); + sb.append(" product: ").append(toIndentedString(product)).append("\n"); + sb.append(" permissionGroup: ").append(toIndentedString(permissionGroup)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("product"); + openapiFields.add("permissionGroup"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("product"); + openapiRequiredFields.add("permissionGroup"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OrganizationPermissionModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationPermissionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationPermissionModel is not found in the empty JSON string", OrganizationPermissionModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OrganizationPermissionModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `product` + OrganizationProductModel.validateJsonElement(jsonObj.get("product")); + // validate the required field `permissionGroup` + OrganizationPermissionGroupModel.validateJsonElement(jsonObj.get("permissionGroup")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrganizationPermissionModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationPermissionModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationPermissionModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OrganizationPermissionModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationPermissionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationPermissionModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationPermissionModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationPermissionModel + * @throws IOException if the JSON string is invalid with respect to OrganizationPermissionModel + */ + public static OrganizationPermissionModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationPermissionModel.class); + } + + /** + * Convert an instance of OrganizationPermissionModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationProductModel.java b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationProductModel.java new file mode 100644 index 0000000..7d12435 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationProductModel.java @@ -0,0 +1,326 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Describes the Member's Product. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class OrganizationProductModel { + public static final String SERIALIZED_NAME_PRODUCT_ID = "productId"; + @SerializedName(SERIALIZED_NAME_PRODUCT_ID) + private UUID productId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public OrganizationProductModel() { + } + + public OrganizationProductModel productId(UUID productId) { + this.productId = productId; + return this; + } + + /** + * Identifier of the Member's Product. + * @return productId + */ + @javax.annotation.Nonnull + public UUID getProductId() { + return productId; + } + + public void setProductId(UUID productId) { + this.productId = productId; + } + + + public OrganizationProductModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Member's Product. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationProductModel instance itself + */ + public OrganizationProductModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationProductModel organizationProductModel = (OrganizationProductModel) o; + return Objects.equals(this.productId, organizationProductModel.productId) && + Objects.equals(this.name, organizationProductModel.name)&& + Objects.equals(this.additionalProperties, organizationProductModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(productId, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationProductModel {\n"); + sb.append(" productId: ").append(toIndentedString(productId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("productId"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("productId"); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OrganizationProductModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationProductModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationProductModel is not found in the empty JSON string", OrganizationProductModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OrganizationProductModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("productId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `productId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrganizationProductModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationProductModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationProductModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OrganizationProductModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationProductModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationProductModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationProductModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationProductModel + * @throws IOException if the JSON string is invalid with respect to OrganizationProductModel + */ + public static OrganizationProductModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationProductModel.class); + } + + /** + * Convert an instance of OrganizationProductModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/PercentageOptionModel.java b/src/main/java/com/configcat/publicapi/java/client/model/PercentageOptionModel.java new file mode 100644 index 0000000..a17fe7d --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/PercentageOptionModel.java @@ -0,0 +1,322 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.ValueModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * PercentageOptionModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class PercentageOptionModel { + public static final String SERIALIZED_NAME_PERCENTAGE = "percentage"; + @SerializedName(SERIALIZED_NAME_PERCENTAGE) + private Integer percentage; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private ValueModel value; + + public PercentageOptionModel() { + } + + public PercentageOptionModel percentage(Integer percentage) { + this.percentage = percentage; + return this; + } + + /** + * A number between 0 and 100 that represents a randomly allocated fraction of the users. + * @return percentage + */ + @javax.annotation.Nonnull + public Integer getPercentage() { + return percentage; + } + + public void setPercentage(Integer percentage) { + this.percentage = percentage; + } + + + public PercentageOptionModel value(ValueModel value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nonnull + public ValueModel getValue() { + return value; + } + + public void setValue(ValueModel value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PercentageOptionModel instance itself + */ + public PercentageOptionModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PercentageOptionModel percentageOptionModel = (PercentageOptionModel) o; + return Objects.equals(this.percentage, percentageOptionModel.percentage) && + Objects.equals(this.value, percentageOptionModel.value)&& + Objects.equals(this.additionalProperties, percentageOptionModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(percentage, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PercentageOptionModel {\n"); + sb.append(" percentage: ").append(toIndentedString(percentage)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("percentage"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("percentage"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PercentageOptionModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PercentageOptionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PercentageOptionModel is not found in the empty JSON string", PercentageOptionModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PercentageOptionModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `value` + ValueModel.validateJsonElement(jsonObj.get("value")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PercentageOptionModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PercentageOptionModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PercentageOptionModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PercentageOptionModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PercentageOptionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PercentageOptionModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PercentageOptionModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of PercentageOptionModel + * @throws IOException if the JSON string is invalid with respect to PercentageOptionModel + */ + public static PercentageOptionModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PercentageOptionModel.class); + } + + /** + * Convert an instance of PercentageOptionModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/PermissionGroupModel.java b/src/main/java/com/configcat/publicapi/java/client/model/PermissionGroupModel.java new file mode 100644 index 0000000..fb2d11e --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/PermissionGroupModel.java @@ -0,0 +1,1027 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.AccessType; +import com.configcat.publicapi.java.client.model.EnvironmentAccessModel; +import com.configcat.publicapi.java.client.model.EnvironmentAccessType; +import com.configcat.publicapi.java.client.model.ProductModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * PermissionGroupModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class PermissionGroupModel { + public static final String SERIALIZED_NAME_PERMISSION_GROUP_ID = "permissionGroupId"; + @SerializedName(SERIALIZED_NAME_PERMISSION_GROUP_ID) + private Long permissionGroupId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_CAN_MANAGE_MEMBERS = "canManageMembers"; + @SerializedName(SERIALIZED_NAME_CAN_MANAGE_MEMBERS) + private Boolean canManageMembers; + + public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_CONFIG = "canCreateOrUpdateConfig"; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_CONFIG) + private Boolean canCreateOrUpdateConfig; + + public static final String SERIALIZED_NAME_CAN_DELETE_CONFIG = "canDeleteConfig"; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_CONFIG) + private Boolean canDeleteConfig; + + public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_ENVIRONMENT = "canCreateOrUpdateEnvironment"; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_ENVIRONMENT) + private Boolean canCreateOrUpdateEnvironment; + + public static final String SERIALIZED_NAME_CAN_DELETE_ENVIRONMENT = "canDeleteEnvironment"; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_ENVIRONMENT) + private Boolean canDeleteEnvironment; + + public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SETTING = "canCreateOrUpdateSetting"; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SETTING) + private Boolean canCreateOrUpdateSetting; + + public static final String SERIALIZED_NAME_CAN_TAG_SETTING = "canTagSetting"; + @SerializedName(SERIALIZED_NAME_CAN_TAG_SETTING) + private Boolean canTagSetting; + + public static final String SERIALIZED_NAME_CAN_DELETE_SETTING = "canDeleteSetting"; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_SETTING) + private Boolean canDeleteSetting; + + public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_TAG = "canCreateOrUpdateTag"; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_TAG) + private Boolean canCreateOrUpdateTag; + + public static final String SERIALIZED_NAME_CAN_DELETE_TAG = "canDeleteTag"; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_TAG) + private Boolean canDeleteTag; + + public static final String SERIALIZED_NAME_CAN_MANAGE_WEBHOOK = "canManageWebhook"; + @SerializedName(SERIALIZED_NAME_CAN_MANAGE_WEBHOOK) + private Boolean canManageWebhook; + + public static final String SERIALIZED_NAME_CAN_USE_EXPORT_IMPORT = "canUseExportImport"; + @SerializedName(SERIALIZED_NAME_CAN_USE_EXPORT_IMPORT) + private Boolean canUseExportImport; + + public static final String SERIALIZED_NAME_CAN_MANAGE_PRODUCT_PREFERENCES = "canManageProductPreferences"; + @SerializedName(SERIALIZED_NAME_CAN_MANAGE_PRODUCT_PREFERENCES) + private Boolean canManageProductPreferences; + + public static final String SERIALIZED_NAME_CAN_MANAGE_INTEGRATIONS = "canManageIntegrations"; + @SerializedName(SERIALIZED_NAME_CAN_MANAGE_INTEGRATIONS) + private Boolean canManageIntegrations; + + public static final String SERIALIZED_NAME_CAN_VIEW_SDK_KEY = "canViewSdkKey"; + @SerializedName(SERIALIZED_NAME_CAN_VIEW_SDK_KEY) + private Boolean canViewSdkKey; + + public static final String SERIALIZED_NAME_CAN_ROTATE_SDK_KEY = "canRotateSdkKey"; + @SerializedName(SERIALIZED_NAME_CAN_ROTATE_SDK_KEY) + private Boolean canRotateSdkKey; + + public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SEGMENTS = "canCreateOrUpdateSegments"; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SEGMENTS) + private Boolean canCreateOrUpdateSegments; + + public static final String SERIALIZED_NAME_CAN_DELETE_SEGMENTS = "canDeleteSegments"; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_SEGMENTS) + private Boolean canDeleteSegments; + + public static final String SERIALIZED_NAME_CAN_VIEW_PRODUCT_AUDIT_LOG = "canViewProductAuditLog"; + @SerializedName(SERIALIZED_NAME_CAN_VIEW_PRODUCT_AUDIT_LOG) + private Boolean canViewProductAuditLog; + + public static final String SERIALIZED_NAME_CAN_VIEW_PRODUCT_STATISTICS = "canViewProductStatistics"; + @SerializedName(SERIALIZED_NAME_CAN_VIEW_PRODUCT_STATISTICS) + private Boolean canViewProductStatistics; + + public static final String SERIALIZED_NAME_CAN_DISABLE2_F_A = "canDisable2FA"; + @SerializedName(SERIALIZED_NAME_CAN_DISABLE2_F_A) + private Boolean canDisable2FA; + + public static final String SERIALIZED_NAME_ACCESS_TYPE = "accessType"; + @SerializedName(SERIALIZED_NAME_ACCESS_TYPE) + private AccessType accessType; + + public static final String SERIALIZED_NAME_NEW_ENVIRONMENT_ACCESS_TYPE = "newEnvironmentAccessType"; + @SerializedName(SERIALIZED_NAME_NEW_ENVIRONMENT_ACCESS_TYPE) + private EnvironmentAccessType newEnvironmentAccessType; + + public static final String SERIALIZED_NAME_ENVIRONMENT_ACCESSES = "environmentAccesses"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ACCESSES) + private List environmentAccesses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PRODUCT = "product"; + @SerializedName(SERIALIZED_NAME_PRODUCT) + private ProductModel product; + + public PermissionGroupModel() { + } + + public PermissionGroupModel permissionGroupId(Long permissionGroupId) { + this.permissionGroupId = permissionGroupId; + return this; + } + + /** + * Identifier of the Permission Group. + * @return permissionGroupId + */ + @javax.annotation.Nonnull + public Long getPermissionGroupId() { + return permissionGroupId; + } + + public void setPermissionGroupId(Long permissionGroupId) { + this.permissionGroupId = permissionGroupId; + } + + + public PermissionGroupModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Permission Group. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public PermissionGroupModel canManageMembers(Boolean canManageMembers) { + this.canManageMembers = canManageMembers; + return this; + } + + /** + * Group members can manage team members. + * @return canManageMembers + */ + @javax.annotation.Nonnull + public Boolean getCanManageMembers() { + return canManageMembers; + } + + public void setCanManageMembers(Boolean canManageMembers) { + this.canManageMembers = canManageMembers; + } + + + public PermissionGroupModel canCreateOrUpdateConfig(Boolean canCreateOrUpdateConfig) { + this.canCreateOrUpdateConfig = canCreateOrUpdateConfig; + return this; + } + + /** + * Group members can create/update Configs. + * @return canCreateOrUpdateConfig + */ + @javax.annotation.Nonnull + public Boolean getCanCreateOrUpdateConfig() { + return canCreateOrUpdateConfig; + } + + public void setCanCreateOrUpdateConfig(Boolean canCreateOrUpdateConfig) { + this.canCreateOrUpdateConfig = canCreateOrUpdateConfig; + } + + + public PermissionGroupModel canDeleteConfig(Boolean canDeleteConfig) { + this.canDeleteConfig = canDeleteConfig; + return this; + } + + /** + * Group members can delete Configs. + * @return canDeleteConfig + */ + @javax.annotation.Nonnull + public Boolean getCanDeleteConfig() { + return canDeleteConfig; + } + + public void setCanDeleteConfig(Boolean canDeleteConfig) { + this.canDeleteConfig = canDeleteConfig; + } + + + public PermissionGroupModel canCreateOrUpdateEnvironment(Boolean canCreateOrUpdateEnvironment) { + this.canCreateOrUpdateEnvironment = canCreateOrUpdateEnvironment; + return this; + } + + /** + * Group members can create/update Environments. + * @return canCreateOrUpdateEnvironment + */ + @javax.annotation.Nonnull + public Boolean getCanCreateOrUpdateEnvironment() { + return canCreateOrUpdateEnvironment; + } + + public void setCanCreateOrUpdateEnvironment(Boolean canCreateOrUpdateEnvironment) { + this.canCreateOrUpdateEnvironment = canCreateOrUpdateEnvironment; + } + + + public PermissionGroupModel canDeleteEnvironment(Boolean canDeleteEnvironment) { + this.canDeleteEnvironment = canDeleteEnvironment; + return this; + } + + /** + * Group members can delete Environments. + * @return canDeleteEnvironment + */ + @javax.annotation.Nonnull + public Boolean getCanDeleteEnvironment() { + return canDeleteEnvironment; + } + + public void setCanDeleteEnvironment(Boolean canDeleteEnvironment) { + this.canDeleteEnvironment = canDeleteEnvironment; + } + + + public PermissionGroupModel canCreateOrUpdateSetting(Boolean canCreateOrUpdateSetting) { + this.canCreateOrUpdateSetting = canCreateOrUpdateSetting; + return this; + } + + /** + * Group members can create/update Feature Flags and Settings. + * @return canCreateOrUpdateSetting + */ + @javax.annotation.Nonnull + public Boolean getCanCreateOrUpdateSetting() { + return canCreateOrUpdateSetting; + } + + public void setCanCreateOrUpdateSetting(Boolean canCreateOrUpdateSetting) { + this.canCreateOrUpdateSetting = canCreateOrUpdateSetting; + } + + + public PermissionGroupModel canTagSetting(Boolean canTagSetting) { + this.canTagSetting = canTagSetting; + return this; + } + + /** + * Group members can attach/detach Tags to Feature Flags and Settings. + * @return canTagSetting + */ + @javax.annotation.Nonnull + public Boolean getCanTagSetting() { + return canTagSetting; + } + + public void setCanTagSetting(Boolean canTagSetting) { + this.canTagSetting = canTagSetting; + } + + + public PermissionGroupModel canDeleteSetting(Boolean canDeleteSetting) { + this.canDeleteSetting = canDeleteSetting; + return this; + } + + /** + * Group members can delete Feature Flags and Settings. + * @return canDeleteSetting + */ + @javax.annotation.Nonnull + public Boolean getCanDeleteSetting() { + return canDeleteSetting; + } + + public void setCanDeleteSetting(Boolean canDeleteSetting) { + this.canDeleteSetting = canDeleteSetting; + } + + + public PermissionGroupModel canCreateOrUpdateTag(Boolean canCreateOrUpdateTag) { + this.canCreateOrUpdateTag = canCreateOrUpdateTag; + return this; + } + + /** + * Group members can create/update Tags. + * @return canCreateOrUpdateTag + */ + @javax.annotation.Nonnull + public Boolean getCanCreateOrUpdateTag() { + return canCreateOrUpdateTag; + } + + public void setCanCreateOrUpdateTag(Boolean canCreateOrUpdateTag) { + this.canCreateOrUpdateTag = canCreateOrUpdateTag; + } + + + public PermissionGroupModel canDeleteTag(Boolean canDeleteTag) { + this.canDeleteTag = canDeleteTag; + return this; + } + + /** + * Group members can delete Tags. + * @return canDeleteTag + */ + @javax.annotation.Nonnull + public Boolean getCanDeleteTag() { + return canDeleteTag; + } + + public void setCanDeleteTag(Boolean canDeleteTag) { + this.canDeleteTag = canDeleteTag; + } + + + public PermissionGroupModel canManageWebhook(Boolean canManageWebhook) { + this.canManageWebhook = canManageWebhook; + return this; + } + + /** + * Group members can create/update/delete Webhooks. + * @return canManageWebhook + */ + @javax.annotation.Nonnull + public Boolean getCanManageWebhook() { + return canManageWebhook; + } + + public void setCanManageWebhook(Boolean canManageWebhook) { + this.canManageWebhook = canManageWebhook; + } + + + public PermissionGroupModel canUseExportImport(Boolean canUseExportImport) { + this.canUseExportImport = canUseExportImport; + return this; + } + + /** + * Group members can use the export/import feature. + * @return canUseExportImport + */ + @javax.annotation.Nonnull + public Boolean getCanUseExportImport() { + return canUseExportImport; + } + + public void setCanUseExportImport(Boolean canUseExportImport) { + this.canUseExportImport = canUseExportImport; + } + + + public PermissionGroupModel canManageProductPreferences(Boolean canManageProductPreferences) { + this.canManageProductPreferences = canManageProductPreferences; + return this; + } + + /** + * Group members can update Product preferences. + * @return canManageProductPreferences + */ + @javax.annotation.Nonnull + public Boolean getCanManageProductPreferences() { + return canManageProductPreferences; + } + + public void setCanManageProductPreferences(Boolean canManageProductPreferences) { + this.canManageProductPreferences = canManageProductPreferences; + } + + + public PermissionGroupModel canManageIntegrations(Boolean canManageIntegrations) { + this.canManageIntegrations = canManageIntegrations; + return this; + } + + /** + * Group members can add and configure integrations. + * @return canManageIntegrations + */ + @javax.annotation.Nonnull + public Boolean getCanManageIntegrations() { + return canManageIntegrations; + } + + public void setCanManageIntegrations(Boolean canManageIntegrations) { + this.canManageIntegrations = canManageIntegrations; + } + + + public PermissionGroupModel canViewSdkKey(Boolean canViewSdkKey) { + this.canViewSdkKey = canViewSdkKey; + return this; + } + + /** + * Group members has access to SDK keys. + * @return canViewSdkKey + */ + @javax.annotation.Nonnull + public Boolean getCanViewSdkKey() { + return canViewSdkKey; + } + + public void setCanViewSdkKey(Boolean canViewSdkKey) { + this.canViewSdkKey = canViewSdkKey; + } + + + public PermissionGroupModel canRotateSdkKey(Boolean canRotateSdkKey) { + this.canRotateSdkKey = canRotateSdkKey; + return this; + } + + /** + * Group members can rotate SDK keys. + * @return canRotateSdkKey + */ + @javax.annotation.Nonnull + public Boolean getCanRotateSdkKey() { + return canRotateSdkKey; + } + + public void setCanRotateSdkKey(Boolean canRotateSdkKey) { + this.canRotateSdkKey = canRotateSdkKey; + } + + + public PermissionGroupModel canCreateOrUpdateSegments(Boolean canCreateOrUpdateSegments) { + this.canCreateOrUpdateSegments = canCreateOrUpdateSegments; + return this; + } + + /** + * Group members can create/update Segments. + * @return canCreateOrUpdateSegments + */ + @javax.annotation.Nonnull + public Boolean getCanCreateOrUpdateSegments() { + return canCreateOrUpdateSegments; + } + + public void setCanCreateOrUpdateSegments(Boolean canCreateOrUpdateSegments) { + this.canCreateOrUpdateSegments = canCreateOrUpdateSegments; + } + + + public PermissionGroupModel canDeleteSegments(Boolean canDeleteSegments) { + this.canDeleteSegments = canDeleteSegments; + return this; + } + + /** + * Group members can delete Segments. + * @return canDeleteSegments + */ + @javax.annotation.Nonnull + public Boolean getCanDeleteSegments() { + return canDeleteSegments; + } + + public void setCanDeleteSegments(Boolean canDeleteSegments) { + this.canDeleteSegments = canDeleteSegments; + } + + + public PermissionGroupModel canViewProductAuditLog(Boolean canViewProductAuditLog) { + this.canViewProductAuditLog = canViewProductAuditLog; + return this; + } + + /** + * Group members has access to audit logs. + * @return canViewProductAuditLog + */ + @javax.annotation.Nonnull + public Boolean getCanViewProductAuditLog() { + return canViewProductAuditLog; + } + + public void setCanViewProductAuditLog(Boolean canViewProductAuditLog) { + this.canViewProductAuditLog = canViewProductAuditLog; + } + + + public PermissionGroupModel canViewProductStatistics(Boolean canViewProductStatistics) { + this.canViewProductStatistics = canViewProductStatistics; + return this; + } + + /** + * Group members has access to product statistics. + * @return canViewProductStatistics + */ + @javax.annotation.Nonnull + public Boolean getCanViewProductStatistics() { + return canViewProductStatistics; + } + + public void setCanViewProductStatistics(Boolean canViewProductStatistics) { + this.canViewProductStatistics = canViewProductStatistics; + } + + + public PermissionGroupModel canDisable2FA(Boolean canDisable2FA) { + this.canDisable2FA = canDisable2FA; + return this; + } + + /** + * Group members can disable two-factor authentication for other members. + * @return canDisable2FA + */ + @javax.annotation.Nonnull + public Boolean getCanDisable2FA() { + return canDisable2FA; + } + + public void setCanDisable2FA(Boolean canDisable2FA) { + this.canDisable2FA = canDisable2FA; + } + + + public PermissionGroupModel accessType(AccessType accessType) { + this.accessType = accessType; + return this; + } + + /** + * Get accessType + * @return accessType + */ + @javax.annotation.Nonnull + public AccessType getAccessType() { + return accessType; + } + + public void setAccessType(AccessType accessType) { + this.accessType = accessType; + } + + + public PermissionGroupModel newEnvironmentAccessType(EnvironmentAccessType newEnvironmentAccessType) { + this.newEnvironmentAccessType = newEnvironmentAccessType; + return this; + } + + /** + * Get newEnvironmentAccessType + * @return newEnvironmentAccessType + */ + @javax.annotation.Nonnull + public EnvironmentAccessType getNewEnvironmentAccessType() { + return newEnvironmentAccessType; + } + + public void setNewEnvironmentAccessType(EnvironmentAccessType newEnvironmentAccessType) { + this.newEnvironmentAccessType = newEnvironmentAccessType; + } + + + public PermissionGroupModel environmentAccesses(List environmentAccesses) { + this.environmentAccesses = environmentAccesses; + return this; + } + + public PermissionGroupModel addEnvironmentAccessesItem(EnvironmentAccessModel environmentAccessesItem) { + if (this.environmentAccesses == null) { + this.environmentAccesses = new ArrayList<>(); + } + this.environmentAccesses.add(environmentAccessesItem); + return this; + } + + /** + * List of environment specific permissions. + * @return environmentAccesses + */ + @javax.annotation.Nonnull + public List getEnvironmentAccesses() { + return environmentAccesses; + } + + public void setEnvironmentAccesses(List environmentAccesses) { + this.environmentAccesses = environmentAccesses; + } + + + public PermissionGroupModel product(ProductModel product) { + this.product = product; + return this; + } + + /** + * Get product + * @return product + */ + @javax.annotation.Nonnull + public ProductModel getProduct() { + return product; + } + + public void setProduct(ProductModel product) { + this.product = product; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PermissionGroupModel instance itself + */ + public PermissionGroupModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PermissionGroupModel permissionGroupModel = (PermissionGroupModel) o; + return Objects.equals(this.permissionGroupId, permissionGroupModel.permissionGroupId) && + Objects.equals(this.name, permissionGroupModel.name) && + Objects.equals(this.canManageMembers, permissionGroupModel.canManageMembers) && + Objects.equals(this.canCreateOrUpdateConfig, permissionGroupModel.canCreateOrUpdateConfig) && + Objects.equals(this.canDeleteConfig, permissionGroupModel.canDeleteConfig) && + Objects.equals(this.canCreateOrUpdateEnvironment, permissionGroupModel.canCreateOrUpdateEnvironment) && + Objects.equals(this.canDeleteEnvironment, permissionGroupModel.canDeleteEnvironment) && + Objects.equals(this.canCreateOrUpdateSetting, permissionGroupModel.canCreateOrUpdateSetting) && + Objects.equals(this.canTagSetting, permissionGroupModel.canTagSetting) && + Objects.equals(this.canDeleteSetting, permissionGroupModel.canDeleteSetting) && + Objects.equals(this.canCreateOrUpdateTag, permissionGroupModel.canCreateOrUpdateTag) && + Objects.equals(this.canDeleteTag, permissionGroupModel.canDeleteTag) && + Objects.equals(this.canManageWebhook, permissionGroupModel.canManageWebhook) && + Objects.equals(this.canUseExportImport, permissionGroupModel.canUseExportImport) && + Objects.equals(this.canManageProductPreferences, permissionGroupModel.canManageProductPreferences) && + Objects.equals(this.canManageIntegrations, permissionGroupModel.canManageIntegrations) && + Objects.equals(this.canViewSdkKey, permissionGroupModel.canViewSdkKey) && + Objects.equals(this.canRotateSdkKey, permissionGroupModel.canRotateSdkKey) && + Objects.equals(this.canCreateOrUpdateSegments, permissionGroupModel.canCreateOrUpdateSegments) && + Objects.equals(this.canDeleteSegments, permissionGroupModel.canDeleteSegments) && + Objects.equals(this.canViewProductAuditLog, permissionGroupModel.canViewProductAuditLog) && + Objects.equals(this.canViewProductStatistics, permissionGroupModel.canViewProductStatistics) && + Objects.equals(this.canDisable2FA, permissionGroupModel.canDisable2FA) && + Objects.equals(this.accessType, permissionGroupModel.accessType) && + Objects.equals(this.newEnvironmentAccessType, permissionGroupModel.newEnvironmentAccessType) && + Objects.equals(this.environmentAccesses, permissionGroupModel.environmentAccesses) && + Objects.equals(this.product, permissionGroupModel.product)&& + Objects.equals(this.additionalProperties, permissionGroupModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(permissionGroupId, name, canManageMembers, canCreateOrUpdateConfig, canDeleteConfig, canCreateOrUpdateEnvironment, canDeleteEnvironment, canCreateOrUpdateSetting, canTagSetting, canDeleteSetting, canCreateOrUpdateTag, canDeleteTag, canManageWebhook, canUseExportImport, canManageProductPreferences, canManageIntegrations, canViewSdkKey, canRotateSdkKey, canCreateOrUpdateSegments, canDeleteSegments, canViewProductAuditLog, canViewProductStatistics, canDisable2FA, accessType, newEnvironmentAccessType, environmentAccesses, product, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PermissionGroupModel {\n"); + sb.append(" permissionGroupId: ").append(toIndentedString(permissionGroupId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" canManageMembers: ").append(toIndentedString(canManageMembers)).append("\n"); + sb.append(" canCreateOrUpdateConfig: ").append(toIndentedString(canCreateOrUpdateConfig)).append("\n"); + sb.append(" canDeleteConfig: ").append(toIndentedString(canDeleteConfig)).append("\n"); + sb.append(" canCreateOrUpdateEnvironment: ").append(toIndentedString(canCreateOrUpdateEnvironment)).append("\n"); + sb.append(" canDeleteEnvironment: ").append(toIndentedString(canDeleteEnvironment)).append("\n"); + sb.append(" canCreateOrUpdateSetting: ").append(toIndentedString(canCreateOrUpdateSetting)).append("\n"); + sb.append(" canTagSetting: ").append(toIndentedString(canTagSetting)).append("\n"); + sb.append(" canDeleteSetting: ").append(toIndentedString(canDeleteSetting)).append("\n"); + sb.append(" canCreateOrUpdateTag: ").append(toIndentedString(canCreateOrUpdateTag)).append("\n"); + sb.append(" canDeleteTag: ").append(toIndentedString(canDeleteTag)).append("\n"); + sb.append(" canManageWebhook: ").append(toIndentedString(canManageWebhook)).append("\n"); + sb.append(" canUseExportImport: ").append(toIndentedString(canUseExportImport)).append("\n"); + sb.append(" canManageProductPreferences: ").append(toIndentedString(canManageProductPreferences)).append("\n"); + sb.append(" canManageIntegrations: ").append(toIndentedString(canManageIntegrations)).append("\n"); + sb.append(" canViewSdkKey: ").append(toIndentedString(canViewSdkKey)).append("\n"); + sb.append(" canRotateSdkKey: ").append(toIndentedString(canRotateSdkKey)).append("\n"); + sb.append(" canCreateOrUpdateSegments: ").append(toIndentedString(canCreateOrUpdateSegments)).append("\n"); + sb.append(" canDeleteSegments: ").append(toIndentedString(canDeleteSegments)).append("\n"); + sb.append(" canViewProductAuditLog: ").append(toIndentedString(canViewProductAuditLog)).append("\n"); + sb.append(" canViewProductStatistics: ").append(toIndentedString(canViewProductStatistics)).append("\n"); + sb.append(" canDisable2FA: ").append(toIndentedString(canDisable2FA)).append("\n"); + sb.append(" accessType: ").append(toIndentedString(accessType)).append("\n"); + sb.append(" newEnvironmentAccessType: ").append(toIndentedString(newEnvironmentAccessType)).append("\n"); + sb.append(" environmentAccesses: ").append(toIndentedString(environmentAccesses)).append("\n"); + sb.append(" product: ").append(toIndentedString(product)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("permissionGroupId"); + openapiFields.add("name"); + openapiFields.add("canManageMembers"); + openapiFields.add("canCreateOrUpdateConfig"); + openapiFields.add("canDeleteConfig"); + openapiFields.add("canCreateOrUpdateEnvironment"); + openapiFields.add("canDeleteEnvironment"); + openapiFields.add("canCreateOrUpdateSetting"); + openapiFields.add("canTagSetting"); + openapiFields.add("canDeleteSetting"); + openapiFields.add("canCreateOrUpdateTag"); + openapiFields.add("canDeleteTag"); + openapiFields.add("canManageWebhook"); + openapiFields.add("canUseExportImport"); + openapiFields.add("canManageProductPreferences"); + openapiFields.add("canManageIntegrations"); + openapiFields.add("canViewSdkKey"); + openapiFields.add("canRotateSdkKey"); + openapiFields.add("canCreateOrUpdateSegments"); + openapiFields.add("canDeleteSegments"); + openapiFields.add("canViewProductAuditLog"); + openapiFields.add("canViewProductStatistics"); + openapiFields.add("canDisable2FA"); + openapiFields.add("accessType"); + openapiFields.add("newEnvironmentAccessType"); + openapiFields.add("environmentAccesses"); + openapiFields.add("product"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("permissionGroupId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("canManageMembers"); + openapiRequiredFields.add("canCreateOrUpdateConfig"); + openapiRequiredFields.add("canDeleteConfig"); + openapiRequiredFields.add("canCreateOrUpdateEnvironment"); + openapiRequiredFields.add("canDeleteEnvironment"); + openapiRequiredFields.add("canCreateOrUpdateSetting"); + openapiRequiredFields.add("canTagSetting"); + openapiRequiredFields.add("canDeleteSetting"); + openapiRequiredFields.add("canCreateOrUpdateTag"); + openapiRequiredFields.add("canDeleteTag"); + openapiRequiredFields.add("canManageWebhook"); + openapiRequiredFields.add("canUseExportImport"); + openapiRequiredFields.add("canManageProductPreferences"); + openapiRequiredFields.add("canManageIntegrations"); + openapiRequiredFields.add("canViewSdkKey"); + openapiRequiredFields.add("canRotateSdkKey"); + openapiRequiredFields.add("canCreateOrUpdateSegments"); + openapiRequiredFields.add("canDeleteSegments"); + openapiRequiredFields.add("canViewProductAuditLog"); + openapiRequiredFields.add("canViewProductStatistics"); + openapiRequiredFields.add("canDisable2FA"); + openapiRequiredFields.add("accessType"); + openapiRequiredFields.add("newEnvironmentAccessType"); + openapiRequiredFields.add("environmentAccesses"); + openapiRequiredFields.add("product"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PermissionGroupModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PermissionGroupModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PermissionGroupModel is not found in the empty JSON string", PermissionGroupModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PermissionGroupModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + // validate the required field `accessType` + AccessType.validateJsonElement(jsonObj.get("accessType")); + // validate the required field `newEnvironmentAccessType` + EnvironmentAccessType.validateJsonElement(jsonObj.get("newEnvironmentAccessType")); + // ensure the json data is an array + if (!jsonObj.get("environmentAccesses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `environmentAccesses` to be an array in the JSON string but got `%s`", jsonObj.get("environmentAccesses").toString())); + } + + JsonArray jsonArrayenvironmentAccesses = jsonObj.getAsJsonArray("environmentAccesses"); + // validate the required field `environmentAccesses` (array) + for (int i = 0; i < jsonArrayenvironmentAccesses.size(); i++) { + EnvironmentAccessModel.validateJsonElement(jsonArrayenvironmentAccesses.get(i)); + }; + // validate the required field `product` + ProductModel.validateJsonElement(jsonObj.get("product")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PermissionGroupModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PermissionGroupModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PermissionGroupModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PermissionGroupModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PermissionGroupModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PermissionGroupModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PermissionGroupModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of PermissionGroupModel + * @throws IOException if the JSON string is invalid with respect to PermissionGroupModel + */ + public static PermissionGroupModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PermissionGroupModel.class); + } + + /** + * Convert an instance of PermissionGroupModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/PreferencesModel.java b/src/main/java/com/configcat/publicapi/java/client/model/PreferencesModel.java new file mode 100644 index 0000000..d801481 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/PreferencesModel.java @@ -0,0 +1,424 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.KeyGenerationMode; +import com.configcat.publicapi.java.client.model.ReasonRequiredEnvironmentModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * PreferencesModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class PreferencesModel { + public static final String SERIALIZED_NAME_REASON_REQUIRED = "reasonRequired"; + @SerializedName(SERIALIZED_NAME_REASON_REQUIRED) + private Boolean reasonRequired; + + public static final String SERIALIZED_NAME_KEY_GENERATION_MODE = "keyGenerationMode"; + @SerializedName(SERIALIZED_NAME_KEY_GENERATION_MODE) + private KeyGenerationMode keyGenerationMode; + + public static final String SERIALIZED_NAME_SHOW_VARIATION_ID = "showVariationId"; + @SerializedName(SERIALIZED_NAME_SHOW_VARIATION_ID) + private Boolean showVariationId; + + public static final String SERIALIZED_NAME_REASON_REQUIRED_ENVIRONMENTS = "reasonRequiredEnvironments"; + @SerializedName(SERIALIZED_NAME_REASON_REQUIRED_ENVIRONMENTS) + private List reasonRequiredEnvironments; + + public static final String SERIALIZED_NAME_MANDATORY_SETTING_HINT = "mandatorySettingHint"; + @SerializedName(SERIALIZED_NAME_MANDATORY_SETTING_HINT) + private Boolean mandatorySettingHint; + + public PreferencesModel() { + } + + public PreferencesModel reasonRequired(Boolean reasonRequired) { + this.reasonRequired = reasonRequired; + return this; + } + + /** + * Indicates that a mandatory note required for saving and publishing. + * @return reasonRequired + */ + @javax.annotation.Nonnull + public Boolean getReasonRequired() { + return reasonRequired; + } + + public void setReasonRequired(Boolean reasonRequired) { + this.reasonRequired = reasonRequired; + } + + + public PreferencesModel keyGenerationMode(KeyGenerationMode keyGenerationMode) { + this.keyGenerationMode = keyGenerationMode; + return this; + } + + /** + * Get keyGenerationMode + * @return keyGenerationMode + */ + @javax.annotation.Nonnull + public KeyGenerationMode getKeyGenerationMode() { + return keyGenerationMode; + } + + public void setKeyGenerationMode(KeyGenerationMode keyGenerationMode) { + this.keyGenerationMode = keyGenerationMode; + } + + + public PreferencesModel showVariationId(Boolean showVariationId) { + this.showVariationId = showVariationId; + return this; + } + + /** + * Indicates whether a variation ID's must be shown on the ConfigCat Dashboard. + * @return showVariationId + */ + @javax.annotation.Nonnull + public Boolean getShowVariationId() { + return showVariationId; + } + + public void setShowVariationId(Boolean showVariationId) { + this.showVariationId = showVariationId; + } + + + public PreferencesModel reasonRequiredEnvironments(List reasonRequiredEnvironments) { + this.reasonRequiredEnvironments = reasonRequiredEnvironments; + return this; + } + + public PreferencesModel addReasonRequiredEnvironmentsItem(ReasonRequiredEnvironmentModel reasonRequiredEnvironmentsItem) { + if (this.reasonRequiredEnvironments == null) { + this.reasonRequiredEnvironments = new ArrayList<>(); + } + this.reasonRequiredEnvironments.add(reasonRequiredEnvironmentsItem); + return this; + } + + /** + * List of Environments where mandatory note must be set before saving and publishing. + * @return reasonRequiredEnvironments + */ + @javax.annotation.Nullable + public List getReasonRequiredEnvironments() { + return reasonRequiredEnvironments; + } + + public void setReasonRequiredEnvironments(List reasonRequiredEnvironments) { + this.reasonRequiredEnvironments = reasonRequiredEnvironments; + } + + + public PreferencesModel mandatorySettingHint(Boolean mandatorySettingHint) { + this.mandatorySettingHint = mandatorySettingHint; + return this; + } + + /** + * Indicates whether Feature flags and Settings must have a hint. + * @return mandatorySettingHint + */ + @javax.annotation.Nonnull + public Boolean getMandatorySettingHint() { + return mandatorySettingHint; + } + + public void setMandatorySettingHint(Boolean mandatorySettingHint) { + this.mandatorySettingHint = mandatorySettingHint; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PreferencesModel instance itself + */ + public PreferencesModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PreferencesModel preferencesModel = (PreferencesModel) o; + return Objects.equals(this.reasonRequired, preferencesModel.reasonRequired) && + Objects.equals(this.keyGenerationMode, preferencesModel.keyGenerationMode) && + Objects.equals(this.showVariationId, preferencesModel.showVariationId) && + Objects.equals(this.reasonRequiredEnvironments, preferencesModel.reasonRequiredEnvironments) && + Objects.equals(this.mandatorySettingHint, preferencesModel.mandatorySettingHint)&& + Objects.equals(this.additionalProperties, preferencesModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(reasonRequired, keyGenerationMode, showVariationId, reasonRequiredEnvironments, mandatorySettingHint, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PreferencesModel {\n"); + sb.append(" reasonRequired: ").append(toIndentedString(reasonRequired)).append("\n"); + sb.append(" keyGenerationMode: ").append(toIndentedString(keyGenerationMode)).append("\n"); + sb.append(" showVariationId: ").append(toIndentedString(showVariationId)).append("\n"); + sb.append(" reasonRequiredEnvironments: ").append(toIndentedString(reasonRequiredEnvironments)).append("\n"); + sb.append(" mandatorySettingHint: ").append(toIndentedString(mandatorySettingHint)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("reasonRequired"); + openapiFields.add("keyGenerationMode"); + openapiFields.add("showVariationId"); + openapiFields.add("reasonRequiredEnvironments"); + openapiFields.add("mandatorySettingHint"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("reasonRequired"); + openapiRequiredFields.add("keyGenerationMode"); + openapiRequiredFields.add("showVariationId"); + openapiRequiredFields.add("reasonRequiredEnvironments"); + openapiRequiredFields.add("mandatorySettingHint"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PreferencesModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PreferencesModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PreferencesModel is not found in the empty JSON string", PreferencesModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PreferencesModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `keyGenerationMode` + KeyGenerationMode.validateJsonElement(jsonObj.get("keyGenerationMode")); + // ensure the json data is an array + if (!jsonObj.get("reasonRequiredEnvironments").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `reasonRequiredEnvironments` to be an array in the JSON string but got `%s`", jsonObj.get("reasonRequiredEnvironments").toString())); + } + + JsonArray jsonArrayreasonRequiredEnvironments = jsonObj.getAsJsonArray("reasonRequiredEnvironments"); + // validate the required field `reasonRequiredEnvironments` (array) + for (int i = 0; i < jsonArrayreasonRequiredEnvironments.size(); i++) { + ReasonRequiredEnvironmentModel.validateJsonElement(jsonArrayreasonRequiredEnvironments.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PreferencesModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PreferencesModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PreferencesModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PreferencesModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PreferencesModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PreferencesModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PreferencesModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of PreferencesModel + * @throws IOException if the JSON string is invalid with respect to PreferencesModel + */ + public static PreferencesModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PreferencesModel.class); + } + + /** + * Convert an instance of PreferencesModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteComparator.java b/src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteComparator.java new file mode 100644 index 0000000..9c7eaac --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteComparator.java @@ -0,0 +1,78 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Prerequisite flag comparison operator used during the evaluation process. + */ +@JsonAdapter(PrerequisiteComparator.Adapter.class) +public enum PrerequisiteComparator { + + EQUALS("equals"), + + DOES_NOT_EQUAL("doesNotEqual"); + + private String value; + + PrerequisiteComparator(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PrerequisiteComparator fromValue(String value) { + for (PrerequisiteComparator b : PrerequisiteComparator.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PrerequisiteComparator enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PrerequisiteComparator read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PrerequisiteComparator.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PrerequisiteComparator.fromValue(value); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteFlagConditionModel.java b/src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteFlagConditionModel.java new file mode 100644 index 0000000..2bd81fe --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteFlagConditionModel.java @@ -0,0 +1,352 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.PrerequisiteComparator; +import com.configcat.publicapi.java.client.model.ValueModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Describes a condition that is based on a prerequisite flag. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class PrerequisiteFlagConditionModel { + public static final String SERIALIZED_NAME_PREREQUISITE_SETTING_ID = "prerequisiteSettingId"; + @SerializedName(SERIALIZED_NAME_PREREQUISITE_SETTING_ID) + private Integer prerequisiteSettingId; + + public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; + @SerializedName(SERIALIZED_NAME_COMPARATOR) + private PrerequisiteComparator comparator; + + public static final String SERIALIZED_NAME_PREREQUISITE_COMPARISON_VALUE = "prerequisiteComparisonValue"; + @SerializedName(SERIALIZED_NAME_PREREQUISITE_COMPARISON_VALUE) + private ValueModel prerequisiteComparisonValue; + + public PrerequisiteFlagConditionModel() { + } + + public PrerequisiteFlagConditionModel prerequisiteSettingId(Integer prerequisiteSettingId) { + this.prerequisiteSettingId = prerequisiteSettingId; + return this; + } + + /** + * The prerequisite flag's identifier. + * @return prerequisiteSettingId + */ + @javax.annotation.Nonnull + public Integer getPrerequisiteSettingId() { + return prerequisiteSettingId; + } + + public void setPrerequisiteSettingId(Integer prerequisiteSettingId) { + this.prerequisiteSettingId = prerequisiteSettingId; + } + + + public PrerequisiteFlagConditionModel comparator(PrerequisiteComparator comparator) { + this.comparator = comparator; + return this; + } + + /** + * Get comparator + * @return comparator + */ + @javax.annotation.Nonnull + public PrerequisiteComparator getComparator() { + return comparator; + } + + public void setComparator(PrerequisiteComparator comparator) { + this.comparator = comparator; + } + + + public PrerequisiteFlagConditionModel prerequisiteComparisonValue(ValueModel prerequisiteComparisonValue) { + this.prerequisiteComparisonValue = prerequisiteComparisonValue; + return this; + } + + /** + * Get prerequisiteComparisonValue + * @return prerequisiteComparisonValue + */ + @javax.annotation.Nonnull + public ValueModel getPrerequisiteComparisonValue() { + return prerequisiteComparisonValue; + } + + public void setPrerequisiteComparisonValue(ValueModel prerequisiteComparisonValue) { + this.prerequisiteComparisonValue = prerequisiteComparisonValue; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PrerequisiteFlagConditionModel instance itself + */ + public PrerequisiteFlagConditionModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PrerequisiteFlagConditionModel prerequisiteFlagConditionModel = (PrerequisiteFlagConditionModel) o; + return Objects.equals(this.prerequisiteSettingId, prerequisiteFlagConditionModel.prerequisiteSettingId) && + Objects.equals(this.comparator, prerequisiteFlagConditionModel.comparator) && + Objects.equals(this.prerequisiteComparisonValue, prerequisiteFlagConditionModel.prerequisiteComparisonValue)&& + Objects.equals(this.additionalProperties, prerequisiteFlagConditionModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(prerequisiteSettingId, comparator, prerequisiteComparisonValue, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PrerequisiteFlagConditionModel {\n"); + sb.append(" prerequisiteSettingId: ").append(toIndentedString(prerequisiteSettingId)).append("\n"); + sb.append(" comparator: ").append(toIndentedString(comparator)).append("\n"); + sb.append(" prerequisiteComparisonValue: ").append(toIndentedString(prerequisiteComparisonValue)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("prerequisiteSettingId"); + openapiFields.add("comparator"); + openapiFields.add("prerequisiteComparisonValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("prerequisiteSettingId"); + openapiRequiredFields.add("comparator"); + openapiRequiredFields.add("prerequisiteComparisonValue"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PrerequisiteFlagConditionModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PrerequisiteFlagConditionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PrerequisiteFlagConditionModel is not found in the empty JSON string", PrerequisiteFlagConditionModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PrerequisiteFlagConditionModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `comparator` + PrerequisiteComparator.validateJsonElement(jsonObj.get("comparator")); + // validate the required field `prerequisiteComparisonValue` + ValueModel.validateJsonElement(jsonObj.get("prerequisiteComparisonValue")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PrerequisiteFlagConditionModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PrerequisiteFlagConditionModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PrerequisiteFlagConditionModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PrerequisiteFlagConditionModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PrerequisiteFlagConditionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PrerequisiteFlagConditionModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PrerequisiteFlagConditionModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of PrerequisiteFlagConditionModel + * @throws IOException if the JSON string is invalid with respect to PrerequisiteFlagConditionModel + */ + public static PrerequisiteFlagConditionModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PrerequisiteFlagConditionModel.class); + } + + /** + * Convert an instance of PrerequisiteFlagConditionModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ProductModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ProductModel.java new file mode 100644 index 0000000..afeff83 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/ProductModel.java @@ -0,0 +1,440 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.OrganizationModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Details of the Product. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ProductModel { + public static final String SERIALIZED_NAME_ORGANIZATION = "organization"; + @SerializedName(SERIALIZED_NAME_ORGANIZATION) + private OrganizationModel organization; + + public static final String SERIALIZED_NAME_PRODUCT_ID = "productId"; + @SerializedName(SERIALIZED_NAME_PRODUCT_ID) + private UUID productId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_ORDER = "order"; + @SerializedName(SERIALIZED_NAME_ORDER) + private Integer order; + + public static final String SERIALIZED_NAME_REASON_REQUIRED = "reasonRequired"; + @SerializedName(SERIALIZED_NAME_REASON_REQUIRED) + private Boolean reasonRequired; + + public ProductModel() { + } + + public ProductModel organization(OrganizationModel organization) { + this.organization = organization; + return this; + } + + /** + * Get organization + * @return organization + */ + @javax.annotation.Nonnull + public OrganizationModel getOrganization() { + return organization; + } + + public void setOrganization(OrganizationModel organization) { + this.organization = organization; + } + + + public ProductModel productId(UUID productId) { + this.productId = productId; + return this; + } + + /** + * Identifier of the Product. + * @return productId + */ + @javax.annotation.Nonnull + public UUID getProductId() { + return productId; + } + + public void setProductId(UUID productId) { + this.productId = productId; + } + + + public ProductModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Product. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public ProductModel description(String description) { + this.description = description; + return this; + } + + /** + * Description of the Product. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + + public ProductModel order(Integer order) { + this.order = order; + return this; + } + + /** + * The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. + * @return order + */ + @javax.annotation.Nonnull + public Integer getOrder() { + return order; + } + + public void setOrder(Integer order) { + this.order = order; + } + + + public ProductModel reasonRequired(Boolean reasonRequired) { + this.reasonRequired = reasonRequired; + return this; + } + + /** + * Determines whether a mandatory reason must be given every time when the Feature Flags or Settings within a Product are saved. + * @return reasonRequired + */ + @javax.annotation.Nonnull + public Boolean getReasonRequired() { + return reasonRequired; + } + + public void setReasonRequired(Boolean reasonRequired) { + this.reasonRequired = reasonRequired; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProductModel instance itself + */ + public ProductModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductModel productModel = (ProductModel) o; + return Objects.equals(this.organization, productModel.organization) && + Objects.equals(this.productId, productModel.productId) && + Objects.equals(this.name, productModel.name) && + Objects.equals(this.description, productModel.description) && + Objects.equals(this.order, productModel.order) && + Objects.equals(this.reasonRequired, productModel.reasonRequired)&& + Objects.equals(this.additionalProperties, productModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(organization, productId, name, description, order, reasonRequired, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductModel {\n"); + sb.append(" organization: ").append(toIndentedString(organization)).append("\n"); + sb.append(" productId: ").append(toIndentedString(productId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append(" reasonRequired: ").append(toIndentedString(reasonRequired)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("organization"); + openapiFields.add("productId"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("order"); + openapiFields.add("reasonRequired"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("organization"); + openapiRequiredFields.add("productId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("order"); + openapiRequiredFields.add("reasonRequired"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ProductModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProductModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProductModel is not found in the empty JSON string", ProductModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ProductModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `organization` + OrganizationModel.validateJsonElement(jsonObj.get("organization")); + if (!jsonObj.get("productId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `productId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ProductModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProductModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProductModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ProductModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProductModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProductModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProductModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProductModel + * @throws IOException if the JSON string is invalid with respect to ProductModel + */ + public static ProductModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProductModel.class); + } + + /** + * Convert an instance of ProductModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ReasonRequiredEnvironmentModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ReasonRequiredEnvironmentModel.java new file mode 100644 index 0000000..db817cc --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/ReasonRequiredEnvironmentModel.java @@ -0,0 +1,353 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * ReasonRequiredEnvironmentModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ReasonRequiredEnvironmentModel { + public static final String SERIALIZED_NAME_ENVIRONMENT_ID = "environmentId"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) + private UUID environmentId; + + public static final String SERIALIZED_NAME_REASON_REQUIRED = "reasonRequired"; + @SerializedName(SERIALIZED_NAME_REASON_REQUIRED) + private Boolean reasonRequired; + + public static final String SERIALIZED_NAME_ENVIRONMENT_NAME = "environmentName"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT_NAME) + private String environmentName; + + public ReasonRequiredEnvironmentModel() { + } + + public ReasonRequiredEnvironmentModel environmentId(UUID environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Identifier of the Environment. + * @return environmentId + */ + @javax.annotation.Nonnull + public UUID getEnvironmentId() { + return environmentId; + } + + public void setEnvironmentId(UUID environmentId) { + this.environmentId = environmentId; + } + + + public ReasonRequiredEnvironmentModel reasonRequired(Boolean reasonRequired) { + this.reasonRequired = reasonRequired; + return this; + } + + /** + * Indicates that a mandatory note is required in this Environment for saving and publishing. + * @return reasonRequired + */ + @javax.annotation.Nonnull + public Boolean getReasonRequired() { + return reasonRequired; + } + + public void setReasonRequired(Boolean reasonRequired) { + this.reasonRequired = reasonRequired; + } + + + public ReasonRequiredEnvironmentModel environmentName(String environmentName) { + this.environmentName = environmentName; + return this; + } + + /** + * Name of the Environment. + * @return environmentName + */ + @javax.annotation.Nullable + public String getEnvironmentName() { + return environmentName; + } + + public void setEnvironmentName(String environmentName) { + this.environmentName = environmentName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ReasonRequiredEnvironmentModel instance itself + */ + public ReasonRequiredEnvironmentModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReasonRequiredEnvironmentModel reasonRequiredEnvironmentModel = (ReasonRequiredEnvironmentModel) o; + return Objects.equals(this.environmentId, reasonRequiredEnvironmentModel.environmentId) && + Objects.equals(this.reasonRequired, reasonRequiredEnvironmentModel.reasonRequired) && + Objects.equals(this.environmentName, reasonRequiredEnvironmentModel.environmentName)&& + Objects.equals(this.additionalProperties, reasonRequiredEnvironmentModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(environmentId, reasonRequired, environmentName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReasonRequiredEnvironmentModel {\n"); + sb.append(" environmentId: ").append(toIndentedString(environmentId)).append("\n"); + sb.append(" reasonRequired: ").append(toIndentedString(reasonRequired)).append("\n"); + sb.append(" environmentName: ").append(toIndentedString(environmentName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("environmentId"); + openapiFields.add("reasonRequired"); + openapiFields.add("environmentName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("environmentId"); + openapiRequiredFields.add("reasonRequired"); + openapiRequiredFields.add("environmentName"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ReasonRequiredEnvironmentModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReasonRequiredEnvironmentModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ReasonRequiredEnvironmentModel is not found in the empty JSON string", ReasonRequiredEnvironmentModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReasonRequiredEnvironmentModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("environmentId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `environmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentId").toString())); + } + if ((jsonObj.get("environmentName") != null && !jsonObj.get("environmentName").isJsonNull()) && !jsonObj.get("environmentName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `environmentName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReasonRequiredEnvironmentModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReasonRequiredEnvironmentModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReasonRequiredEnvironmentModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReasonRequiredEnvironmentModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ReasonRequiredEnvironmentModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReasonRequiredEnvironmentModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReasonRequiredEnvironmentModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReasonRequiredEnvironmentModel + * @throws IOException if the JSON string is invalid with respect to ReasonRequiredEnvironmentModel + */ + public static ReasonRequiredEnvironmentModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReasonRequiredEnvironmentModel.class); + } + + /** + * Convert an instance of ReasonRequiredEnvironmentModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLineModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLineModel.java new file mode 100644 index 0000000..2fbbd64 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLineModel.java @@ -0,0 +1,322 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Determines a code reference line. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ReferenceLineModel { + public static final String SERIALIZED_NAME_LINE_TEXT = "lineText"; + @SerializedName(SERIALIZED_NAME_LINE_TEXT) + private String lineText; + + public static final String SERIALIZED_NAME_LINE_NUMBER = "lineNumber"; + @SerializedName(SERIALIZED_NAME_LINE_NUMBER) + private Integer lineNumber; + + public ReferenceLineModel() { + } + + public ReferenceLineModel lineText(String lineText) { + this.lineText = lineText; + return this; + } + + /** + * The content of the reference line. + * @return lineText + */ + @javax.annotation.Nullable + public String getLineText() { + return lineText; + } + + public void setLineText(String lineText) { + this.lineText = lineText; + } + + + public ReferenceLineModel lineNumber(Integer lineNumber) { + this.lineNumber = lineNumber; + return this; + } + + /** + * The line number. + * @return lineNumber + */ + @javax.annotation.Nonnull + public Integer getLineNumber() { + return lineNumber; + } + + public void setLineNumber(Integer lineNumber) { + this.lineNumber = lineNumber; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ReferenceLineModel instance itself + */ + public ReferenceLineModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReferenceLineModel referenceLineModel = (ReferenceLineModel) o; + return Objects.equals(this.lineText, referenceLineModel.lineText) && + Objects.equals(this.lineNumber, referenceLineModel.lineNumber)&& + Objects.equals(this.additionalProperties, referenceLineModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(lineText, lineNumber, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReferenceLineModel {\n"); + sb.append(" lineText: ").append(toIndentedString(lineText)).append("\n"); + sb.append(" lineNumber: ").append(toIndentedString(lineNumber)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("lineText"); + openapiFields.add("lineNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("lineText"); + openapiRequiredFields.add("lineNumber"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ReferenceLineModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReferenceLineModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ReferenceLineModel is not found in the empty JSON string", ReferenceLineModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReferenceLineModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("lineText") != null && !jsonObj.get("lineText").isJsonNull()) && !jsonObj.get("lineText").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lineText` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lineText").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReferenceLineModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReferenceLineModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReferenceLineModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReferenceLineModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ReferenceLineModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReferenceLineModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReferenceLineModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReferenceLineModel + * @throws IOException if the JSON string is invalid with respect to ReferenceLineModel + */ + public static ReferenceLineModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReferenceLineModel.class); + } + + /** + * Convert an instance of ReferenceLineModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLineRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLineRequest.java new file mode 100644 index 0000000..243bec2 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLineRequest.java @@ -0,0 +1,333 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Determines a code reference line. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ReferenceLineRequest { + public static final String SERIALIZED_NAME_LINE_TEXT = "lineText"; + @SerializedName(SERIALIZED_NAME_LINE_TEXT) + private String lineText; + + public static final String SERIALIZED_NAME_LINE_NUMBER = "lineNumber"; + @SerializedName(SERIALIZED_NAME_LINE_NUMBER) + private Integer lineNumber; + + public ReferenceLineRequest() { + } + + public ReferenceLineRequest lineText(String lineText) { + this.lineText = lineText; + return this; + } + + /** + * The content of the reference line. + * @return lineText + */ + @javax.annotation.Nullable + public String getLineText() { + return lineText; + } + + public void setLineText(String lineText) { + this.lineText = lineText; + } + + + public ReferenceLineRequest lineNumber(Integer lineNumber) { + this.lineNumber = lineNumber; + return this; + } + + /** + * The line number. + * @return lineNumber + */ + @javax.annotation.Nonnull + public Integer getLineNumber() { + return lineNumber; + } + + public void setLineNumber(Integer lineNumber) { + this.lineNumber = lineNumber; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ReferenceLineRequest instance itself + */ + public ReferenceLineRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReferenceLineRequest referenceLineRequest = (ReferenceLineRequest) o; + return Objects.equals(this.lineText, referenceLineRequest.lineText) && + Objects.equals(this.lineNumber, referenceLineRequest.lineNumber)&& + Objects.equals(this.additionalProperties, referenceLineRequest.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(lineText, lineNumber, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReferenceLineRequest {\n"); + sb.append(" lineText: ").append(toIndentedString(lineText)).append("\n"); + sb.append(" lineNumber: ").append(toIndentedString(lineNumber)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("lineText"); + openapiFields.add("lineNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("lineNumber"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ReferenceLineRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReferenceLineRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ReferenceLineRequest is not found in the empty JSON string", ReferenceLineRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReferenceLineRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("lineText") != null && !jsonObj.get("lineText").isJsonNull()) && !jsonObj.get("lineText").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lineText` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lineText").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReferenceLineRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReferenceLineRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReferenceLineRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReferenceLineRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ReferenceLineRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReferenceLineRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReferenceLineRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReferenceLineRequest + * @throws IOException if the JSON string is invalid with respect to ReferenceLineRequest + */ + public static ReferenceLineRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReferenceLineRequest.class); + } + + /** + * Convert an instance of ReferenceLineRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLinesModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLinesModel.java new file mode 100644 index 0000000..bc282b4 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLinesModel.java @@ -0,0 +1,447 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.ReferenceLineModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * ReferenceLinesModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ReferenceLinesModel { + public static final String SERIALIZED_NAME_FILE = "file"; + @SerializedName(SERIALIZED_NAME_FILE) + private String _file; + + public static final String SERIALIZED_NAME_FILE_URL = "fileUrl"; + @SerializedName(SERIALIZED_NAME_FILE_URL) + private String fileUrl; + + public static final String SERIALIZED_NAME_PRE_LINES = "preLines"; + @SerializedName(SERIALIZED_NAME_PRE_LINES) + private List preLines = new ArrayList<>(); + + public static final String SERIALIZED_NAME_POST_LINES = "postLines"; + @SerializedName(SERIALIZED_NAME_POST_LINES) + private List postLines = new ArrayList<>(); + + public static final String SERIALIZED_NAME_REFERENCE_LINE = "referenceLine"; + @SerializedName(SERIALIZED_NAME_REFERENCE_LINE) + private ReferenceLineModel referenceLine; + + public ReferenceLinesModel() { + } + + public ReferenceLinesModel _file(String _file) { + this._file = _file; + return this; + } + + /** + * The file's name in where the code reference has been found. (Appears on the ConfigCat Dashboard) + * @return _file + */ + @javax.annotation.Nonnull + public String getFile() { + return _file; + } + + public void setFile(String _file) { + this._file = _file; + } + + + public ReferenceLinesModel fileUrl(String fileUrl) { + this.fileUrl = fileUrl; + return this; + } + + /** + * The file's url. (Used to point to the file on the repository's website) + * @return fileUrl + */ + @javax.annotation.Nullable + public String getFileUrl() { + return fileUrl; + } + + public void setFileUrl(String fileUrl) { + this.fileUrl = fileUrl; + } + + + public ReferenceLinesModel preLines(List preLines) { + this.preLines = preLines; + return this; + } + + public ReferenceLinesModel addPreLinesItem(ReferenceLineModel preLinesItem) { + if (this.preLines == null) { + this.preLines = new ArrayList<>(); + } + this.preLines.add(preLinesItem); + return this; + } + + /** + * The lines before the actual reference line. + * @return preLines + */ + @javax.annotation.Nonnull + public List getPreLines() { + return preLines; + } + + public void setPreLines(List preLines) { + this.preLines = preLines; + } + + + public ReferenceLinesModel postLines(List postLines) { + this.postLines = postLines; + return this; + } + + public ReferenceLinesModel addPostLinesItem(ReferenceLineModel postLinesItem) { + if (this.postLines == null) { + this.postLines = new ArrayList<>(); + } + this.postLines.add(postLinesItem); + return this; + } + + /** + * The lines after the actual reference line. + * @return postLines + */ + @javax.annotation.Nonnull + public List getPostLines() { + return postLines; + } + + public void setPostLines(List postLines) { + this.postLines = postLines; + } + + + public ReferenceLinesModel referenceLine(ReferenceLineModel referenceLine) { + this.referenceLine = referenceLine; + return this; + } + + /** + * Get referenceLine + * @return referenceLine + */ + @javax.annotation.Nonnull + public ReferenceLineModel getReferenceLine() { + return referenceLine; + } + + public void setReferenceLine(ReferenceLineModel referenceLine) { + this.referenceLine = referenceLine; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ReferenceLinesModel instance itself + */ + public ReferenceLinesModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReferenceLinesModel referenceLinesModel = (ReferenceLinesModel) o; + return Objects.equals(this._file, referenceLinesModel._file) && + Objects.equals(this.fileUrl, referenceLinesModel.fileUrl) && + Objects.equals(this.preLines, referenceLinesModel.preLines) && + Objects.equals(this.postLines, referenceLinesModel.postLines) && + Objects.equals(this.referenceLine, referenceLinesModel.referenceLine)&& + Objects.equals(this.additionalProperties, referenceLinesModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(_file, fileUrl, preLines, postLines, referenceLine, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReferenceLinesModel {\n"); + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append(" fileUrl: ").append(toIndentedString(fileUrl)).append("\n"); + sb.append(" preLines: ").append(toIndentedString(preLines)).append("\n"); + sb.append(" postLines: ").append(toIndentedString(postLines)).append("\n"); + sb.append(" referenceLine: ").append(toIndentedString(referenceLine)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("file"); + openapiFields.add("fileUrl"); + openapiFields.add("preLines"); + openapiFields.add("postLines"); + openapiFields.add("referenceLine"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("file"); + openapiRequiredFields.add("fileUrl"); + openapiRequiredFields.add("preLines"); + openapiRequiredFields.add("postLines"); + openapiRequiredFields.add("referenceLine"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ReferenceLinesModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReferenceLinesModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ReferenceLinesModel is not found in the empty JSON string", ReferenceLinesModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReferenceLinesModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("file").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `file` to be a primitive type in the JSON string but got `%s`", jsonObj.get("file").toString())); + } + if ((jsonObj.get("fileUrl") != null && !jsonObj.get("fileUrl").isJsonNull()) && !jsonObj.get("fileUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fileUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fileUrl").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("preLines").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `preLines` to be an array in the JSON string but got `%s`", jsonObj.get("preLines").toString())); + } + + JsonArray jsonArraypreLines = jsonObj.getAsJsonArray("preLines"); + // validate the required field `preLines` (array) + for (int i = 0; i < jsonArraypreLines.size(); i++) { + ReferenceLineModel.validateJsonElement(jsonArraypreLines.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("postLines").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `postLines` to be an array in the JSON string but got `%s`", jsonObj.get("postLines").toString())); + } + + JsonArray jsonArraypostLines = jsonObj.getAsJsonArray("postLines"); + // validate the required field `postLines` (array) + for (int i = 0; i < jsonArraypostLines.size(); i++) { + ReferenceLineModel.validateJsonElement(jsonArraypostLines.get(i)); + }; + // validate the required field `referenceLine` + ReferenceLineModel.validateJsonElement(jsonObj.get("referenceLine")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReferenceLinesModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReferenceLinesModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReferenceLinesModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReferenceLinesModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ReferenceLinesModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReferenceLinesModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReferenceLinesModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReferenceLinesModel + * @throws IOException if the JSON string is invalid with respect to ReferenceLinesModel + */ + public static ReferenceLinesModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReferenceLinesModel.class); + } + + /** + * Convert an instance of ReferenceLinesModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLinesRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLinesRequest.java new file mode 100644 index 0000000..a92450e --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLinesRequest.java @@ -0,0 +1,464 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.ReferenceLineRequest; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * ReferenceLinesRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ReferenceLinesRequest { + public static final String SERIALIZED_NAME_FILE = "file"; + @SerializedName(SERIALIZED_NAME_FILE) + private String _file; + + public static final String SERIALIZED_NAME_FILE_URL = "fileUrl"; + @SerializedName(SERIALIZED_NAME_FILE_URL) + private String fileUrl; + + public static final String SERIALIZED_NAME_PRE_LINES = "preLines"; + @SerializedName(SERIALIZED_NAME_PRE_LINES) + private List preLines = new ArrayList<>(); + + public static final String SERIALIZED_NAME_POST_LINES = "postLines"; + @SerializedName(SERIALIZED_NAME_POST_LINES) + private List postLines = new ArrayList<>(); + + public static final String SERIALIZED_NAME_REFERENCE_LINE = "referenceLine"; + @SerializedName(SERIALIZED_NAME_REFERENCE_LINE) + private ReferenceLineRequest referenceLine; + + public ReferenceLinesRequest() { + } + + public ReferenceLinesRequest _file(String _file) { + this._file = _file; + return this; + } + + /** + * The file's name in where the code reference has been found. (Appears on the ConfigCat Dashboard) + * @return _file + */ + @javax.annotation.Nonnull + public String getFile() { + return _file; + } + + public void setFile(String _file) { + this._file = _file; + } + + + public ReferenceLinesRequest fileUrl(String fileUrl) { + this.fileUrl = fileUrl; + return this; + } + + /** + * The file's url. (Used to point to the file on the repository's website) + * @return fileUrl + */ + @javax.annotation.Nullable + public String getFileUrl() { + return fileUrl; + } + + public void setFileUrl(String fileUrl) { + this.fileUrl = fileUrl; + } + + + public ReferenceLinesRequest preLines(List preLines) { + this.preLines = preLines; + return this; + } + + public ReferenceLinesRequest addPreLinesItem(ReferenceLineRequest preLinesItem) { + if (this.preLines == null) { + this.preLines = new ArrayList<>(); + } + this.preLines.add(preLinesItem); + return this; + } + + /** + * The lines before the actual reference line. + * @return preLines + */ + @javax.annotation.Nullable + public List getPreLines() { + return preLines; + } + + public void setPreLines(List preLines) { + this.preLines = preLines; + } + + + public ReferenceLinesRequest postLines(List postLines) { + this.postLines = postLines; + return this; + } + + public ReferenceLinesRequest addPostLinesItem(ReferenceLineRequest postLinesItem) { + if (this.postLines == null) { + this.postLines = new ArrayList<>(); + } + this.postLines.add(postLinesItem); + return this; + } + + /** + * The lines after the actual reference line. + * @return postLines + */ + @javax.annotation.Nullable + public List getPostLines() { + return postLines; + } + + public void setPostLines(List postLines) { + this.postLines = postLines; + } + + + public ReferenceLinesRequest referenceLine(ReferenceLineRequest referenceLine) { + this.referenceLine = referenceLine; + return this; + } + + /** + * Get referenceLine + * @return referenceLine + */ + @javax.annotation.Nonnull + public ReferenceLineRequest getReferenceLine() { + return referenceLine; + } + + public void setReferenceLine(ReferenceLineRequest referenceLine) { + this.referenceLine = referenceLine; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ReferenceLinesRequest instance itself + */ + public ReferenceLinesRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReferenceLinesRequest referenceLinesRequest = (ReferenceLinesRequest) o; + return Objects.equals(this._file, referenceLinesRequest._file) && + Objects.equals(this.fileUrl, referenceLinesRequest.fileUrl) && + Objects.equals(this.preLines, referenceLinesRequest.preLines) && + Objects.equals(this.postLines, referenceLinesRequest.postLines) && + Objects.equals(this.referenceLine, referenceLinesRequest.referenceLine)&& + Objects.equals(this.additionalProperties, referenceLinesRequest.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(_file, fileUrl, preLines, postLines, referenceLine, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReferenceLinesRequest {\n"); + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append(" fileUrl: ").append(toIndentedString(fileUrl)).append("\n"); + sb.append(" preLines: ").append(toIndentedString(preLines)).append("\n"); + sb.append(" postLines: ").append(toIndentedString(postLines)).append("\n"); + sb.append(" referenceLine: ").append(toIndentedString(referenceLine)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("file"); + openapiFields.add("fileUrl"); + openapiFields.add("preLines"); + openapiFields.add("postLines"); + openapiFields.add("referenceLine"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("file"); + openapiRequiredFields.add("referenceLine"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ReferenceLinesRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReferenceLinesRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ReferenceLinesRequest is not found in the empty JSON string", ReferenceLinesRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReferenceLinesRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("file").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `file` to be a primitive type in the JSON string but got `%s`", jsonObj.get("file").toString())); + } + if ((jsonObj.get("fileUrl") != null && !jsonObj.get("fileUrl").isJsonNull()) && !jsonObj.get("fileUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fileUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fileUrl").toString())); + } + if (jsonObj.get("preLines") != null && !jsonObj.get("preLines").isJsonNull()) { + JsonArray jsonArraypreLines = jsonObj.getAsJsonArray("preLines"); + if (jsonArraypreLines != null) { + // ensure the json data is an array + if (!jsonObj.get("preLines").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `preLines` to be an array in the JSON string but got `%s`", jsonObj.get("preLines").toString())); + } + + // validate the optional field `preLines` (array) + for (int i = 0; i < jsonArraypreLines.size(); i++) { + ReferenceLineRequest.validateJsonElement(jsonArraypreLines.get(i)); + }; + } + } + if (jsonObj.get("postLines") != null && !jsonObj.get("postLines").isJsonNull()) { + JsonArray jsonArraypostLines = jsonObj.getAsJsonArray("postLines"); + if (jsonArraypostLines != null) { + // ensure the json data is an array + if (!jsonObj.get("postLines").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `postLines` to be an array in the JSON string but got `%s`", jsonObj.get("postLines").toString())); + } + + // validate the optional field `postLines` (array) + for (int i = 0; i < jsonArraypostLines.size(); i++) { + ReferenceLineRequest.validateJsonElement(jsonArraypostLines.get(i)); + }; + } + } + // validate the required field `referenceLine` + ReferenceLineRequest.validateJsonElement(jsonObj.get("referenceLine")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReferenceLinesRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReferenceLinesRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReferenceLinesRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReferenceLinesRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ReferenceLinesRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReferenceLinesRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReferenceLinesRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReferenceLinesRequest + * @throws IOException if the JSON string is invalid with respect to ReferenceLinesRequest + */ + public static ReferenceLinesRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReferenceLinesRequest.class); + } + + /** + * Convert an instance of ReferenceLinesRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ReplaceSettingModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ReplaceSettingModel.java new file mode 100644 index 0000000..1ce949d --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/ReplaceSettingModel.java @@ -0,0 +1,394 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * ReplaceSettingModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ReplaceSettingModel { + public static final String SERIALIZED_NAME_HINT = "hint"; + @SerializedName(SERIALIZED_NAME_HINT) + private String hint; + + public static final String SERIALIZED_NAME_TAGS = "tags"; + @SerializedName(SERIALIZED_NAME_TAGS) + private List tags; + + public static final String SERIALIZED_NAME_ORDER = "order"; + @SerializedName(SERIALIZED_NAME_ORDER) + private Integer order; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public ReplaceSettingModel() { + } + + public ReplaceSettingModel hint(String hint) { + this.hint = hint; + return this; + } + + /** + * A short description for the setting, shown on the Dashboard UI. + * @return hint + */ + @javax.annotation.Nullable + public String getHint() { + return hint; + } + + public void setHint(String hint) { + this.hint = hint; + } + + + public ReplaceSettingModel tags(List tags) { + this.tags = tags; + return this; + } + + public ReplaceSettingModel addTagsItem(Long tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * The IDs of the tags which are attached to the setting. + * @return tags + */ + @javax.annotation.Nullable + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + + public ReplaceSettingModel order(Integer order) { + this.order = order; + return this; + } + + /** + * The order of the Setting represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. + * @return order + */ + @javax.annotation.Nullable + public Integer getOrder() { + return order; + } + + public void setOrder(Integer order) { + this.order = order; + } + + + public ReplaceSettingModel name(String name) { + this.name = name; + return this; + } + + /** + * The name of the Feature Flag or Setting. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ReplaceSettingModel instance itself + */ + public ReplaceSettingModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReplaceSettingModel replaceSettingModel = (ReplaceSettingModel) o; + return Objects.equals(this.hint, replaceSettingModel.hint) && + Objects.equals(this.tags, replaceSettingModel.tags) && + Objects.equals(this.order, replaceSettingModel.order) && + Objects.equals(this.name, replaceSettingModel.name)&& + Objects.equals(this.additionalProperties, replaceSettingModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hint, tags, order, name, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReplaceSettingModel {\n"); + sb.append(" hint: ").append(toIndentedString(hint)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("hint"); + openapiFields.add("tags"); + openapiFields.add("order"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ReplaceSettingModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReplaceSettingModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ReplaceSettingModel is not found in the empty JSON string", ReplaceSettingModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("hint") != null && !jsonObj.get("hint").isJsonNull()) && !jsonObj.get("hint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hint").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull() && !jsonObj.get("tags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReplaceSettingModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReplaceSettingModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReplaceSettingModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReplaceSettingModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ReplaceSettingModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReplaceSettingModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReplaceSettingModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReplaceSettingModel + * @throws IOException if the JSON string is invalid with respect to ReplaceSettingModel + */ + public static ReplaceSettingModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReplaceSettingModel.class); + } + + /** + * Convert an instance of ReplaceSettingModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/RolloutPercentageItemModel.java b/src/main/java/com/configcat/publicapi/java/client/model/RolloutPercentageItemModel.java new file mode 100644 index 0000000..bce1308 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/RolloutPercentageItemModel.java @@ -0,0 +1,322 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.SettingValueType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * RolloutPercentageItemModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class RolloutPercentageItemModel { + public static final String SERIALIZED_NAME_PERCENTAGE = "percentage"; + @SerializedName(SERIALIZED_NAME_PERCENTAGE) + private Long percentage; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private SettingValueType value; + + public RolloutPercentageItemModel() { + } + + public RolloutPercentageItemModel percentage(Long percentage) { + this.percentage = percentage; + return this; + } + + /** + * The percentage value for the rule. + * @return percentage + */ + @javax.annotation.Nonnull + public Long getPercentage() { + return percentage; + } + + public void setPercentage(Long percentage) { + this.percentage = percentage; + } + + + public RolloutPercentageItemModel value(SettingValueType value) { + this.value = value; + return this; + } + + /** + * The value to serve when the user falls in the percentage rule. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. + * @return value + */ + @javax.annotation.Nonnull + public SettingValueType getValue() { + return value; + } + + public void setValue(SettingValueType value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RolloutPercentageItemModel instance itself + */ + public RolloutPercentageItemModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RolloutPercentageItemModel rolloutPercentageItemModel = (RolloutPercentageItemModel) o; + return Objects.equals(this.percentage, rolloutPercentageItemModel.percentage) && + Objects.equals(this.value, rolloutPercentageItemModel.value)&& + Objects.equals(this.additionalProperties, rolloutPercentageItemModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(percentage, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RolloutPercentageItemModel {\n"); + sb.append(" percentage: ").append(toIndentedString(percentage)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("percentage"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("percentage"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RolloutPercentageItemModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RolloutPercentageItemModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RolloutPercentageItemModel is not found in the empty JSON string", RolloutPercentageItemModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RolloutPercentageItemModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `value` + SettingValueType.validateJsonElement(jsonObj.get("value")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RolloutPercentageItemModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RolloutPercentageItemModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RolloutPercentageItemModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RolloutPercentageItemModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RolloutPercentageItemModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RolloutPercentageItemModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RolloutPercentageItemModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of RolloutPercentageItemModel + * @throws IOException if the JSON string is invalid with respect to RolloutPercentageItemModel + */ + public static RolloutPercentageItemModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RolloutPercentageItemModel.class); + } + + /** + * Convert an instance of RolloutPercentageItemModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/RolloutRuleComparator.java b/src/main/java/com/configcat/publicapi/java/client/model/RolloutRuleComparator.java new file mode 100644 index 0000000..b7fbb7c --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/RolloutRuleComparator.java @@ -0,0 +1,110 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * The comparison operator the evaluation process must use when it compares the given user attribute's value with the comparison value. + */ +@JsonAdapter(RolloutRuleComparator.Adapter.class) +public enum RolloutRuleComparator { + + IS_ONE_OF("isOneOf"), + + IS_NOT_ONE_OF("isNotOneOf"), + + CONTAINS("contains"), + + DOES_NOT_CONTAIN("doesNotContain"), + + SEM_VER_IS_ONE_OF("semVerIsOneOf"), + + SEM_VER_IS_NOT_ONE_OF("semVerIsNotOneOf"), + + SEM_VER_LESS("semVerLess"), + + SEM_VER_LESS_OR_EQUALS("semVerLessOrEquals"), + + SEM_VER_GREATER("semVerGreater"), + + SEM_VER_GREATER_OR_EQUALS("semVerGreaterOrEquals"), + + NUMBER_EQUALS("numberEquals"), + + NUMBER_DOES_NOT_EQUAL("numberDoesNotEqual"), + + NUMBER_LESS("numberLess"), + + NUMBER_LESS_OR_EQUALS("numberLessOrEquals"), + + NUMBER_GREATER("numberGreater"), + + NUMBER_GREATER_OR_EQUALS("numberGreaterOrEquals"), + + SENSITIVE_IS_ONE_OF("sensitiveIsOneOf"), + + SENSITIVE_IS_NOT_ONE_OF("sensitiveIsNotOneOf"); + + private String value; + + RolloutRuleComparator(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RolloutRuleComparator fromValue(String value) { + for (RolloutRuleComparator b : RolloutRuleComparator.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RolloutRuleComparator enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RolloutRuleComparator read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RolloutRuleComparator.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + RolloutRuleComparator.fromValue(value); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/RolloutRuleModel.java b/src/main/java/com/configcat/publicapi/java/client/model/RolloutRuleModel.java new file mode 100644 index 0000000..fa42676 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/RolloutRuleModel.java @@ -0,0 +1,446 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.RolloutRuleComparator; +import com.configcat.publicapi.java.client.model.SegmentComparator; +import com.configcat.publicapi.java.client.model.SettingValueType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * RolloutRuleModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class RolloutRuleModel { + public static final String SERIALIZED_NAME_COMPARISON_ATTRIBUTE = "comparisonAttribute"; + @SerializedName(SERIALIZED_NAME_COMPARISON_ATTRIBUTE) + private String comparisonAttribute; + + public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; + @SerializedName(SERIALIZED_NAME_COMPARATOR) + private RolloutRuleComparator comparator; + + public static final String SERIALIZED_NAME_COMPARISON_VALUE = "comparisonValue"; + @SerializedName(SERIALIZED_NAME_COMPARISON_VALUE) + private String comparisonValue; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private SettingValueType value; + + public static final String SERIALIZED_NAME_SEGMENT_COMPARATOR = "segmentComparator"; + @SerializedName(SERIALIZED_NAME_SEGMENT_COMPARATOR) + private SegmentComparator segmentComparator; + + public static final String SERIALIZED_NAME_SEGMENT_ID = "segmentId"; + @SerializedName(SERIALIZED_NAME_SEGMENT_ID) + private UUID segmentId; + + public RolloutRuleModel() { + } + + public RolloutRuleModel comparisonAttribute(String comparisonAttribute) { + this.comparisonAttribute = comparisonAttribute; + return this; + } + + /** + * The user attribute to compare. + * @return comparisonAttribute + */ + @javax.annotation.Nullable + public String getComparisonAttribute() { + return comparisonAttribute; + } + + public void setComparisonAttribute(String comparisonAttribute) { + this.comparisonAttribute = comparisonAttribute; + } + + + public RolloutRuleModel comparator(RolloutRuleComparator comparator) { + this.comparator = comparator; + return this; + } + + /** + * Get comparator + * @return comparator + */ + @javax.annotation.Nullable + public RolloutRuleComparator getComparator() { + return comparator; + } + + public void setComparator(RolloutRuleComparator comparator) { + this.comparator = comparator; + } + + + public RolloutRuleModel comparisonValue(String comparisonValue) { + this.comparisonValue = comparisonValue; + return this; + } + + /** + * The value to compare against. + * @return comparisonValue + */ + @javax.annotation.Nullable + public String getComparisonValue() { + return comparisonValue; + } + + public void setComparisonValue(String comparisonValue) { + this.comparisonValue = comparisonValue; + } + + + public RolloutRuleModel value(SettingValueType value) { + this.value = value; + return this; + } + + /** + * The value to serve when the comparison matches. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. + * @return value + */ + @javax.annotation.Nonnull + public SettingValueType getValue() { + return value; + } + + public void setValue(SettingValueType value) { + this.value = value; + } + + + public RolloutRuleModel segmentComparator(SegmentComparator segmentComparator) { + this.segmentComparator = segmentComparator; + return this; + } + + /** + * Get segmentComparator + * @return segmentComparator + */ + @javax.annotation.Nullable + public SegmentComparator getSegmentComparator() { + return segmentComparator; + } + + public void setSegmentComparator(SegmentComparator segmentComparator) { + this.segmentComparator = segmentComparator; + } + + + public RolloutRuleModel segmentId(UUID segmentId) { + this.segmentId = segmentId; + return this; + } + + /** + * The segment to compare against. + * @return segmentId + */ + @javax.annotation.Nullable + public UUID getSegmentId() { + return segmentId; + } + + public void setSegmentId(UUID segmentId) { + this.segmentId = segmentId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RolloutRuleModel instance itself + */ + public RolloutRuleModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RolloutRuleModel rolloutRuleModel = (RolloutRuleModel) o; + return Objects.equals(this.comparisonAttribute, rolloutRuleModel.comparisonAttribute) && + Objects.equals(this.comparator, rolloutRuleModel.comparator) && + Objects.equals(this.comparisonValue, rolloutRuleModel.comparisonValue) && + Objects.equals(this.value, rolloutRuleModel.value) && + Objects.equals(this.segmentComparator, rolloutRuleModel.segmentComparator) && + Objects.equals(this.segmentId, rolloutRuleModel.segmentId)&& + Objects.equals(this.additionalProperties, rolloutRuleModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(comparisonAttribute, comparator, comparisonValue, value, segmentComparator, segmentId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RolloutRuleModel {\n"); + sb.append(" comparisonAttribute: ").append(toIndentedString(comparisonAttribute)).append("\n"); + sb.append(" comparator: ").append(toIndentedString(comparator)).append("\n"); + sb.append(" comparisonValue: ").append(toIndentedString(comparisonValue)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" segmentComparator: ").append(toIndentedString(segmentComparator)).append("\n"); + sb.append(" segmentId: ").append(toIndentedString(segmentId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("comparisonAttribute"); + openapiFields.add("comparator"); + openapiFields.add("comparisonValue"); + openapiFields.add("value"); + openapiFields.add("segmentComparator"); + openapiFields.add("segmentId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("comparisonAttribute"); + openapiRequiredFields.add("comparator"); + openapiRequiredFields.add("comparisonValue"); + openapiRequiredFields.add("value"); + openapiRequiredFields.add("segmentComparator"); + openapiRequiredFields.add("segmentId"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RolloutRuleModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RolloutRuleModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RolloutRuleModel is not found in the empty JSON string", RolloutRuleModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RolloutRuleModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("comparisonAttribute") != null && !jsonObj.get("comparisonAttribute").isJsonNull()) && !jsonObj.get("comparisonAttribute").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `comparisonAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonAttribute").toString())); + } + // validate the required field `comparator` + RolloutRuleComparator.validateJsonElement(jsonObj.get("comparator")); + if ((jsonObj.get("comparisonValue") != null && !jsonObj.get("comparisonValue").isJsonNull()) && !jsonObj.get("comparisonValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `comparisonValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonValue").toString())); + } + // validate the required field `value` + SettingValueType.validateJsonElement(jsonObj.get("value")); + // validate the required field `segmentComparator` + SegmentComparator.validateJsonElement(jsonObj.get("segmentComparator")); + if ((jsonObj.get("segmentId") != null && !jsonObj.get("segmentId").isJsonNull()) && !jsonObj.get("segmentId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `segmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("segmentId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RolloutRuleModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RolloutRuleModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RolloutRuleModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RolloutRuleModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RolloutRuleModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RolloutRuleModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RolloutRuleModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of RolloutRuleModel + * @throws IOException if the JSON string is invalid with respect to RolloutRuleModel + */ + public static RolloutRuleModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RolloutRuleModel.class); + } + + /** + * Convert an instance of RolloutRuleModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SdkKeysModel.java b/src/main/java/com/configcat/publicapi/java/client/model/SdkKeysModel.java new file mode 100644 index 0000000..4f367bc --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/SdkKeysModel.java @@ -0,0 +1,325 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * SdkKeysModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class SdkKeysModel { + public static final String SERIALIZED_NAME_PRIMARY = "primary"; + @SerializedName(SERIALIZED_NAME_PRIMARY) + private String primary; + + public static final String SERIALIZED_NAME_SECONDARY = "secondary"; + @SerializedName(SERIALIZED_NAME_SECONDARY) + private String secondary; + + public SdkKeysModel() { + } + + public SdkKeysModel primary(String primary) { + this.primary = primary; + return this; + } + + /** + * The primary SDK key. + * @return primary + */ + @javax.annotation.Nonnull + public String getPrimary() { + return primary; + } + + public void setPrimary(String primary) { + this.primary = primary; + } + + + public SdkKeysModel secondary(String secondary) { + this.secondary = secondary; + return this; + } + + /** + * The secondary SDK key. + * @return secondary + */ + @javax.annotation.Nullable + public String getSecondary() { + return secondary; + } + + public void setSecondary(String secondary) { + this.secondary = secondary; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SdkKeysModel instance itself + */ + public SdkKeysModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SdkKeysModel sdkKeysModel = (SdkKeysModel) o; + return Objects.equals(this.primary, sdkKeysModel.primary) && + Objects.equals(this.secondary, sdkKeysModel.secondary)&& + Objects.equals(this.additionalProperties, sdkKeysModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(primary, secondary, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SdkKeysModel {\n"); + sb.append(" primary: ").append(toIndentedString(primary)).append("\n"); + sb.append(" secondary: ").append(toIndentedString(secondary)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("primary"); + openapiFields.add("secondary"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("primary"); + openapiRequiredFields.add("secondary"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SdkKeysModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SdkKeysModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SdkKeysModel is not found in the empty JSON string", SdkKeysModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SdkKeysModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("primary").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `primary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("primary").toString())); + } + if ((jsonObj.get("secondary") != null && !jsonObj.get("secondary").isJsonNull()) && !jsonObj.get("secondary").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secondary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secondary").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SdkKeysModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SdkKeysModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SdkKeysModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SdkKeysModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SdkKeysModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SdkKeysModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SdkKeysModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of SdkKeysModel + * @throws IOException if the JSON string is invalid with respect to SdkKeysModel + */ + public static SdkKeysModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SdkKeysModel.class); + } + + /** + * Convert an instance of SdkKeysModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SegmentComparator.java b/src/main/java/com/configcat/publicapi/java/client/model/SegmentComparator.java new file mode 100644 index 0000000..23e3626 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/SegmentComparator.java @@ -0,0 +1,78 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * The segment comparison operator used during the evaluation process. + */ +@JsonAdapter(SegmentComparator.Adapter.class) +public enum SegmentComparator { + + IS_IN("isIn"), + + IS_NOT_IN("isNotIn"); + + private String value; + + SegmentComparator(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SegmentComparator fromValue(String value) { + for (SegmentComparator b : SegmentComparator.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SegmentComparator enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SegmentComparator read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SegmentComparator.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SegmentComparator.fromValue(value); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SegmentConditionModel.java b/src/main/java/com/configcat/publicapi/java/client/model/SegmentConditionModel.java new file mode 100644 index 0000000..a83f868 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/SegmentConditionModel.java @@ -0,0 +1,326 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.SegmentComparator; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Describes a condition that is based on a segment. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class SegmentConditionModel { + public static final String SERIALIZED_NAME_SEGMENT_ID = "segmentId"; + @SerializedName(SERIALIZED_NAME_SEGMENT_ID) + private UUID segmentId; + + public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; + @SerializedName(SERIALIZED_NAME_COMPARATOR) + private SegmentComparator comparator; + + public SegmentConditionModel() { + } + + public SegmentConditionModel segmentId(UUID segmentId) { + this.segmentId = segmentId; + return this; + } + + /** + * The segment's identifier. + * @return segmentId + */ + @javax.annotation.Nonnull + public UUID getSegmentId() { + return segmentId; + } + + public void setSegmentId(UUID segmentId) { + this.segmentId = segmentId; + } + + + public SegmentConditionModel comparator(SegmentComparator comparator) { + this.comparator = comparator; + return this; + } + + /** + * Get comparator + * @return comparator + */ + @javax.annotation.Nonnull + public SegmentComparator getComparator() { + return comparator; + } + + public void setComparator(SegmentComparator comparator) { + this.comparator = comparator; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SegmentConditionModel instance itself + */ + public SegmentConditionModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SegmentConditionModel segmentConditionModel = (SegmentConditionModel) o; + return Objects.equals(this.segmentId, segmentConditionModel.segmentId) && + Objects.equals(this.comparator, segmentConditionModel.comparator)&& + Objects.equals(this.additionalProperties, segmentConditionModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(segmentId, comparator, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SegmentConditionModel {\n"); + sb.append(" segmentId: ").append(toIndentedString(segmentId)).append("\n"); + sb.append(" comparator: ").append(toIndentedString(comparator)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("segmentId"); + openapiFields.add("comparator"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("segmentId"); + openapiRequiredFields.add("comparator"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SegmentConditionModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SegmentConditionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SegmentConditionModel is not found in the empty JSON string", SegmentConditionModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SegmentConditionModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("segmentId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `segmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("segmentId").toString())); + } + // validate the required field `comparator` + SegmentComparator.validateJsonElement(jsonObj.get("comparator")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SegmentConditionModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SegmentConditionModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SegmentConditionModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SegmentConditionModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SegmentConditionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SegmentConditionModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SegmentConditionModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of SegmentConditionModel + * @throws IOException if the JSON string is invalid with respect to SegmentConditionModel + */ + public static SegmentConditionModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SegmentConditionModel.class); + } + + /** + * Convert an instance of SegmentConditionModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SegmentListModel.java b/src/main/java/com/configcat/publicapi/java/client/model/SegmentListModel.java new file mode 100644 index 0000000..c46bbfb --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/SegmentListModel.java @@ -0,0 +1,588 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.ProductModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * SegmentListModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class SegmentListModel { + public static final String SERIALIZED_NAME_PRODUCT = "product"; + @SerializedName(SERIALIZED_NAME_PRODUCT) + private ProductModel product; + + public static final String SERIALIZED_NAME_SEGMENT_ID = "segmentId"; + @SerializedName(SERIALIZED_NAME_SEGMENT_ID) + private UUID segmentId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_CREATOR_EMAIL = "creatorEmail"; + @SerializedName(SERIALIZED_NAME_CREATOR_EMAIL) + private String creatorEmail; + + public static final String SERIALIZED_NAME_CREATOR_FULL_NAME = "creatorFullName"; + @SerializedName(SERIALIZED_NAME_CREATOR_FULL_NAME) + private String creatorFullName; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_LAST_UPDATER_EMAIL = "lastUpdaterEmail"; + @SerializedName(SERIALIZED_NAME_LAST_UPDATER_EMAIL) + private String lastUpdaterEmail; + + public static final String SERIALIZED_NAME_LAST_UPDATER_FULL_NAME = "lastUpdaterFullName"; + @SerializedName(SERIALIZED_NAME_LAST_UPDATER_FULL_NAME) + private String lastUpdaterFullName; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_USAGE = "usage"; + @SerializedName(SERIALIZED_NAME_USAGE) + private Integer usage; + + public SegmentListModel() { + } + + public SegmentListModel product(ProductModel product) { + this.product = product; + return this; + } + + /** + * Get product + * @return product + */ + @javax.annotation.Nonnull + public ProductModel getProduct() { + return product; + } + + public void setProduct(ProductModel product) { + this.product = product; + } + + + public SegmentListModel segmentId(UUID segmentId) { + this.segmentId = segmentId; + return this; + } + + /** + * Identifier of the Segment. + * @return segmentId + */ + @javax.annotation.Nonnull + public UUID getSegmentId() { + return segmentId; + } + + public void setSegmentId(UUID segmentId) { + this.segmentId = segmentId; + } + + + public SegmentListModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Segment. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public SegmentListModel description(String description) { + this.description = description; + return this; + } + + /** + * Description of the Segment. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + + public SegmentListModel creatorEmail(String creatorEmail) { + this.creatorEmail = creatorEmail; + return this; + } + + /** + * The email of the user who created the Segment. + * @return creatorEmail + */ + @javax.annotation.Nullable + public String getCreatorEmail() { + return creatorEmail; + } + + public void setCreatorEmail(String creatorEmail) { + this.creatorEmail = creatorEmail; + } + + + public SegmentListModel creatorFullName(String creatorFullName) { + this.creatorFullName = creatorFullName; + return this; + } + + /** + * The name of the user who created the Segment. + * @return creatorFullName + */ + @javax.annotation.Nullable + public String getCreatorFullName() { + return creatorFullName; + } + + public void setCreatorFullName(String creatorFullName) { + this.creatorFullName = creatorFullName; + } + + + public SegmentListModel createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The date and time when the Segment was created. + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public SegmentListModel lastUpdaterEmail(String lastUpdaterEmail) { + this.lastUpdaterEmail = lastUpdaterEmail; + return this; + } + + /** + * The email of the user who last updated the Segment. + * @return lastUpdaterEmail + */ + @javax.annotation.Nullable + public String getLastUpdaterEmail() { + return lastUpdaterEmail; + } + + public void setLastUpdaterEmail(String lastUpdaterEmail) { + this.lastUpdaterEmail = lastUpdaterEmail; + } + + + public SegmentListModel lastUpdaterFullName(String lastUpdaterFullName) { + this.lastUpdaterFullName = lastUpdaterFullName; + return this; + } + + /** + * The name of the user who last updated the Segment. + * @return lastUpdaterFullName + */ + @javax.annotation.Nullable + public String getLastUpdaterFullName() { + return lastUpdaterFullName; + } + + public void setLastUpdaterFullName(String lastUpdaterFullName) { + this.lastUpdaterFullName = lastUpdaterFullName; + } + + + public SegmentListModel updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * The date and time when the Segment was last updated. + * @return updatedAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + public SegmentListModel usage(Integer usage) { + this.usage = usage; + return this; + } + + /** + * Determines how many Feature Flags and Settings are using the Segment. + * @return usage + */ + @javax.annotation.Nonnull + public Integer getUsage() { + return usage; + } + + public void setUsage(Integer usage) { + this.usage = usage; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SegmentListModel instance itself + */ + public SegmentListModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SegmentListModel segmentListModel = (SegmentListModel) o; + return Objects.equals(this.product, segmentListModel.product) && + Objects.equals(this.segmentId, segmentListModel.segmentId) && + Objects.equals(this.name, segmentListModel.name) && + Objects.equals(this.description, segmentListModel.description) && + Objects.equals(this.creatorEmail, segmentListModel.creatorEmail) && + Objects.equals(this.creatorFullName, segmentListModel.creatorFullName) && + Objects.equals(this.createdAt, segmentListModel.createdAt) && + Objects.equals(this.lastUpdaterEmail, segmentListModel.lastUpdaterEmail) && + Objects.equals(this.lastUpdaterFullName, segmentListModel.lastUpdaterFullName) && + Objects.equals(this.updatedAt, segmentListModel.updatedAt) && + Objects.equals(this.usage, segmentListModel.usage)&& + Objects.equals(this.additionalProperties, segmentListModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(product, segmentId, name, description, creatorEmail, creatorFullName, createdAt, lastUpdaterEmail, lastUpdaterFullName, updatedAt, usage, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SegmentListModel {\n"); + sb.append(" product: ").append(toIndentedString(product)).append("\n"); + sb.append(" segmentId: ").append(toIndentedString(segmentId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" creatorEmail: ").append(toIndentedString(creatorEmail)).append("\n"); + sb.append(" creatorFullName: ").append(toIndentedString(creatorFullName)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" lastUpdaterEmail: ").append(toIndentedString(lastUpdaterEmail)).append("\n"); + sb.append(" lastUpdaterFullName: ").append(toIndentedString(lastUpdaterFullName)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" usage: ").append(toIndentedString(usage)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("product"); + openapiFields.add("segmentId"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("creatorEmail"); + openapiFields.add("creatorFullName"); + openapiFields.add("createdAt"); + openapiFields.add("lastUpdaterEmail"); + openapiFields.add("lastUpdaterFullName"); + openapiFields.add("updatedAt"); + openapiFields.add("usage"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("product"); + openapiRequiredFields.add("segmentId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("creatorEmail"); + openapiRequiredFields.add("creatorFullName"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("lastUpdaterEmail"); + openapiRequiredFields.add("lastUpdaterFullName"); + openapiRequiredFields.add("updatedAt"); + openapiRequiredFields.add("usage"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SegmentListModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SegmentListModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SegmentListModel is not found in the empty JSON string", SegmentListModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SegmentListModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `product` + ProductModel.validateJsonElement(jsonObj.get("product")); + if (!jsonObj.get("segmentId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `segmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("segmentId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if ((jsonObj.get("creatorEmail") != null && !jsonObj.get("creatorEmail").isJsonNull()) && !jsonObj.get("creatorEmail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `creatorEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creatorEmail").toString())); + } + if ((jsonObj.get("creatorFullName") != null && !jsonObj.get("creatorFullName").isJsonNull()) && !jsonObj.get("creatorFullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `creatorFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creatorFullName").toString())); + } + if ((jsonObj.get("lastUpdaterEmail") != null && !jsonObj.get("lastUpdaterEmail").isJsonNull()) && !jsonObj.get("lastUpdaterEmail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterEmail").toString())); + } + if ((jsonObj.get("lastUpdaterFullName") != null && !jsonObj.get("lastUpdaterFullName").isJsonNull()) && !jsonObj.get("lastUpdaterFullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterFullName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SegmentListModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SegmentListModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SegmentListModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SegmentListModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SegmentListModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SegmentListModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SegmentListModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of SegmentListModel + * @throws IOException if the JSON string is invalid with respect to SegmentListModel + */ + public static SegmentListModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SegmentListModel.class); + } + + /** + * Convert an instance of SegmentListModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SegmentModel.java b/src/main/java/com/configcat/publicapi/java/client/model/SegmentModel.java new file mode 100644 index 0000000..9a7c0f6 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/SegmentModel.java @@ -0,0 +1,651 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.ProductModel; +import com.configcat.publicapi.java.client.model.RolloutRuleComparator; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * SegmentModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class SegmentModel { + public static final String SERIALIZED_NAME_PRODUCT = "product"; + @SerializedName(SERIALIZED_NAME_PRODUCT) + private ProductModel product; + + public static final String SERIALIZED_NAME_SEGMENT_ID = "segmentId"; + @SerializedName(SERIALIZED_NAME_SEGMENT_ID) + private UUID segmentId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_CREATOR_EMAIL = "creatorEmail"; + @SerializedName(SERIALIZED_NAME_CREATOR_EMAIL) + private String creatorEmail; + + public static final String SERIALIZED_NAME_CREATOR_FULL_NAME = "creatorFullName"; + @SerializedName(SERIALIZED_NAME_CREATOR_FULL_NAME) + private String creatorFullName; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_LAST_UPDATER_EMAIL = "lastUpdaterEmail"; + @SerializedName(SERIALIZED_NAME_LAST_UPDATER_EMAIL) + private String lastUpdaterEmail; + + public static final String SERIALIZED_NAME_LAST_UPDATER_FULL_NAME = "lastUpdaterFullName"; + @SerializedName(SERIALIZED_NAME_LAST_UPDATER_FULL_NAME) + private String lastUpdaterFullName; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_COMPARISON_ATTRIBUTE = "comparisonAttribute"; + @SerializedName(SERIALIZED_NAME_COMPARISON_ATTRIBUTE) + private String comparisonAttribute; + + public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; + @SerializedName(SERIALIZED_NAME_COMPARATOR) + private RolloutRuleComparator comparator; + + public static final String SERIALIZED_NAME_COMPARISON_VALUE = "comparisonValue"; + @SerializedName(SERIALIZED_NAME_COMPARISON_VALUE) + private String comparisonValue; + + public SegmentModel() { + } + + public SegmentModel product(ProductModel product) { + this.product = product; + return this; + } + + /** + * Get product + * @return product + */ + @javax.annotation.Nonnull + public ProductModel getProduct() { + return product; + } + + public void setProduct(ProductModel product) { + this.product = product; + } + + + public SegmentModel segmentId(UUID segmentId) { + this.segmentId = segmentId; + return this; + } + + /** + * Identifier of the Segment. + * @return segmentId + */ + @javax.annotation.Nonnull + public UUID getSegmentId() { + return segmentId; + } + + public void setSegmentId(UUID segmentId) { + this.segmentId = segmentId; + } + + + public SegmentModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Segment. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public SegmentModel description(String description) { + this.description = description; + return this; + } + + /** + * Description of the Segment. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + + public SegmentModel creatorEmail(String creatorEmail) { + this.creatorEmail = creatorEmail; + return this; + } + + /** + * The email of the user who created the Segment. + * @return creatorEmail + */ + @javax.annotation.Nullable + public String getCreatorEmail() { + return creatorEmail; + } + + public void setCreatorEmail(String creatorEmail) { + this.creatorEmail = creatorEmail; + } + + + public SegmentModel creatorFullName(String creatorFullName) { + this.creatorFullName = creatorFullName; + return this; + } + + /** + * The name of the user who created the Segment. + * @return creatorFullName + */ + @javax.annotation.Nullable + public String getCreatorFullName() { + return creatorFullName; + } + + public void setCreatorFullName(String creatorFullName) { + this.creatorFullName = creatorFullName; + } + + + public SegmentModel createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The date and time when the Segment was created. + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public SegmentModel lastUpdaterEmail(String lastUpdaterEmail) { + this.lastUpdaterEmail = lastUpdaterEmail; + return this; + } + + /** + * The email of the user who last updated the Segment. + * @return lastUpdaterEmail + */ + @javax.annotation.Nullable + public String getLastUpdaterEmail() { + return lastUpdaterEmail; + } + + public void setLastUpdaterEmail(String lastUpdaterEmail) { + this.lastUpdaterEmail = lastUpdaterEmail; + } + + + public SegmentModel lastUpdaterFullName(String lastUpdaterFullName) { + this.lastUpdaterFullName = lastUpdaterFullName; + return this; + } + + /** + * The name of the user who last updated the Segment. + * @return lastUpdaterFullName + */ + @javax.annotation.Nullable + public String getLastUpdaterFullName() { + return lastUpdaterFullName; + } + + public void setLastUpdaterFullName(String lastUpdaterFullName) { + this.lastUpdaterFullName = lastUpdaterFullName; + } + + + public SegmentModel updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * The date and time when the Segment was last updated. + * @return updatedAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + public SegmentModel comparisonAttribute(String comparisonAttribute) { + this.comparisonAttribute = comparisonAttribute; + return this; + } + + /** + * The user's attribute the evaluation process must take into account. + * @return comparisonAttribute + */ + @javax.annotation.Nonnull + public String getComparisonAttribute() { + return comparisonAttribute; + } + + public void setComparisonAttribute(String comparisonAttribute) { + this.comparisonAttribute = comparisonAttribute; + } + + + public SegmentModel comparator(RolloutRuleComparator comparator) { + this.comparator = comparator; + return this; + } + + /** + * Get comparator + * @return comparator + */ + @javax.annotation.Nonnull + public RolloutRuleComparator getComparator() { + return comparator; + } + + public void setComparator(RolloutRuleComparator comparator) { + this.comparator = comparator; + } + + + public SegmentModel comparisonValue(String comparisonValue) { + this.comparisonValue = comparisonValue; + return this; + } + + /** + * The value to compare with the given user attribute's value. + * @return comparisonValue + */ + @javax.annotation.Nonnull + public String getComparisonValue() { + return comparisonValue; + } + + public void setComparisonValue(String comparisonValue) { + this.comparisonValue = comparisonValue; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SegmentModel instance itself + */ + public SegmentModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SegmentModel segmentModel = (SegmentModel) o; + return Objects.equals(this.product, segmentModel.product) && + Objects.equals(this.segmentId, segmentModel.segmentId) && + Objects.equals(this.name, segmentModel.name) && + Objects.equals(this.description, segmentModel.description) && + Objects.equals(this.creatorEmail, segmentModel.creatorEmail) && + Objects.equals(this.creatorFullName, segmentModel.creatorFullName) && + Objects.equals(this.createdAt, segmentModel.createdAt) && + Objects.equals(this.lastUpdaterEmail, segmentModel.lastUpdaterEmail) && + Objects.equals(this.lastUpdaterFullName, segmentModel.lastUpdaterFullName) && + Objects.equals(this.updatedAt, segmentModel.updatedAt) && + Objects.equals(this.comparisonAttribute, segmentModel.comparisonAttribute) && + Objects.equals(this.comparator, segmentModel.comparator) && + Objects.equals(this.comparisonValue, segmentModel.comparisonValue)&& + Objects.equals(this.additionalProperties, segmentModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(product, segmentId, name, description, creatorEmail, creatorFullName, createdAt, lastUpdaterEmail, lastUpdaterFullName, updatedAt, comparisonAttribute, comparator, comparisonValue, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SegmentModel {\n"); + sb.append(" product: ").append(toIndentedString(product)).append("\n"); + sb.append(" segmentId: ").append(toIndentedString(segmentId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" creatorEmail: ").append(toIndentedString(creatorEmail)).append("\n"); + sb.append(" creatorFullName: ").append(toIndentedString(creatorFullName)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" lastUpdaterEmail: ").append(toIndentedString(lastUpdaterEmail)).append("\n"); + sb.append(" lastUpdaterFullName: ").append(toIndentedString(lastUpdaterFullName)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" comparisonAttribute: ").append(toIndentedString(comparisonAttribute)).append("\n"); + sb.append(" comparator: ").append(toIndentedString(comparator)).append("\n"); + sb.append(" comparisonValue: ").append(toIndentedString(comparisonValue)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("product"); + openapiFields.add("segmentId"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("creatorEmail"); + openapiFields.add("creatorFullName"); + openapiFields.add("createdAt"); + openapiFields.add("lastUpdaterEmail"); + openapiFields.add("lastUpdaterFullName"); + openapiFields.add("updatedAt"); + openapiFields.add("comparisonAttribute"); + openapiFields.add("comparator"); + openapiFields.add("comparisonValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("product"); + openapiRequiredFields.add("segmentId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("creatorEmail"); + openapiRequiredFields.add("creatorFullName"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("lastUpdaterEmail"); + openapiRequiredFields.add("lastUpdaterFullName"); + openapiRequiredFields.add("updatedAt"); + openapiRequiredFields.add("comparisonAttribute"); + openapiRequiredFields.add("comparator"); + openapiRequiredFields.add("comparisonValue"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SegmentModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SegmentModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SegmentModel is not found in the empty JSON string", SegmentModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SegmentModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `product` + ProductModel.validateJsonElement(jsonObj.get("product")); + if (!jsonObj.get("segmentId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `segmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("segmentId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if ((jsonObj.get("creatorEmail") != null && !jsonObj.get("creatorEmail").isJsonNull()) && !jsonObj.get("creatorEmail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `creatorEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creatorEmail").toString())); + } + if ((jsonObj.get("creatorFullName") != null && !jsonObj.get("creatorFullName").isJsonNull()) && !jsonObj.get("creatorFullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `creatorFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creatorFullName").toString())); + } + if ((jsonObj.get("lastUpdaterEmail") != null && !jsonObj.get("lastUpdaterEmail").isJsonNull()) && !jsonObj.get("lastUpdaterEmail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterEmail").toString())); + } + if ((jsonObj.get("lastUpdaterFullName") != null && !jsonObj.get("lastUpdaterFullName").isJsonNull()) && !jsonObj.get("lastUpdaterFullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterFullName").toString())); + } + if (!jsonObj.get("comparisonAttribute").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `comparisonAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonAttribute").toString())); + } + // validate the required field `comparator` + RolloutRuleComparator.validateJsonElement(jsonObj.get("comparator")); + if (!jsonObj.get("comparisonValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `comparisonValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonValue").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SegmentModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SegmentModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SegmentModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SegmentModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SegmentModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SegmentModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SegmentModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of SegmentModel + * @throws IOException if the JSON string is invalid with respect to SegmentModel + */ + public static SegmentModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SegmentModel.class); + } + + /** + * Convert an instance of SegmentModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SettingDataModel.java b/src/main/java/com/configcat/publicapi/java/client/model/SettingDataModel.java new file mode 100644 index 0000000..fd19535 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/SettingDataModel.java @@ -0,0 +1,554 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.SettingType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Metadata of a Feature Flag or Setting. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class SettingDataModel { + public static final String SERIALIZED_NAME_SETTING_ID = "settingId"; + @SerializedName(SERIALIZED_NAME_SETTING_ID) + private Integer settingId; + + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_HINT = "hint"; + @SerializedName(SERIALIZED_NAME_HINT) + private String hint; + + public static final String SERIALIZED_NAME_SETTING_TYPE = "settingType"; + @SerializedName(SERIALIZED_NAME_SETTING_TYPE) + private SettingType settingType; + + public static final String SERIALIZED_NAME_ORDER = "order"; + @SerializedName(SERIALIZED_NAME_ORDER) + private Integer order; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_CREATOR_EMAIL = "creatorEmail"; + @SerializedName(SERIALIZED_NAME_CREATOR_EMAIL) + private String creatorEmail; + + public static final String SERIALIZED_NAME_CREATOR_FULL_NAME = "creatorFullName"; + @SerializedName(SERIALIZED_NAME_CREATOR_FULL_NAME) + private String creatorFullName; + + public static final String SERIALIZED_NAME_IS_WATCHING = "isWatching"; + @SerializedName(SERIALIZED_NAME_IS_WATCHING) + private Boolean isWatching; + + public SettingDataModel() { + } + + public SettingDataModel settingId(Integer settingId) { + this.settingId = settingId; + return this; + } + + /** + * Identifier of the Feature Flag or Setting. + * @return settingId + */ + @javax.annotation.Nonnull + public Integer getSettingId() { + return settingId; + } + + public void setSettingId(Integer settingId) { + this.settingId = settingId; + } + + + public SettingDataModel key(String key) { + this.key = key; + return this; + } + + /** + * Key of the Feature Flag or Setting. + * @return key + */ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + + public SettingDataModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Feature Flag or Setting. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public SettingDataModel hint(String hint) { + this.hint = hint; + return this; + } + + /** + * Description of the Feature Flag or Setting. + * @return hint + */ + @javax.annotation.Nullable + public String getHint() { + return hint; + } + + public void setHint(String hint) { + this.hint = hint; + } + + + public SettingDataModel settingType(SettingType settingType) { + this.settingType = settingType; + return this; + } + + /** + * Get settingType + * @return settingType + */ + @javax.annotation.Nonnull + public SettingType getSettingType() { + return settingType; + } + + public void setSettingType(SettingType settingType) { + this.settingType = settingType; + } + + + public SettingDataModel order(Integer order) { + this.order = order; + return this; + } + + /** + * The order of the Feature Flag or Setting represented on the ConfigCat Dashboard. + * @return order + */ + @javax.annotation.Nonnull + public Integer getOrder() { + return order; + } + + public void setOrder(Integer order) { + this.order = order; + } + + + public SettingDataModel createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The creation time of the Feature Flag or Setting. + * @return createdAt + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public SettingDataModel creatorEmail(String creatorEmail) { + this.creatorEmail = creatorEmail; + return this; + } + + /** + * The user's email address who created the Feature Flag or Setting. + * @return creatorEmail + */ + @javax.annotation.Nullable + public String getCreatorEmail() { + return creatorEmail; + } + + public void setCreatorEmail(String creatorEmail) { + this.creatorEmail = creatorEmail; + } + + + public SettingDataModel creatorFullName(String creatorFullName) { + this.creatorFullName = creatorFullName; + return this; + } + + /** + * The user's name who created the Feature Flag or Setting. + * @return creatorFullName + */ + @javax.annotation.Nullable + public String getCreatorFullName() { + return creatorFullName; + } + + public void setCreatorFullName(String creatorFullName) { + this.creatorFullName = creatorFullName; + } + + + public SettingDataModel isWatching(Boolean isWatching) { + this.isWatching = isWatching; + return this; + } + + /** + * Get isWatching + * @return isWatching + */ + @javax.annotation.Nonnull + public Boolean getIsWatching() { + return isWatching; + } + + public void setIsWatching(Boolean isWatching) { + this.isWatching = isWatching; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SettingDataModel instance itself + */ + public SettingDataModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SettingDataModel settingDataModel = (SettingDataModel) o; + return Objects.equals(this.settingId, settingDataModel.settingId) && + Objects.equals(this.key, settingDataModel.key) && + Objects.equals(this.name, settingDataModel.name) && + Objects.equals(this.hint, settingDataModel.hint) && + Objects.equals(this.settingType, settingDataModel.settingType) && + Objects.equals(this.order, settingDataModel.order) && + Objects.equals(this.createdAt, settingDataModel.createdAt) && + Objects.equals(this.creatorEmail, settingDataModel.creatorEmail) && + Objects.equals(this.creatorFullName, settingDataModel.creatorFullName) && + Objects.equals(this.isWatching, settingDataModel.isWatching)&& + Objects.equals(this.additionalProperties, settingDataModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(settingId, key, name, hint, settingType, order, createdAt, creatorEmail, creatorFullName, isWatching, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SettingDataModel {\n"); + sb.append(" settingId: ").append(toIndentedString(settingId)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" hint: ").append(toIndentedString(hint)).append("\n"); + sb.append(" settingType: ").append(toIndentedString(settingType)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" creatorEmail: ").append(toIndentedString(creatorEmail)).append("\n"); + sb.append(" creatorFullName: ").append(toIndentedString(creatorFullName)).append("\n"); + sb.append(" isWatching: ").append(toIndentedString(isWatching)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("settingId"); + openapiFields.add("key"); + openapiFields.add("name"); + openapiFields.add("hint"); + openapiFields.add("settingType"); + openapiFields.add("order"); + openapiFields.add("createdAt"); + openapiFields.add("creatorEmail"); + openapiFields.add("creatorFullName"); + openapiFields.add("isWatching"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("settingId"); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("hint"); + openapiRequiredFields.add("settingType"); + openapiRequiredFields.add("order"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("creatorEmail"); + openapiRequiredFields.add("creatorFullName"); + openapiRequiredFields.add("isWatching"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SettingDataModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SettingDataModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SettingDataModel is not found in the empty JSON string", SettingDataModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SettingDataModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("hint") != null && !jsonObj.get("hint").isJsonNull()) && !jsonObj.get("hint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hint").toString())); + } + // validate the required field `settingType` + SettingType.validateJsonElement(jsonObj.get("settingType")); + if ((jsonObj.get("creatorEmail") != null && !jsonObj.get("creatorEmail").isJsonNull()) && !jsonObj.get("creatorEmail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `creatorEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creatorEmail").toString())); + } + if ((jsonObj.get("creatorFullName") != null && !jsonObj.get("creatorFullName").isJsonNull()) && !jsonObj.get("creatorFullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `creatorFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creatorFullName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SettingDataModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SettingDataModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SettingDataModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SettingDataModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SettingDataModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SettingDataModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SettingDataModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of SettingDataModel + * @throws IOException if the JSON string is invalid with respect to SettingDataModel + */ + public static SettingDataModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SettingDataModel.class); + } + + /** + * Convert an instance of SettingDataModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SettingFormulaModel.java b/src/main/java/com/configcat/publicapi/java/client/model/SettingFormulaModel.java new file mode 100644 index 0000000..1d0f866 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/SettingFormulaModel.java @@ -0,0 +1,772 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.ConfigModel; +import com.configcat.publicapi.java.client.model.EnvironmentModel; +import com.configcat.publicapi.java.client.model.FeatureFlagLimitations; +import com.configcat.publicapi.java.client.model.IntegrationLinkModel; +import com.configcat.publicapi.java.client.model.SettingDataModel; +import com.configcat.publicapi.java.client.model.SettingTagModel; +import com.configcat.publicapi.java.client.model.TargetingRuleModel; +import com.configcat.publicapi.java.client.model.ValueModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * SettingFormulaModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class SettingFormulaModel { + public static final String SERIALIZED_NAME_LAST_VERSION_ID = "lastVersionId"; + @SerializedName(SERIALIZED_NAME_LAST_VERSION_ID) + private UUID lastVersionId; + + public static final String SERIALIZED_NAME_DEFAULT_VALUE = "defaultValue"; + @SerializedName(SERIALIZED_NAME_DEFAULT_VALUE) + private ValueModel defaultValue; + + public static final String SERIALIZED_NAME_TARGETING_RULES = "targetingRules"; + @SerializedName(SERIALIZED_NAME_TARGETING_RULES) + private List targetingRules = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SETTING = "setting"; + @SerializedName(SERIALIZED_NAME_SETTING) + private SettingDataModel setting; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_PERCENTAGE_EVALUATION_ATTRIBUTE = "percentageEvaluationAttribute"; + @SerializedName(SERIALIZED_NAME_PERCENTAGE_EVALUATION_ATTRIBUTE) + private String percentageEvaluationAttribute; + + public static final String SERIALIZED_NAME_LAST_UPDATER_USER_EMAIL = "lastUpdaterUserEmail"; + @SerializedName(SERIALIZED_NAME_LAST_UPDATER_USER_EMAIL) + private String lastUpdaterUserEmail; + + public static final String SERIALIZED_NAME_LAST_UPDATER_USER_FULL_NAME = "lastUpdaterUserFullName"; + @SerializedName(SERIALIZED_NAME_LAST_UPDATER_USER_FULL_NAME) + private String lastUpdaterUserFullName; + + public static final String SERIALIZED_NAME_INTEGRATION_LINKS = "integrationLinks"; + @SerializedName(SERIALIZED_NAME_INTEGRATION_LINKS) + private List integrationLinks = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SETTING_TAGS = "settingTags"; + @SerializedName(SERIALIZED_NAME_SETTING_TAGS) + private List settingTags = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SETTING_IDS_WHERE_PREREQUISITE = "settingIdsWherePrerequisite"; + @SerializedName(SERIALIZED_NAME_SETTING_IDS_WHERE_PREREQUISITE) + private List settingIdsWherePrerequisite = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CONFIG = "config"; + @SerializedName(SERIALIZED_NAME_CONFIG) + private ConfigModel config; + + public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT) + private EnvironmentModel environment; + + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public static final String SERIALIZED_NAME_FEATURE_FLAG_LIMITATIONS = "featureFlagLimitations"; + @SerializedName(SERIALIZED_NAME_FEATURE_FLAG_LIMITATIONS) + private FeatureFlagLimitations featureFlagLimitations; + + public SettingFormulaModel() { + } + + public SettingFormulaModel lastVersionId(UUID lastVersionId) { + this.lastVersionId = lastVersionId; + return this; + } + + /** + * Get lastVersionId + * @return lastVersionId + */ + @javax.annotation.Nonnull + public UUID getLastVersionId() { + return lastVersionId; + } + + public void setLastVersionId(UUID lastVersionId) { + this.lastVersionId = lastVersionId; + } + + + public SettingFormulaModel defaultValue(ValueModel defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + /** + * Get defaultValue + * @return defaultValue + */ + @javax.annotation.Nonnull + public ValueModel getDefaultValue() { + return defaultValue; + } + + public void setDefaultValue(ValueModel defaultValue) { + this.defaultValue = defaultValue; + } + + + public SettingFormulaModel targetingRules(List targetingRules) { + this.targetingRules = targetingRules; + return this; + } + + public SettingFormulaModel addTargetingRulesItem(TargetingRuleModel targetingRulesItem) { + if (this.targetingRules == null) { + this.targetingRules = new ArrayList<>(); + } + this.targetingRules.add(targetingRulesItem); + return this; + } + + /** + * The targeting rules of the Feature Flag or Setting. + * @return targetingRules + */ + @javax.annotation.Nonnull + public List getTargetingRules() { + return targetingRules; + } + + public void setTargetingRules(List targetingRules) { + this.targetingRules = targetingRules; + } + + + public SettingFormulaModel setting(SettingDataModel setting) { + this.setting = setting; + return this; + } + + /** + * Get setting + * @return setting + */ + @javax.annotation.Nonnull + public SettingDataModel getSetting() { + return setting; + } + + public void setSetting(SettingDataModel setting) { + this.setting = setting; + } + + + public SettingFormulaModel updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * The last updated date and time when the Feature Flag or Setting. + * @return updatedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + public SettingFormulaModel percentageEvaluationAttribute(String percentageEvaluationAttribute) { + this.percentageEvaluationAttribute = percentageEvaluationAttribute; + return this; + } + + /** + * The user attribute used for percentage evaluation. If not set, it defaults to the `Identifier` user object attribute. + * @return percentageEvaluationAttribute + */ + @javax.annotation.Nullable + public String getPercentageEvaluationAttribute() { + return percentageEvaluationAttribute; + } + + public void setPercentageEvaluationAttribute(String percentageEvaluationAttribute) { + this.percentageEvaluationAttribute = percentageEvaluationAttribute; + } + + + public SettingFormulaModel lastUpdaterUserEmail(String lastUpdaterUserEmail) { + this.lastUpdaterUserEmail = lastUpdaterUserEmail; + return this; + } + + /** + * The email of the user who last updated the Feature Flag or Setting. + * @return lastUpdaterUserEmail + */ + @javax.annotation.Nullable + public String getLastUpdaterUserEmail() { + return lastUpdaterUserEmail; + } + + public void setLastUpdaterUserEmail(String lastUpdaterUserEmail) { + this.lastUpdaterUserEmail = lastUpdaterUserEmail; + } + + + public SettingFormulaModel lastUpdaterUserFullName(String lastUpdaterUserFullName) { + this.lastUpdaterUserFullName = lastUpdaterUserFullName; + return this; + } + + /** + * The name of the user who last updated the Feature Flag or Setting. + * @return lastUpdaterUserFullName + */ + @javax.annotation.Nullable + public String getLastUpdaterUserFullName() { + return lastUpdaterUserFullName; + } + + public void setLastUpdaterUserFullName(String lastUpdaterUserFullName) { + this.lastUpdaterUserFullName = lastUpdaterUserFullName; + } + + + public SettingFormulaModel integrationLinks(List integrationLinks) { + this.integrationLinks = integrationLinks; + return this; + } + + public SettingFormulaModel addIntegrationLinksItem(IntegrationLinkModel integrationLinksItem) { + if (this.integrationLinks == null) { + this.integrationLinks = new ArrayList<>(); + } + this.integrationLinks.add(integrationLinksItem); + return this; + } + + /** + * The integration links attached to the Feature Flag or Setting. + * @return integrationLinks + */ + @javax.annotation.Nonnull + public List getIntegrationLinks() { + return integrationLinks; + } + + public void setIntegrationLinks(List integrationLinks) { + this.integrationLinks = integrationLinks; + } + + + public SettingFormulaModel settingTags(List settingTags) { + this.settingTags = settingTags; + return this; + } + + public SettingFormulaModel addSettingTagsItem(SettingTagModel settingTagsItem) { + if (this.settingTags == null) { + this.settingTags = new ArrayList<>(); + } + this.settingTags.add(settingTagsItem); + return this; + } + + /** + * The tags attached to the Feature Flag or Setting. + * @return settingTags + */ + @javax.annotation.Nonnull + public List getSettingTags() { + return settingTags; + } + + public void setSettingTags(List settingTags) { + this.settingTags = settingTags; + } + + + public SettingFormulaModel settingIdsWherePrerequisite(List settingIdsWherePrerequisite) { + this.settingIdsWherePrerequisite = settingIdsWherePrerequisite; + return this; + } + + public SettingFormulaModel addSettingIdsWherePrerequisiteItem(Integer settingIdsWherePrerequisiteItem) { + if (this.settingIdsWherePrerequisite == null) { + this.settingIdsWherePrerequisite = new ArrayList<>(); + } + this.settingIdsWherePrerequisite.add(settingIdsWherePrerequisiteItem); + return this; + } + + /** + * List of Feature Flag and Setting IDs where the actual Feature Flag or Setting is prerequisite. + * @return settingIdsWherePrerequisite + */ + @javax.annotation.Nonnull + public List getSettingIdsWherePrerequisite() { + return settingIdsWherePrerequisite; + } + + public void setSettingIdsWherePrerequisite(List settingIdsWherePrerequisite) { + this.settingIdsWherePrerequisite = settingIdsWherePrerequisite; + } + + + public SettingFormulaModel config(ConfigModel config) { + this.config = config; + return this; + } + + /** + * Get config + * @return config + */ + @javax.annotation.Nonnull + public ConfigModel getConfig() { + return config; + } + + public void setConfig(ConfigModel config) { + this.config = config; + } + + + public SettingFormulaModel environment(EnvironmentModel environment) { + this.environment = environment; + return this; + } + + /** + * Get environment + * @return environment + */ + @javax.annotation.Nonnull + public EnvironmentModel getEnvironment() { + return environment; + } + + public void setEnvironment(EnvironmentModel environment) { + this.environment = environment; + } + + + public SettingFormulaModel readOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Get readOnly + * @return readOnly + */ + @javax.annotation.Nonnull + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + + public SettingFormulaModel featureFlagLimitations(FeatureFlagLimitations featureFlagLimitations) { + this.featureFlagLimitations = featureFlagLimitations; + return this; + } + + /** + * Get featureFlagLimitations + * @return featureFlagLimitations + */ + @javax.annotation.Nonnull + public FeatureFlagLimitations getFeatureFlagLimitations() { + return featureFlagLimitations; + } + + public void setFeatureFlagLimitations(FeatureFlagLimitations featureFlagLimitations) { + this.featureFlagLimitations = featureFlagLimitations; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SettingFormulaModel instance itself + */ + public SettingFormulaModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SettingFormulaModel settingFormulaModel = (SettingFormulaModel) o; + return Objects.equals(this.lastVersionId, settingFormulaModel.lastVersionId) && + Objects.equals(this.defaultValue, settingFormulaModel.defaultValue) && + Objects.equals(this.targetingRules, settingFormulaModel.targetingRules) && + Objects.equals(this.setting, settingFormulaModel.setting) && + Objects.equals(this.updatedAt, settingFormulaModel.updatedAt) && + Objects.equals(this.percentageEvaluationAttribute, settingFormulaModel.percentageEvaluationAttribute) && + Objects.equals(this.lastUpdaterUserEmail, settingFormulaModel.lastUpdaterUserEmail) && + Objects.equals(this.lastUpdaterUserFullName, settingFormulaModel.lastUpdaterUserFullName) && + Objects.equals(this.integrationLinks, settingFormulaModel.integrationLinks) && + Objects.equals(this.settingTags, settingFormulaModel.settingTags) && + Objects.equals(this.settingIdsWherePrerequisite, settingFormulaModel.settingIdsWherePrerequisite) && + Objects.equals(this.config, settingFormulaModel.config) && + Objects.equals(this.environment, settingFormulaModel.environment) && + Objects.equals(this.readOnly, settingFormulaModel.readOnly) && + Objects.equals(this.featureFlagLimitations, settingFormulaModel.featureFlagLimitations)&& + Objects.equals(this.additionalProperties, settingFormulaModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(lastVersionId, defaultValue, targetingRules, setting, updatedAt, percentageEvaluationAttribute, lastUpdaterUserEmail, lastUpdaterUserFullName, integrationLinks, settingTags, settingIdsWherePrerequisite, config, environment, readOnly, featureFlagLimitations, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SettingFormulaModel {\n"); + sb.append(" lastVersionId: ").append(toIndentedString(lastVersionId)).append("\n"); + sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); + sb.append(" targetingRules: ").append(toIndentedString(targetingRules)).append("\n"); + sb.append(" setting: ").append(toIndentedString(setting)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" percentageEvaluationAttribute: ").append(toIndentedString(percentageEvaluationAttribute)).append("\n"); + sb.append(" lastUpdaterUserEmail: ").append(toIndentedString(lastUpdaterUserEmail)).append("\n"); + sb.append(" lastUpdaterUserFullName: ").append(toIndentedString(lastUpdaterUserFullName)).append("\n"); + sb.append(" integrationLinks: ").append(toIndentedString(integrationLinks)).append("\n"); + sb.append(" settingTags: ").append(toIndentedString(settingTags)).append("\n"); + sb.append(" settingIdsWherePrerequisite: ").append(toIndentedString(settingIdsWherePrerequisite)).append("\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); + sb.append(" featureFlagLimitations: ").append(toIndentedString(featureFlagLimitations)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("lastVersionId"); + openapiFields.add("defaultValue"); + openapiFields.add("targetingRules"); + openapiFields.add("setting"); + openapiFields.add("updatedAt"); + openapiFields.add("percentageEvaluationAttribute"); + openapiFields.add("lastUpdaterUserEmail"); + openapiFields.add("lastUpdaterUserFullName"); + openapiFields.add("integrationLinks"); + openapiFields.add("settingTags"); + openapiFields.add("settingIdsWherePrerequisite"); + openapiFields.add("config"); + openapiFields.add("environment"); + openapiFields.add("readOnly"); + openapiFields.add("featureFlagLimitations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("lastVersionId"); + openapiRequiredFields.add("defaultValue"); + openapiRequiredFields.add("targetingRules"); + openapiRequiredFields.add("setting"); + openapiRequiredFields.add("updatedAt"); + openapiRequiredFields.add("percentageEvaluationAttribute"); + openapiRequiredFields.add("lastUpdaterUserEmail"); + openapiRequiredFields.add("lastUpdaterUserFullName"); + openapiRequiredFields.add("integrationLinks"); + openapiRequiredFields.add("settingTags"); + openapiRequiredFields.add("settingIdsWherePrerequisite"); + openapiRequiredFields.add("config"); + openapiRequiredFields.add("environment"); + openapiRequiredFields.add("readOnly"); + openapiRequiredFields.add("featureFlagLimitations"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SettingFormulaModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SettingFormulaModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SettingFormulaModel is not found in the empty JSON string", SettingFormulaModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SettingFormulaModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("lastVersionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastVersionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastVersionId").toString())); + } + // validate the required field `defaultValue` + ValueModel.validateJsonElement(jsonObj.get("defaultValue")); + // ensure the json data is an array + if (!jsonObj.get("targetingRules").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `targetingRules` to be an array in the JSON string but got `%s`", jsonObj.get("targetingRules").toString())); + } + + JsonArray jsonArraytargetingRules = jsonObj.getAsJsonArray("targetingRules"); + // validate the required field `targetingRules` (array) + for (int i = 0; i < jsonArraytargetingRules.size(); i++) { + TargetingRuleModel.validateJsonElement(jsonArraytargetingRules.get(i)); + }; + // validate the required field `setting` + SettingDataModel.validateJsonElement(jsonObj.get("setting")); + if ((jsonObj.get("percentageEvaluationAttribute") != null && !jsonObj.get("percentageEvaluationAttribute").isJsonNull()) && !jsonObj.get("percentageEvaluationAttribute").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `percentageEvaluationAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("percentageEvaluationAttribute").toString())); + } + if ((jsonObj.get("lastUpdaterUserEmail") != null && !jsonObj.get("lastUpdaterUserEmail").isJsonNull()) && !jsonObj.get("lastUpdaterUserEmail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterUserEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterUserEmail").toString())); + } + if ((jsonObj.get("lastUpdaterUserFullName") != null && !jsonObj.get("lastUpdaterUserFullName").isJsonNull()) && !jsonObj.get("lastUpdaterUserFullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterUserFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterUserFullName").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("integrationLinks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `integrationLinks` to be an array in the JSON string but got `%s`", jsonObj.get("integrationLinks").toString())); + } + + JsonArray jsonArrayintegrationLinks = jsonObj.getAsJsonArray("integrationLinks"); + // validate the required field `integrationLinks` (array) + for (int i = 0; i < jsonArrayintegrationLinks.size(); i++) { + IntegrationLinkModel.validateJsonElement(jsonArrayintegrationLinks.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("settingTags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `settingTags` to be an array in the JSON string but got `%s`", jsonObj.get("settingTags").toString())); + } + + JsonArray jsonArraysettingTags = jsonObj.getAsJsonArray("settingTags"); + // validate the required field `settingTags` (array) + for (int i = 0; i < jsonArraysettingTags.size(); i++) { + SettingTagModel.validateJsonElement(jsonArraysettingTags.get(i)); + }; + // ensure the required json array is present + if (jsonObj.get("settingIdsWherePrerequisite") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("settingIdsWherePrerequisite").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `settingIdsWherePrerequisite` to be an array in the JSON string but got `%s`", jsonObj.get("settingIdsWherePrerequisite").toString())); + } + // validate the required field `config` + ConfigModel.validateJsonElement(jsonObj.get("config")); + // validate the required field `environment` + EnvironmentModel.validateJsonElement(jsonObj.get("environment")); + // validate the required field `featureFlagLimitations` + FeatureFlagLimitations.validateJsonElement(jsonObj.get("featureFlagLimitations")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SettingFormulaModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SettingFormulaModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SettingFormulaModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SettingFormulaModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SettingFormulaModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SettingFormulaModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SettingFormulaModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of SettingFormulaModel + * @throws IOException if the JSON string is invalid with respect to SettingFormulaModel + */ + public static SettingFormulaModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SettingFormulaModel.class); + } + + /** + * Convert an instance of SettingFormulaModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SettingModel.java b/src/main/java/com/configcat/publicapi/java/client/model/SettingModel.java new file mode 100644 index 0000000..d5398e4 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/SettingModel.java @@ -0,0 +1,576 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.SettingType; +import com.configcat.publicapi.java.client.model.TagModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Metadata of a Feature Flag or Setting. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class SettingModel { + public static final String SERIALIZED_NAME_SETTING_ID = "settingId"; + @SerializedName(SERIALIZED_NAME_SETTING_ID) + private Integer settingId; + + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_HINT = "hint"; + @SerializedName(SERIALIZED_NAME_HINT) + private String hint; + + public static final String SERIALIZED_NAME_ORDER = "order"; + @SerializedName(SERIALIZED_NAME_ORDER) + private Integer order; + + public static final String SERIALIZED_NAME_SETTING_TYPE = "settingType"; + @SerializedName(SERIALIZED_NAME_SETTING_TYPE) + private SettingType settingType; + + public static final String SERIALIZED_NAME_CONFIG_ID = "configId"; + @SerializedName(SERIALIZED_NAME_CONFIG_ID) + private UUID configId; + + public static final String SERIALIZED_NAME_CONFIG_NAME = "configName"; + @SerializedName(SERIALIZED_NAME_CONFIG_NAME) + private String configName; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_TAGS = "tags"; + @SerializedName(SERIALIZED_NAME_TAGS) + private List tags = new ArrayList<>(); + + public SettingModel() { + } + + public SettingModel settingId(Integer settingId) { + this.settingId = settingId; + return this; + } + + /** + * Identifier of the Feature Flag or Setting. + * @return settingId + */ + @javax.annotation.Nonnull + public Integer getSettingId() { + return settingId; + } + + public void setSettingId(Integer settingId) { + this.settingId = settingId; + } + + + public SettingModel key(String key) { + this.key = key; + return this; + } + + /** + * Key of the Feature Flag or Setting. + * @return key + */ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + + public SettingModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Feature Flag or Setting. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public SettingModel hint(String hint) { + this.hint = hint; + return this; + } + + /** + * Description of the Feature Flag or Setting. + * @return hint + */ + @javax.annotation.Nullable + public String getHint() { + return hint; + } + + public void setHint(String hint) { + this.hint = hint; + } + + + public SettingModel order(Integer order) { + this.order = order; + return this; + } + + /** + * The order of the Feature Flag or Setting represented on the ConfigCat Dashboard. + * @return order + */ + @javax.annotation.Nonnull + public Integer getOrder() { + return order; + } + + public void setOrder(Integer order) { + this.order = order; + } + + + public SettingModel settingType(SettingType settingType) { + this.settingType = settingType; + return this; + } + + /** + * Get settingType + * @return settingType + */ + @javax.annotation.Nonnull + public SettingType getSettingType() { + return settingType; + } + + public void setSettingType(SettingType settingType) { + this.settingType = settingType; + } + + + public SettingModel configId(UUID configId) { + this.configId = configId; + return this; + } + + /** + * Identifier of the Feature Flag's Config. + * @return configId + */ + @javax.annotation.Nonnull + public UUID getConfigId() { + return configId; + } + + public void setConfigId(UUID configId) { + this.configId = configId; + } + + + public SettingModel configName(String configName) { + this.configName = configName; + return this; + } + + /** + * Name of the Feature Flag's Config. + * @return configName + */ + @javax.annotation.Nonnull + public String getConfigName() { + return configName; + } + + public void setConfigName(String configName) { + this.configName = configName; + } + + + public SettingModel createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The creation time of the Feature Flag or Setting. + * @return createdAt + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public SettingModel tags(List tags) { + this.tags = tags; + return this; + } + + public SettingModel addTagsItem(TagModel tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * The tags attached to the Feature Flag or Setting. + * @return tags + */ + @javax.annotation.Nonnull + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SettingModel instance itself + */ + public SettingModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SettingModel settingModel = (SettingModel) o; + return Objects.equals(this.settingId, settingModel.settingId) && + Objects.equals(this.key, settingModel.key) && + Objects.equals(this.name, settingModel.name) && + Objects.equals(this.hint, settingModel.hint) && + Objects.equals(this.order, settingModel.order) && + Objects.equals(this.settingType, settingModel.settingType) && + Objects.equals(this.configId, settingModel.configId) && + Objects.equals(this.configName, settingModel.configName) && + Objects.equals(this.createdAt, settingModel.createdAt) && + Objects.equals(this.tags, settingModel.tags)&& + Objects.equals(this.additionalProperties, settingModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(settingId, key, name, hint, order, settingType, configId, configName, createdAt, tags, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SettingModel {\n"); + sb.append(" settingId: ").append(toIndentedString(settingId)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" hint: ").append(toIndentedString(hint)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append(" settingType: ").append(toIndentedString(settingType)).append("\n"); + sb.append(" configId: ").append(toIndentedString(configId)).append("\n"); + sb.append(" configName: ").append(toIndentedString(configName)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("settingId"); + openapiFields.add("key"); + openapiFields.add("name"); + openapiFields.add("hint"); + openapiFields.add("order"); + openapiFields.add("settingType"); + openapiFields.add("configId"); + openapiFields.add("configName"); + openapiFields.add("createdAt"); + openapiFields.add("tags"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("settingId"); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("hint"); + openapiRequiredFields.add("order"); + openapiRequiredFields.add("settingType"); + openapiRequiredFields.add("configId"); + openapiRequiredFields.add("configName"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("tags"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SettingModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SettingModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SettingModel is not found in the empty JSON string", SettingModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SettingModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("hint") != null && !jsonObj.get("hint").isJsonNull()) && !jsonObj.get("hint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hint").toString())); + } + // validate the required field `settingType` + SettingType.validateJsonElement(jsonObj.get("settingType")); + if (!jsonObj.get("configId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `configId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("configId").toString())); + } + if (!jsonObj.get("configName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `configName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("configName").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("tags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); + } + + JsonArray jsonArraytags = jsonObj.getAsJsonArray("tags"); + // validate the required field `tags` (array) + for (int i = 0; i < jsonArraytags.size(); i++) { + TagModel.validateJsonElement(jsonArraytags.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SettingModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SettingModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SettingModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SettingModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SettingModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SettingModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SettingModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of SettingModel + * @throws IOException if the JSON string is invalid with respect to SettingModel + */ + public static SettingModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SettingModel.class); + } + + /** + * Convert an instance of SettingModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SettingTagModel.java b/src/main/java/com/configcat/publicapi/java/client/model/SettingTagModel.java new file mode 100644 index 0000000..4ea33d7 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/SettingTagModel.java @@ -0,0 +1,379 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * SettingTagModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class SettingTagModel { + public static final String SERIALIZED_NAME_SETTING_TAG_ID = "settingTagId"; + @SerializedName(SERIALIZED_NAME_SETTING_TAG_ID) + private Long settingTagId; + + public static final String SERIALIZED_NAME_TAG_ID = "tagId"; + @SerializedName(SERIALIZED_NAME_TAG_ID) + private Long tagId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_COLOR = "color"; + @SerializedName(SERIALIZED_NAME_COLOR) + private String color; + + public SettingTagModel() { + } + + public SettingTagModel settingTagId(Long settingTagId) { + this.settingTagId = settingTagId; + return this; + } + + /** + * Get settingTagId + * @return settingTagId + */ + @javax.annotation.Nonnull + public Long getSettingTagId() { + return settingTagId; + } + + public void setSettingTagId(Long settingTagId) { + this.settingTagId = settingTagId; + } + + + public SettingTagModel tagId(Long tagId) { + this.tagId = tagId; + return this; + } + + /** + * Get tagId + * @return tagId + */ + @javax.annotation.Nonnull + public Long getTagId() { + return tagId; + } + + public void setTagId(Long tagId) { + this.tagId = tagId; + } + + + public SettingTagModel name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public SettingTagModel color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + */ + @javax.annotation.Nullable + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SettingTagModel instance itself + */ + public SettingTagModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SettingTagModel settingTagModel = (SettingTagModel) o; + return Objects.equals(this.settingTagId, settingTagModel.settingTagId) && + Objects.equals(this.tagId, settingTagModel.tagId) && + Objects.equals(this.name, settingTagModel.name) && + Objects.equals(this.color, settingTagModel.color)&& + Objects.equals(this.additionalProperties, settingTagModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(settingTagId, tagId, name, color, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SettingTagModel {\n"); + sb.append(" settingTagId: ").append(toIndentedString(settingTagId)).append("\n"); + sb.append(" tagId: ").append(toIndentedString(tagId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("settingTagId"); + openapiFields.add("tagId"); + openapiFields.add("name"); + openapiFields.add("color"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("settingTagId"); + openapiRequiredFields.add("tagId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("color"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SettingTagModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SettingTagModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SettingTagModel is not found in the empty JSON string", SettingTagModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SettingTagModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("color") != null && !jsonObj.get("color").isJsonNull()) && !jsonObj.get("color").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SettingTagModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SettingTagModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SettingTagModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SettingTagModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SettingTagModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SettingTagModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SettingTagModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of SettingTagModel + * @throws IOException if the JSON string is invalid with respect to SettingTagModel + */ + public static SettingTagModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SettingTagModel.class); + } + + /** + * Convert an instance of SettingTagModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SettingType.java b/src/main/java/com/configcat/publicapi/java/client/model/SettingType.java new file mode 100644 index 0000000..b78ac4b --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/SettingType.java @@ -0,0 +1,82 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * The type of the Feature Flag or Setting. + */ +@JsonAdapter(SettingType.Adapter.class) +public enum SettingType { + + BOOLEAN("boolean"), + + STRING("string"), + + INT("int"), + + DOUBLE("double"); + + private String value; + + SettingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SettingType fromValue(String value) { + for (SettingType b : SettingType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SettingType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SettingType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SettingType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SettingType.fromValue(value); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SettingValueModel.java b/src/main/java/com/configcat/publicapi/java/client/model/SettingValueModel.java new file mode 100644 index 0000000..74570ce --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/SettingValueModel.java @@ -0,0 +1,716 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.ConfigModel; +import com.configcat.publicapi.java.client.model.EnvironmentModel; +import com.configcat.publicapi.java.client.model.FeatureFlagLimitations; +import com.configcat.publicapi.java.client.model.IntegrationLinkModel; +import com.configcat.publicapi.java.client.model.RolloutPercentageItemModel; +import com.configcat.publicapi.java.client.model.RolloutRuleModel; +import com.configcat.publicapi.java.client.model.SettingDataModel; +import com.configcat.publicapi.java.client.model.SettingTagModel; +import com.configcat.publicapi.java.client.model.SettingValueType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * SettingValueModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class SettingValueModel { + public static final String SERIALIZED_NAME_SETTING = "setting"; + @SerializedName(SERIALIZED_NAME_SETTING) + private SettingDataModel setting; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_LAST_UPDATER_USER_EMAIL = "lastUpdaterUserEmail"; + @SerializedName(SERIALIZED_NAME_LAST_UPDATER_USER_EMAIL) + private String lastUpdaterUserEmail; + + public static final String SERIALIZED_NAME_LAST_UPDATER_USER_FULL_NAME = "lastUpdaterUserFullName"; + @SerializedName(SERIALIZED_NAME_LAST_UPDATER_USER_FULL_NAME) + private String lastUpdaterUserFullName; + + public static final String SERIALIZED_NAME_INTEGRATION_LINKS = "integrationLinks"; + @SerializedName(SERIALIZED_NAME_INTEGRATION_LINKS) + private List integrationLinks = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SETTING_TAGS = "settingTags"; + @SerializedName(SERIALIZED_NAME_SETTING_TAGS) + private List settingTags = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ROLLOUT_RULES = "rolloutRules"; + @SerializedName(SERIALIZED_NAME_ROLLOUT_RULES) + private List rolloutRules = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS = "rolloutPercentageItems"; + @SerializedName(SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS) + private List rolloutPercentageItems = new ArrayList<>(); + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private SettingValueType value; + + public static final String SERIALIZED_NAME_CONFIG = "config"; + @SerializedName(SERIALIZED_NAME_CONFIG) + private ConfigModel config; + + public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT) + private EnvironmentModel environment; + + public static final String SERIALIZED_NAME_FEATURE_FLAG_LIMITATIONS = "featureFlagLimitations"; + @SerializedName(SERIALIZED_NAME_FEATURE_FLAG_LIMITATIONS) + private FeatureFlagLimitations featureFlagLimitations; + + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public SettingValueModel() { + } + + public SettingValueModel setting(SettingDataModel setting) { + this.setting = setting; + return this; + } + + /** + * Get setting + * @return setting + */ + @javax.annotation.Nonnull + public SettingDataModel getSetting() { + return setting; + } + + public void setSetting(SettingDataModel setting) { + this.setting = setting; + } + + + public SettingValueModel updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * The last updated date and time when the Feature Flag or Setting. + * @return updatedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + public SettingValueModel lastUpdaterUserEmail(String lastUpdaterUserEmail) { + this.lastUpdaterUserEmail = lastUpdaterUserEmail; + return this; + } + + /** + * The email of the user who last updated the Feature Flag or Setting. + * @return lastUpdaterUserEmail + */ + @javax.annotation.Nullable + public String getLastUpdaterUserEmail() { + return lastUpdaterUserEmail; + } + + public void setLastUpdaterUserEmail(String lastUpdaterUserEmail) { + this.lastUpdaterUserEmail = lastUpdaterUserEmail; + } + + + public SettingValueModel lastUpdaterUserFullName(String lastUpdaterUserFullName) { + this.lastUpdaterUserFullName = lastUpdaterUserFullName; + return this; + } + + /** + * The name of the user who last updated the Feature Flag or Setting. + * @return lastUpdaterUserFullName + */ + @javax.annotation.Nullable + public String getLastUpdaterUserFullName() { + return lastUpdaterUserFullName; + } + + public void setLastUpdaterUserFullName(String lastUpdaterUserFullName) { + this.lastUpdaterUserFullName = lastUpdaterUserFullName; + } + + + public SettingValueModel integrationLinks(List integrationLinks) { + this.integrationLinks = integrationLinks; + return this; + } + + public SettingValueModel addIntegrationLinksItem(IntegrationLinkModel integrationLinksItem) { + if (this.integrationLinks == null) { + this.integrationLinks = new ArrayList<>(); + } + this.integrationLinks.add(integrationLinksItem); + return this; + } + + /** + * The integration links attached to the Feature Flag or Setting. + * @return integrationLinks + */ + @javax.annotation.Nonnull + public List getIntegrationLinks() { + return integrationLinks; + } + + public void setIntegrationLinks(List integrationLinks) { + this.integrationLinks = integrationLinks; + } + + + public SettingValueModel settingTags(List settingTags) { + this.settingTags = settingTags; + return this; + } + + public SettingValueModel addSettingTagsItem(SettingTagModel settingTagsItem) { + if (this.settingTags == null) { + this.settingTags = new ArrayList<>(); + } + this.settingTags.add(settingTagsItem); + return this; + } + + /** + * The tags attached to the Feature Flag or Setting. + * @return settingTags + */ + @javax.annotation.Nonnull + public List getSettingTags() { + return settingTags; + } + + public void setSettingTags(List settingTags) { + this.settingTags = settingTags; + } + + + public SettingValueModel rolloutRules(List rolloutRules) { + this.rolloutRules = rolloutRules; + return this; + } + + public SettingValueModel addRolloutRulesItem(RolloutRuleModel rolloutRulesItem) { + if (this.rolloutRules == null) { + this.rolloutRules = new ArrayList<>(); + } + this.rolloutRules.add(rolloutRulesItem); + return this; + } + + /** + * The targeting rule collection. + * @return rolloutRules + */ + @javax.annotation.Nonnull + public List getRolloutRules() { + return rolloutRules; + } + + public void setRolloutRules(List rolloutRules) { + this.rolloutRules = rolloutRules; + } + + + public SettingValueModel rolloutPercentageItems(List rolloutPercentageItems) { + this.rolloutPercentageItems = rolloutPercentageItems; + return this; + } + + public SettingValueModel addRolloutPercentageItemsItem(RolloutPercentageItemModel rolloutPercentageItemsItem) { + if (this.rolloutPercentageItems == null) { + this.rolloutPercentageItems = new ArrayList<>(); + } + this.rolloutPercentageItems.add(rolloutPercentageItemsItem); + return this; + } + + /** + * The percentage rule collection. + * @return rolloutPercentageItems + */ + @javax.annotation.Nonnull + public List getRolloutPercentageItems() { + return rolloutPercentageItems; + } + + public void setRolloutPercentageItems(List rolloutPercentageItems) { + this.rolloutPercentageItems = rolloutPercentageItems; + } + + + public SettingValueModel value(SettingValueType value) { + this.value = value; + return this; + } + + /** + * The value to serve. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. + * @return value + */ + @javax.annotation.Nonnull + public SettingValueType getValue() { + return value; + } + + public void setValue(SettingValueType value) { + this.value = value; + } + + + public SettingValueModel config(ConfigModel config) { + this.config = config; + return this; + } + + /** + * Get config + * @return config + */ + @javax.annotation.Nonnull + public ConfigModel getConfig() { + return config; + } + + public void setConfig(ConfigModel config) { + this.config = config; + } + + + public SettingValueModel environment(EnvironmentModel environment) { + this.environment = environment; + return this; + } + + /** + * Get environment + * @return environment + */ + @javax.annotation.Nonnull + public EnvironmentModel getEnvironment() { + return environment; + } + + public void setEnvironment(EnvironmentModel environment) { + this.environment = environment; + } + + + public SettingValueModel featureFlagLimitations(FeatureFlagLimitations featureFlagLimitations) { + this.featureFlagLimitations = featureFlagLimitations; + return this; + } + + /** + * Get featureFlagLimitations + * @return featureFlagLimitations + */ + @javax.annotation.Nonnull + public FeatureFlagLimitations getFeatureFlagLimitations() { + return featureFlagLimitations; + } + + public void setFeatureFlagLimitations(FeatureFlagLimitations featureFlagLimitations) { + this.featureFlagLimitations = featureFlagLimitations; + } + + + public SettingValueModel readOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Get readOnly + * @return readOnly + */ + @javax.annotation.Nonnull + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SettingValueModel instance itself + */ + public SettingValueModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SettingValueModel settingValueModel = (SettingValueModel) o; + return Objects.equals(this.setting, settingValueModel.setting) && + Objects.equals(this.updatedAt, settingValueModel.updatedAt) && + Objects.equals(this.lastUpdaterUserEmail, settingValueModel.lastUpdaterUserEmail) && + Objects.equals(this.lastUpdaterUserFullName, settingValueModel.lastUpdaterUserFullName) && + Objects.equals(this.integrationLinks, settingValueModel.integrationLinks) && + Objects.equals(this.settingTags, settingValueModel.settingTags) && + Objects.equals(this.rolloutRules, settingValueModel.rolloutRules) && + Objects.equals(this.rolloutPercentageItems, settingValueModel.rolloutPercentageItems) && + Objects.equals(this.value, settingValueModel.value) && + Objects.equals(this.config, settingValueModel.config) && + Objects.equals(this.environment, settingValueModel.environment) && + Objects.equals(this.featureFlagLimitations, settingValueModel.featureFlagLimitations) && + Objects.equals(this.readOnly, settingValueModel.readOnly)&& + Objects.equals(this.additionalProperties, settingValueModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(setting, updatedAt, lastUpdaterUserEmail, lastUpdaterUserFullName, integrationLinks, settingTags, rolloutRules, rolloutPercentageItems, value, config, environment, featureFlagLimitations, readOnly, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SettingValueModel {\n"); + sb.append(" setting: ").append(toIndentedString(setting)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" lastUpdaterUserEmail: ").append(toIndentedString(lastUpdaterUserEmail)).append("\n"); + sb.append(" lastUpdaterUserFullName: ").append(toIndentedString(lastUpdaterUserFullName)).append("\n"); + sb.append(" integrationLinks: ").append(toIndentedString(integrationLinks)).append("\n"); + sb.append(" settingTags: ").append(toIndentedString(settingTags)).append("\n"); + sb.append(" rolloutRules: ").append(toIndentedString(rolloutRules)).append("\n"); + sb.append(" rolloutPercentageItems: ").append(toIndentedString(rolloutPercentageItems)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); + sb.append(" featureFlagLimitations: ").append(toIndentedString(featureFlagLimitations)).append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("setting"); + openapiFields.add("updatedAt"); + openapiFields.add("lastUpdaterUserEmail"); + openapiFields.add("lastUpdaterUserFullName"); + openapiFields.add("integrationLinks"); + openapiFields.add("settingTags"); + openapiFields.add("rolloutRules"); + openapiFields.add("rolloutPercentageItems"); + openapiFields.add("value"); + openapiFields.add("config"); + openapiFields.add("environment"); + openapiFields.add("featureFlagLimitations"); + openapiFields.add("readOnly"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("setting"); + openapiRequiredFields.add("updatedAt"); + openapiRequiredFields.add("lastUpdaterUserEmail"); + openapiRequiredFields.add("lastUpdaterUserFullName"); + openapiRequiredFields.add("integrationLinks"); + openapiRequiredFields.add("settingTags"); + openapiRequiredFields.add("rolloutRules"); + openapiRequiredFields.add("rolloutPercentageItems"); + openapiRequiredFields.add("value"); + openapiRequiredFields.add("config"); + openapiRequiredFields.add("environment"); + openapiRequiredFields.add("featureFlagLimitations"); + openapiRequiredFields.add("readOnly"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SettingValueModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SettingValueModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SettingValueModel is not found in the empty JSON string", SettingValueModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SettingValueModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `setting` + SettingDataModel.validateJsonElement(jsonObj.get("setting")); + if ((jsonObj.get("lastUpdaterUserEmail") != null && !jsonObj.get("lastUpdaterUserEmail").isJsonNull()) && !jsonObj.get("lastUpdaterUserEmail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterUserEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterUserEmail").toString())); + } + if ((jsonObj.get("lastUpdaterUserFullName") != null && !jsonObj.get("lastUpdaterUserFullName").isJsonNull()) && !jsonObj.get("lastUpdaterUserFullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastUpdaterUserFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUpdaterUserFullName").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("integrationLinks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `integrationLinks` to be an array in the JSON string but got `%s`", jsonObj.get("integrationLinks").toString())); + } + + JsonArray jsonArrayintegrationLinks = jsonObj.getAsJsonArray("integrationLinks"); + // validate the required field `integrationLinks` (array) + for (int i = 0; i < jsonArrayintegrationLinks.size(); i++) { + IntegrationLinkModel.validateJsonElement(jsonArrayintegrationLinks.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("settingTags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `settingTags` to be an array in the JSON string but got `%s`", jsonObj.get("settingTags").toString())); + } + + JsonArray jsonArraysettingTags = jsonObj.getAsJsonArray("settingTags"); + // validate the required field `settingTags` (array) + for (int i = 0; i < jsonArraysettingTags.size(); i++) { + SettingTagModel.validateJsonElement(jsonArraysettingTags.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("rolloutRules").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rolloutRules` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutRules").toString())); + } + + JsonArray jsonArrayrolloutRules = jsonObj.getAsJsonArray("rolloutRules"); + // validate the required field `rolloutRules` (array) + for (int i = 0; i < jsonArrayrolloutRules.size(); i++) { + RolloutRuleModel.validateJsonElement(jsonArrayrolloutRules.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("rolloutPercentageItems").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rolloutPercentageItems` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutPercentageItems").toString())); + } + + JsonArray jsonArrayrolloutPercentageItems = jsonObj.getAsJsonArray("rolloutPercentageItems"); + // validate the required field `rolloutPercentageItems` (array) + for (int i = 0; i < jsonArrayrolloutPercentageItems.size(); i++) { + RolloutPercentageItemModel.validateJsonElement(jsonArrayrolloutPercentageItems.get(i)); + }; + // validate the required field `value` + SettingValueType.validateJsonElement(jsonObj.get("value")); + // validate the required field `config` + ConfigModel.validateJsonElement(jsonObj.get("config")); + // validate the required field `environment` + EnvironmentModel.validateJsonElement(jsonObj.get("environment")); + // validate the required field `featureFlagLimitations` + FeatureFlagLimitations.validateJsonElement(jsonObj.get("featureFlagLimitations")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SettingValueModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SettingValueModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SettingValueModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SettingValueModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SettingValueModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SettingValueModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SettingValueModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of SettingValueModel + * @throws IOException if the JSON string is invalid with respect to SettingValueModel + */ + public static SettingValueModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SettingValueModel.class); + } + + /** + * Convert an instance of SettingValueModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/SettingValueType.java b/src/main/java/com/configcat/publicapi/java/client/model/SettingValueType.java new file mode 100644 index 0000000..5f9844d --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/SettingValueType.java @@ -0,0 +1,320 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.configcat.publicapi.java.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class SettingValueType extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(SettingValueType.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SettingValueType.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SettingValueType' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterBoolean = gson.getDelegateAdapter(this, TypeToken.get(Boolean.class)); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter adapterDouble = gson.getDelegateAdapter(this, TypeToken.get(Double.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SettingValueType value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Boolean` + if (value.getActualInstance() instanceof Boolean) { + JsonPrimitive primitive = adapterBoolean.toJsonTree((Boolean)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Double` + if (value.getActualInstance() instanceof Double) { + JsonPrimitive primitive = adapterDouble.toJsonTree((Double)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Boolean, Double, String"); + } + + @Override + public SettingValueType read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Boolean + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isBoolean()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Boolean in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterBoolean; + match++; + log.log(Level.FINER, "Input data matches schema 'Boolean'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Boolean failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Boolean'", e); + } + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Double + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterDouble; + match++; + log.log(Level.FINER, "Input data matches schema 'Double'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Double failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Double'", e); + } + + if (match == 1) { + SettingValueType ret = new SettingValueType(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for SettingValueType: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public SettingValueType() { + super("oneOf", Boolean.FALSE); + } + + public SettingValueType(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Boolean", Boolean.class); + schemas.put("String", String.class); + schemas.put("Double", Double.class); + } + + @Override + public Map> getSchemas() { + return SettingValueType.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Boolean, Double, String + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Boolean) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Double) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Boolean, Double, String"); + } + + /** + * Get the actual instance, which can be the following: + * Boolean, Double, String + * + * @return The actual instance (Boolean, Double, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Boolean`. If the actual instance is not `Boolean`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Boolean` + * @throws ClassCastException if the instance is not `Boolean` + */ + public Boolean getBoolean() throws ClassCastException { + return (Boolean)super.getActualInstance(); + } + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + /** + * Get the actual instance of `Double`. If the actual instance is not `Double`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Double` + * @throws ClassCastException if the instance is not `Double` + */ + public Double getDouble() throws ClassCastException { + return (Double)super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SettingValueType + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with Boolean + try { + if (!jsonElement.getAsJsonPrimitive().isBoolean()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Boolean in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Boolean failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Double + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Double failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for SettingValueType with oneOf schemas: Boolean, Double, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of SettingValueType given an JSON string + * + * @param jsonString JSON string + * @return An instance of SettingValueType + * @throws IOException if the JSON string is invalid with respect to SettingValueType + */ + public static SettingValueType fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SettingValueType.class); + } + + /** + * Convert an instance of SettingValueType to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagConfigModel.java b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagConfigModel.java new file mode 100644 index 0000000..3722f44 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagConfigModel.java @@ -0,0 +1,431 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.EvaluationVersion; +import com.configcat.publicapi.java.client.model.StaleFlagSettingModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * StaleFlagConfigModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class StaleFlagConfigModel { + public static final String SERIALIZED_NAME_CONFIG_ID = "configId"; + @SerializedName(SERIALIZED_NAME_CONFIG_ID) + private UUID configId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_EVALUATION_VERSION = "evaluationVersion"; + @SerializedName(SERIALIZED_NAME_EVALUATION_VERSION) + private EvaluationVersion evaluationVersion; + + public static final String SERIALIZED_NAME_HAS_CODE_REFERENCES = "hasCodeReferences"; + @SerializedName(SERIALIZED_NAME_HAS_CODE_REFERENCES) + private Boolean hasCodeReferences; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + @SerializedName(SERIALIZED_NAME_SETTINGS) + private List settings = new ArrayList<>(); + + public StaleFlagConfigModel() { + } + + public StaleFlagConfigModel configId(UUID configId) { + this.configId = configId; + return this; + } + + /** + * Identifier of the Config. + * @return configId + */ + @javax.annotation.Nonnull + public UUID getConfigId() { + return configId; + } + + public void setConfigId(UUID configId) { + this.configId = configId; + } + + + public StaleFlagConfigModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Config. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public StaleFlagConfigModel evaluationVersion(EvaluationVersion evaluationVersion) { + this.evaluationVersion = evaluationVersion; + return this; + } + + /** + * Get evaluationVersion + * @return evaluationVersion + */ + @javax.annotation.Nonnull + public EvaluationVersion getEvaluationVersion() { + return evaluationVersion; + } + + public void setEvaluationVersion(EvaluationVersion evaluationVersion) { + this.evaluationVersion = evaluationVersion; + } + + + public StaleFlagConfigModel hasCodeReferences(Boolean hasCodeReferences) { + this.hasCodeReferences = hasCodeReferences; + return this; + } + + /** + * Config has code references uploaded. + * @return hasCodeReferences + */ + @javax.annotation.Nonnull + public Boolean getHasCodeReferences() { + return hasCodeReferences; + } + + public void setHasCodeReferences(Boolean hasCodeReferences) { + this.hasCodeReferences = hasCodeReferences; + } + + + public StaleFlagConfigModel settings(List settings) { + this.settings = settings; + return this; + } + + public StaleFlagConfigModel addSettingsItem(StaleFlagSettingModel settingsItem) { + if (this.settings == null) { + this.settings = new ArrayList<>(); + } + this.settings.add(settingsItem); + return this; + } + + /** + * Stale feature flags. + * @return settings + */ + @javax.annotation.Nonnull + public List getSettings() { + return settings; + } + + public void setSettings(List settings) { + this.settings = settings; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the StaleFlagConfigModel instance itself + */ + public StaleFlagConfigModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StaleFlagConfigModel staleFlagConfigModel = (StaleFlagConfigModel) o; + return Objects.equals(this.configId, staleFlagConfigModel.configId) && + Objects.equals(this.name, staleFlagConfigModel.name) && + Objects.equals(this.evaluationVersion, staleFlagConfigModel.evaluationVersion) && + Objects.equals(this.hasCodeReferences, staleFlagConfigModel.hasCodeReferences) && + Objects.equals(this.settings, staleFlagConfigModel.settings)&& + Objects.equals(this.additionalProperties, staleFlagConfigModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(configId, name, evaluationVersion, hasCodeReferences, settings, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StaleFlagConfigModel {\n"); + sb.append(" configId: ").append(toIndentedString(configId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" evaluationVersion: ").append(toIndentedString(evaluationVersion)).append("\n"); + sb.append(" hasCodeReferences: ").append(toIndentedString(hasCodeReferences)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("configId"); + openapiFields.add("name"); + openapiFields.add("evaluationVersion"); + openapiFields.add("hasCodeReferences"); + openapiFields.add("settings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("configId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("evaluationVersion"); + openapiRequiredFields.add("hasCodeReferences"); + openapiRequiredFields.add("settings"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StaleFlagConfigModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StaleFlagConfigModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StaleFlagConfigModel is not found in the empty JSON string", StaleFlagConfigModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StaleFlagConfigModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("configId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `configId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("configId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + // validate the required field `evaluationVersion` + EvaluationVersion.validateJsonElement(jsonObj.get("evaluationVersion")); + // ensure the json data is an array + if (!jsonObj.get("settings").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `settings` to be an array in the JSON string but got `%s`", jsonObj.get("settings").toString())); + } + + JsonArray jsonArraysettings = jsonObj.getAsJsonArray("settings"); + // validate the required field `settings` (array) + for (int i = 0; i < jsonArraysettings.size(); i++) { + StaleFlagSettingModel.validateJsonElement(jsonArraysettings.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StaleFlagConfigModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StaleFlagConfigModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StaleFlagConfigModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StaleFlagConfigModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public StaleFlagConfigModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + StaleFlagConfigModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StaleFlagConfigModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of StaleFlagConfigModel + * @throws IOException if the JSON string is invalid with respect to StaleFlagConfigModel + */ + public static StaleFlagConfigModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StaleFlagConfigModel.class); + } + + /** + * Convert an instance of StaleFlagConfigModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagEnvironmentModel.java b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagEnvironmentModel.java new file mode 100644 index 0000000..0a357ac --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagEnvironmentModel.java @@ -0,0 +1,326 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * StaleFlagEnvironmentModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class StaleFlagEnvironmentModel { + public static final String SERIALIZED_NAME_ENVIRONMENT_ID = "environmentId"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) + private UUID environmentId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public StaleFlagEnvironmentModel() { + } + + public StaleFlagEnvironmentModel environmentId(UUID environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Identifier of the Environment. + * @return environmentId + */ + @javax.annotation.Nonnull + public UUID getEnvironmentId() { + return environmentId; + } + + public void setEnvironmentId(UUID environmentId) { + this.environmentId = environmentId; + } + + + public StaleFlagEnvironmentModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Environment. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the StaleFlagEnvironmentModel instance itself + */ + public StaleFlagEnvironmentModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StaleFlagEnvironmentModel staleFlagEnvironmentModel = (StaleFlagEnvironmentModel) o; + return Objects.equals(this.environmentId, staleFlagEnvironmentModel.environmentId) && + Objects.equals(this.name, staleFlagEnvironmentModel.name)&& + Objects.equals(this.additionalProperties, staleFlagEnvironmentModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(environmentId, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StaleFlagEnvironmentModel {\n"); + sb.append(" environmentId: ").append(toIndentedString(environmentId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("environmentId"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("environmentId"); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StaleFlagEnvironmentModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StaleFlagEnvironmentModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StaleFlagEnvironmentModel is not found in the empty JSON string", StaleFlagEnvironmentModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StaleFlagEnvironmentModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("environmentId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `environmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StaleFlagEnvironmentModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StaleFlagEnvironmentModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StaleFlagEnvironmentModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StaleFlagEnvironmentModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public StaleFlagEnvironmentModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + StaleFlagEnvironmentModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StaleFlagEnvironmentModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of StaleFlagEnvironmentModel + * @throws IOException if the JSON string is invalid with respect to StaleFlagEnvironmentModel + */ + public static StaleFlagEnvironmentModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StaleFlagEnvironmentModel.class); + } + + /** + * Convert an instance of StaleFlagEnvironmentModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagProductModel.java b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagProductModel.java new file mode 100644 index 0000000..c35f7be --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagProductModel.java @@ -0,0 +1,420 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.StaleFlagConfigModel; +import com.configcat.publicapi.java.client.model.StaleFlagEnvironmentModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * StaleFlagProductModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class StaleFlagProductModel { + public static final String SERIALIZED_NAME_PRODUCT_ID = "productId"; + @SerializedName(SERIALIZED_NAME_PRODUCT_ID) + private UUID productId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_CONFIGS = "configs"; + @SerializedName(SERIALIZED_NAME_CONFIGS) + private List configs = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ENVIRONMENTS = "environments"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENTS) + private List environments = new ArrayList<>(); + + public StaleFlagProductModel() { + } + + public StaleFlagProductModel productId(UUID productId) { + this.productId = productId; + return this; + } + + /** + * Identifier of the Product. + * @return productId + */ + @javax.annotation.Nonnull + public UUID getProductId() { + return productId; + } + + public void setProductId(UUID productId) { + this.productId = productId; + } + + + public StaleFlagProductModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Product. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public StaleFlagProductModel configs(List configs) { + this.configs = configs; + return this; + } + + public StaleFlagProductModel addConfigsItem(StaleFlagConfigModel configsItem) { + if (this.configs == null) { + this.configs = new ArrayList<>(); + } + this.configs.add(configsItem); + return this; + } + + /** + * Configs that contain stale feature flags. + * @return configs + */ + @javax.annotation.Nonnull + public List getConfigs() { + return configs; + } + + public void setConfigs(List configs) { + this.configs = configs; + } + + + public StaleFlagProductModel environments(List environments) { + this.environments = environments; + return this; + } + + public StaleFlagProductModel addEnvironmentsItem(StaleFlagEnvironmentModel environmentsItem) { + if (this.environments == null) { + this.environments = new ArrayList<>(); + } + this.environments.add(environmentsItem); + return this; + } + + /** + * Environment list. + * @return environments + */ + @javax.annotation.Nonnull + public List getEnvironments() { + return environments; + } + + public void setEnvironments(List environments) { + this.environments = environments; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the StaleFlagProductModel instance itself + */ + public StaleFlagProductModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StaleFlagProductModel staleFlagProductModel = (StaleFlagProductModel) o; + return Objects.equals(this.productId, staleFlagProductModel.productId) && + Objects.equals(this.name, staleFlagProductModel.name) && + Objects.equals(this.configs, staleFlagProductModel.configs) && + Objects.equals(this.environments, staleFlagProductModel.environments)&& + Objects.equals(this.additionalProperties, staleFlagProductModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(productId, name, configs, environments, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StaleFlagProductModel {\n"); + sb.append(" productId: ").append(toIndentedString(productId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" configs: ").append(toIndentedString(configs)).append("\n"); + sb.append(" environments: ").append(toIndentedString(environments)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("productId"); + openapiFields.add("name"); + openapiFields.add("configs"); + openapiFields.add("environments"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("productId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("configs"); + openapiRequiredFields.add("environments"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StaleFlagProductModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StaleFlagProductModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StaleFlagProductModel is not found in the empty JSON string", StaleFlagProductModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StaleFlagProductModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("productId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `productId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("configs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `configs` to be an array in the JSON string but got `%s`", jsonObj.get("configs").toString())); + } + + JsonArray jsonArrayconfigs = jsonObj.getAsJsonArray("configs"); + // validate the required field `configs` (array) + for (int i = 0; i < jsonArrayconfigs.size(); i++) { + StaleFlagConfigModel.validateJsonElement(jsonArrayconfigs.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("environments").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `environments` to be an array in the JSON string but got `%s`", jsonObj.get("environments").toString())); + } + + JsonArray jsonArrayenvironments = jsonObj.getAsJsonArray("environments"); + // validate the required field `environments` (array) + for (int i = 0; i < jsonArrayenvironments.size(); i++) { + StaleFlagEnvironmentModel.validateJsonElement(jsonArrayenvironments.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StaleFlagProductModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StaleFlagProductModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StaleFlagProductModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StaleFlagProductModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public StaleFlagProductModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + StaleFlagProductModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StaleFlagProductModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of StaleFlagProductModel + * @throws IOException if the JSON string is invalid with respect to StaleFlagProductModel + */ + public static StaleFlagProductModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StaleFlagProductModel.class); + } + + /** + * Convert an instance of StaleFlagProductModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagReminderScope.java b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagReminderScope.java new file mode 100644 index 0000000..7a8ce7f --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagReminderScope.java @@ -0,0 +1,78 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets StaleFlagReminderScope + */ +@JsonAdapter(StaleFlagReminderScope.Adapter.class) +public enum StaleFlagReminderScope { + + ALL("all"), + + WATCHED_BY_ME("watchedByMe"); + + private String value; + + StaleFlagReminderScope(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StaleFlagReminderScope fromValue(String value) { + for (StaleFlagReminderScope b : StaleFlagReminderScope.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StaleFlagReminderScope enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StaleFlagReminderScope read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StaleFlagReminderScope.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StaleFlagReminderScope.fromValue(value); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingModel.java b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingModel.java new file mode 100644 index 0000000..93aceef --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingModel.java @@ -0,0 +1,503 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.StaleFlagSettingTagModel; +import com.configcat.publicapi.java.client.model.StaleFlagSettingValueModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * StaleFlagSettingModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class StaleFlagSettingModel { + public static final String SERIALIZED_NAME_SETTING_ID = "settingId"; + @SerializedName(SERIALIZED_NAME_SETTING_ID) + private Integer settingId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_HINT = "hint"; + @SerializedName(SERIALIZED_NAME_HINT) + private String hint; + + public static final String SERIALIZED_NAME_HAS_CODE_REFERENCES = "hasCodeReferences"; + @SerializedName(SERIALIZED_NAME_HAS_CODE_REFERENCES) + private Boolean hasCodeReferences; + + public static final String SERIALIZED_NAME_TAGS = "tags"; + @SerializedName(SERIALIZED_NAME_TAGS) + private List tags = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SETTING_VALUES = "settingValues"; + @SerializedName(SERIALIZED_NAME_SETTING_VALUES) + private List settingValues = new ArrayList<>(); + + public StaleFlagSettingModel() { + } + + public StaleFlagSettingModel settingId(Integer settingId) { + this.settingId = settingId; + return this; + } + + /** + * Identifier of the Feature Flag or Setting. + * @return settingId + */ + @javax.annotation.Nonnull + public Integer getSettingId() { + return settingId; + } + + public void setSettingId(Integer settingId) { + this.settingId = settingId; + } + + + public StaleFlagSettingModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Feature Flag or Setting. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public StaleFlagSettingModel key(String key) { + this.key = key; + return this; + } + + /** + * Key of the Feature Flag or Setting. + * @return key + */ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + + public StaleFlagSettingModel hint(String hint) { + this.hint = hint; + return this; + } + + /** + * Description of the Feature Flag or Setting. + * @return hint + */ + @javax.annotation.Nullable + public String getHint() { + return hint; + } + + public void setHint(String hint) { + this.hint = hint; + } + + + public StaleFlagSettingModel hasCodeReferences(Boolean hasCodeReferences) { + this.hasCodeReferences = hasCodeReferences; + return this; + } + + /** + * Feature Flag or Setting has code references uploaded. + * @return hasCodeReferences + */ + @javax.annotation.Nonnull + public Boolean getHasCodeReferences() { + return hasCodeReferences; + } + + public void setHasCodeReferences(Boolean hasCodeReferences) { + this.hasCodeReferences = hasCodeReferences; + } + + + public StaleFlagSettingModel tags(List tags) { + this.tags = tags; + return this; + } + + public StaleFlagSettingModel addTagsItem(StaleFlagSettingTagModel tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * The tags' identifiers attached to the Feature Flag or Setting. + * @return tags + */ + @javax.annotation.Nonnull + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + + public StaleFlagSettingModel settingValues(List settingValues) { + this.settingValues = settingValues; + return this; + } + + public StaleFlagSettingModel addSettingValuesItem(StaleFlagSettingValueModel settingValuesItem) { + if (this.settingValues == null) { + this.settingValues = new ArrayList<>(); + } + this.settingValues.add(settingValuesItem); + return this; + } + + /** + * Environment level feature flag stale data. + * @return settingValues + */ + @javax.annotation.Nonnull + public List getSettingValues() { + return settingValues; + } + + public void setSettingValues(List settingValues) { + this.settingValues = settingValues; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the StaleFlagSettingModel instance itself + */ + public StaleFlagSettingModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StaleFlagSettingModel staleFlagSettingModel = (StaleFlagSettingModel) o; + return Objects.equals(this.settingId, staleFlagSettingModel.settingId) && + Objects.equals(this.name, staleFlagSettingModel.name) && + Objects.equals(this.key, staleFlagSettingModel.key) && + Objects.equals(this.hint, staleFlagSettingModel.hint) && + Objects.equals(this.hasCodeReferences, staleFlagSettingModel.hasCodeReferences) && + Objects.equals(this.tags, staleFlagSettingModel.tags) && + Objects.equals(this.settingValues, staleFlagSettingModel.settingValues)&& + Objects.equals(this.additionalProperties, staleFlagSettingModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(settingId, name, key, hint, hasCodeReferences, tags, settingValues, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StaleFlagSettingModel {\n"); + sb.append(" settingId: ").append(toIndentedString(settingId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" hint: ").append(toIndentedString(hint)).append("\n"); + sb.append(" hasCodeReferences: ").append(toIndentedString(hasCodeReferences)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" settingValues: ").append(toIndentedString(settingValues)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("settingId"); + openapiFields.add("name"); + openapiFields.add("key"); + openapiFields.add("hint"); + openapiFields.add("hasCodeReferences"); + openapiFields.add("tags"); + openapiFields.add("settingValues"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("settingId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("hint"); + openapiRequiredFields.add("hasCodeReferences"); + openapiRequiredFields.add("tags"); + openapiRequiredFields.add("settingValues"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StaleFlagSettingModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StaleFlagSettingModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StaleFlagSettingModel is not found in the empty JSON string", StaleFlagSettingModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StaleFlagSettingModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if ((jsonObj.get("hint") != null && !jsonObj.get("hint").isJsonNull()) && !jsonObj.get("hint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hint").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("tags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); + } + + JsonArray jsonArraytags = jsonObj.getAsJsonArray("tags"); + // validate the required field `tags` (array) + for (int i = 0; i < jsonArraytags.size(); i++) { + StaleFlagSettingTagModel.validateJsonElement(jsonArraytags.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("settingValues").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `settingValues` to be an array in the JSON string but got `%s`", jsonObj.get("settingValues").toString())); + } + + JsonArray jsonArraysettingValues = jsonObj.getAsJsonArray("settingValues"); + // validate the required field `settingValues` (array) + for (int i = 0; i < jsonArraysettingValues.size(); i++) { + StaleFlagSettingValueModel.validateJsonElement(jsonArraysettingValues.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StaleFlagSettingModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StaleFlagSettingModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StaleFlagSettingModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StaleFlagSettingModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public StaleFlagSettingModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + StaleFlagSettingModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StaleFlagSettingModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of StaleFlagSettingModel + * @throws IOException if the JSON string is invalid with respect to StaleFlagSettingModel + */ + public static StaleFlagSettingModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StaleFlagSettingModel.class); + } + + /** + * Convert an instance of StaleFlagSettingModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingTagModel.java b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingTagModel.java new file mode 100644 index 0000000..110f0c8 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingTagModel.java @@ -0,0 +1,319 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * StaleFlagSettingTagModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class StaleFlagSettingTagModel { + public static final String SERIALIZED_NAME_TAG_ID = "tagId"; + @SerializedName(SERIALIZED_NAME_TAG_ID) + private Long tagId; + + public static final String SERIALIZED_NAME_SETTING_TAG_ID = "settingTagId"; + @SerializedName(SERIALIZED_NAME_SETTING_TAG_ID) + private Long settingTagId; + + public StaleFlagSettingTagModel() { + } + + public StaleFlagSettingTagModel tagId(Long tagId) { + this.tagId = tagId; + return this; + } + + /** + * Get tagId + * @return tagId + */ + @javax.annotation.Nonnull + public Long getTagId() { + return tagId; + } + + public void setTagId(Long tagId) { + this.tagId = tagId; + } + + + public StaleFlagSettingTagModel settingTagId(Long settingTagId) { + this.settingTagId = settingTagId; + return this; + } + + /** + * Get settingTagId + * @return settingTagId + */ + @javax.annotation.Nonnull + public Long getSettingTagId() { + return settingTagId; + } + + public void setSettingTagId(Long settingTagId) { + this.settingTagId = settingTagId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the StaleFlagSettingTagModel instance itself + */ + public StaleFlagSettingTagModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StaleFlagSettingTagModel staleFlagSettingTagModel = (StaleFlagSettingTagModel) o; + return Objects.equals(this.tagId, staleFlagSettingTagModel.tagId) && + Objects.equals(this.settingTagId, staleFlagSettingTagModel.settingTagId)&& + Objects.equals(this.additionalProperties, staleFlagSettingTagModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(tagId, settingTagId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StaleFlagSettingTagModel {\n"); + sb.append(" tagId: ").append(toIndentedString(tagId)).append("\n"); + sb.append(" settingTagId: ").append(toIndentedString(settingTagId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("tagId"); + openapiFields.add("settingTagId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("tagId"); + openapiRequiredFields.add("settingTagId"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StaleFlagSettingTagModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StaleFlagSettingTagModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StaleFlagSettingTagModel is not found in the empty JSON string", StaleFlagSettingTagModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StaleFlagSettingTagModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StaleFlagSettingTagModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StaleFlagSettingTagModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StaleFlagSettingTagModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StaleFlagSettingTagModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public StaleFlagSettingTagModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + StaleFlagSettingTagModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StaleFlagSettingTagModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of StaleFlagSettingTagModel + * @throws IOException if the JSON string is invalid with respect to StaleFlagSettingTagModel + */ + public static StaleFlagSettingTagModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StaleFlagSettingTagModel.class); + } + + /** + * Convert an instance of StaleFlagSettingTagModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingValueModel.java b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingValueModel.java new file mode 100644 index 0000000..72d3e1b --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagSettingValueModel.java @@ -0,0 +1,351 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * StaleFlagSettingValueModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class StaleFlagSettingValueModel { + public static final String SERIALIZED_NAME_ENVIRONMENT_ID = "environmentId"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) + private UUID environmentId; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_IS_STALE = "isStale"; + @SerializedName(SERIALIZED_NAME_IS_STALE) + private Boolean isStale; + + public StaleFlagSettingValueModel() { + } + + public StaleFlagSettingValueModel environmentId(UUID environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Identifier of the Environment. + * @return environmentId + */ + @javax.annotation.Nonnull + public UUID getEnvironmentId() { + return environmentId; + } + + public void setEnvironmentId(UUID environmentId) { + this.environmentId = environmentId; + } + + + public StaleFlagSettingValueModel updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * The last updated date and time when the Feature Flag or Setting. + * @return updatedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + public StaleFlagSettingValueModel isStale(Boolean isStale) { + this.isStale = isStale; + return this; + } + + /** + * Is the feature flag considered stale in the environment. + * @return isStale + */ + @javax.annotation.Nonnull + public Boolean getIsStale() { + return isStale; + } + + public void setIsStale(Boolean isStale) { + this.isStale = isStale; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the StaleFlagSettingValueModel instance itself + */ + public StaleFlagSettingValueModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StaleFlagSettingValueModel staleFlagSettingValueModel = (StaleFlagSettingValueModel) o; + return Objects.equals(this.environmentId, staleFlagSettingValueModel.environmentId) && + Objects.equals(this.updatedAt, staleFlagSettingValueModel.updatedAt) && + Objects.equals(this.isStale, staleFlagSettingValueModel.isStale)&& + Objects.equals(this.additionalProperties, staleFlagSettingValueModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(environmentId, updatedAt, isStale, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StaleFlagSettingValueModel {\n"); + sb.append(" environmentId: ").append(toIndentedString(environmentId)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" isStale: ").append(toIndentedString(isStale)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("environmentId"); + openapiFields.add("updatedAt"); + openapiFields.add("isStale"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("environmentId"); + openapiRequiredFields.add("updatedAt"); + openapiRequiredFields.add("isStale"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StaleFlagSettingValueModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StaleFlagSettingValueModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StaleFlagSettingValueModel is not found in the empty JSON string", StaleFlagSettingValueModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StaleFlagSettingValueModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("environmentId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `environmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StaleFlagSettingValueModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StaleFlagSettingValueModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StaleFlagSettingValueModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StaleFlagSettingValueModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public StaleFlagSettingValueModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + StaleFlagSettingValueModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StaleFlagSettingValueModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of StaleFlagSettingValueModel + * @throws IOException if the JSON string is invalid with respect to StaleFlagSettingValueModel + */ + public static StaleFlagSettingValueModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StaleFlagSettingValueModel.class); + } + + /** + * Convert an instance of StaleFlagSettingValueModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagStaleInEnvironmentsType.java b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagStaleInEnvironmentsType.java new file mode 100644 index 0000000..4e41b7e --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/StaleFlagStaleInEnvironmentsType.java @@ -0,0 +1,78 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets StaleFlagStaleInEnvironmentsType + */ +@JsonAdapter(StaleFlagStaleInEnvironmentsType.Adapter.class) +public enum StaleFlagStaleInEnvironmentsType { + + STALE_IN_ANY_ENVIRONMENTS("staleInAnyEnvironments"), + + STALE_IN_ALL_ENVIRONMENTS("staleInAllEnvironments"); + + private String value; + + StaleFlagStaleInEnvironmentsType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StaleFlagStaleInEnvironmentsType fromValue(String value) { + for (StaleFlagStaleInEnvironmentsType b : StaleFlagStaleInEnvironmentsType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StaleFlagStaleInEnvironmentsType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StaleFlagStaleInEnvironmentsType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StaleFlagStaleInEnvironmentsType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StaleFlagStaleInEnvironmentsType.fromValue(value); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/TagModel.java b/src/main/java/com/configcat/publicapi/java/client/model/TagModel.java new file mode 100644 index 0000000..190e480 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/TagModel.java @@ -0,0 +1,382 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.ProductModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * TagModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class TagModel { + public static final String SERIALIZED_NAME_PRODUCT = "product"; + @SerializedName(SERIALIZED_NAME_PRODUCT) + private ProductModel product; + + public static final String SERIALIZED_NAME_TAG_ID = "tagId"; + @SerializedName(SERIALIZED_NAME_TAG_ID) + private Long tagId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_COLOR = "color"; + @SerializedName(SERIALIZED_NAME_COLOR) + private String color; + + public TagModel() { + } + + public TagModel product(ProductModel product) { + this.product = product; + return this; + } + + /** + * Get product + * @return product + */ + @javax.annotation.Nonnull + public ProductModel getProduct() { + return product; + } + + public void setProduct(ProductModel product) { + this.product = product; + } + + + public TagModel tagId(Long tagId) { + this.tagId = tagId; + return this; + } + + /** + * Identifier of the Tag. + * @return tagId + */ + @javax.annotation.Nonnull + public Long getTagId() { + return tagId; + } + + public void setTagId(Long tagId) { + this.tagId = tagId; + } + + + public TagModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Tag. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public TagModel color(String color) { + this.color = color; + return this; + } + + /** + * The configured color of the Tag. + * @return color + */ + @javax.annotation.Nullable + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the TagModel instance itself + */ + public TagModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TagModel tagModel = (TagModel) o; + return Objects.equals(this.product, tagModel.product) && + Objects.equals(this.tagId, tagModel.tagId) && + Objects.equals(this.name, tagModel.name) && + Objects.equals(this.color, tagModel.color)&& + Objects.equals(this.additionalProperties, tagModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(product, tagId, name, color, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TagModel {\n"); + sb.append(" product: ").append(toIndentedString(product)).append("\n"); + sb.append(" tagId: ").append(toIndentedString(tagId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("product"); + openapiFields.add("tagId"); + openapiFields.add("name"); + openapiFields.add("color"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("product"); + openapiRequiredFields.add("tagId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("color"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TagModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TagModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TagModel is not found in the empty JSON string", TagModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TagModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `product` + ProductModel.validateJsonElement(jsonObj.get("product")); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("color") != null && !jsonObj.get("color").isJsonNull()) && !jsonObj.get("color").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TagModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TagModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TagModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TagModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public TagModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + TagModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TagModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of TagModel + * @throws IOException if the JSON string is invalid with respect to TagModel + */ + public static TagModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TagModel.class); + } + + /** + * Convert an instance of TagModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/TargetingRuleModel.java b/src/main/java/com/configcat/publicapi/java/client/model/TargetingRuleModel.java new file mode 100644 index 0000000..3d021c1 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/TargetingRuleModel.java @@ -0,0 +1,389 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.ConditionModel; +import com.configcat.publicapi.java.client.model.PercentageOptionModel; +import com.configcat.publicapi.java.client.model.ValueModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * TargetingRuleModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class TargetingRuleModel { + public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; + @SerializedName(SERIALIZED_NAME_CONDITIONS) + private List conditions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PERCENTAGE_OPTIONS = "percentageOptions"; + @SerializedName(SERIALIZED_NAME_PERCENTAGE_OPTIONS) + private List percentageOptions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private ValueModel value; + + public TargetingRuleModel() { + } + + public TargetingRuleModel conditions(List conditions) { + this.conditions = conditions; + return this; + } + + public TargetingRuleModel addConditionsItem(ConditionModel conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList<>(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * The list of conditions that are combined with logical AND operators. It can be one of the following: - User condition - Segment condition - Prerequisite flag condition + * @return conditions + */ + @javax.annotation.Nonnull + public List getConditions() { + return conditions; + } + + public void setConditions(List conditions) { + this.conditions = conditions; + } + + + public TargetingRuleModel percentageOptions(List percentageOptions) { + this.percentageOptions = percentageOptions; + return this; + } + + public TargetingRuleModel addPercentageOptionsItem(PercentageOptionModel percentageOptionsItem) { + if (this.percentageOptions == null) { + this.percentageOptions = new ArrayList<>(); + } + this.percentageOptions.add(percentageOptionsItem); + return this; + } + + /** + * The percentage options from where the evaluation process will choose a value based on the flag's percentage evaluation attribute. + * @return percentageOptions + */ + @javax.annotation.Nonnull + public List getPercentageOptions() { + return percentageOptions; + } + + public void setPercentageOptions(List percentageOptions) { + this.percentageOptions = percentageOptions; + } + + + public TargetingRuleModel value(ValueModel value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nullable + public ValueModel getValue() { + return value; + } + + public void setValue(ValueModel value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the TargetingRuleModel instance itself + */ + public TargetingRuleModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TargetingRuleModel targetingRuleModel = (TargetingRuleModel) o; + return Objects.equals(this.conditions, targetingRuleModel.conditions) && + Objects.equals(this.percentageOptions, targetingRuleModel.percentageOptions) && + Objects.equals(this.value, targetingRuleModel.value)&& + Objects.equals(this.additionalProperties, targetingRuleModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(conditions, percentageOptions, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TargetingRuleModel {\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append(" percentageOptions: ").append(toIndentedString(percentageOptions)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("conditions"); + openapiFields.add("percentageOptions"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("conditions"); + openapiRequiredFields.add("percentageOptions"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TargetingRuleModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TargetingRuleModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TargetingRuleModel is not found in the empty JSON string", TargetingRuleModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TargetingRuleModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("conditions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `conditions` to be an array in the JSON string but got `%s`", jsonObj.get("conditions").toString())); + } + + JsonArray jsonArrayconditions = jsonObj.getAsJsonArray("conditions"); + // validate the required field `conditions` (array) + for (int i = 0; i < jsonArrayconditions.size(); i++) { + ConditionModel.validateJsonElement(jsonArrayconditions.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("percentageOptions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `percentageOptions` to be an array in the JSON string but got `%s`", jsonObj.get("percentageOptions").toString())); + } + + JsonArray jsonArraypercentageOptions = jsonObj.getAsJsonArray("percentageOptions"); + // validate the required field `percentageOptions` (array) + for (int i = 0; i < jsonArraypercentageOptions.size(); i++) { + PercentageOptionModel.validateJsonElement(jsonArraypercentageOptions.get(i)); + }; + // validate the required field `value` + ValueModel.validateJsonElement(jsonObj.get("value")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TargetingRuleModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TargetingRuleModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TargetingRuleModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TargetingRuleModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public TargetingRuleModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + TargetingRuleModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TargetingRuleModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of TargetingRuleModel + * @throws IOException if the JSON string is invalid with respect to TargetingRuleModel + */ + public static TargetingRuleModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TargetingRuleModel.class); + } + + /** + * Convert an instance of TargetingRuleModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateComparisonValueListModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateComparisonValueListModel.java new file mode 100644 index 0000000..a25ef52 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateComparisonValueListModel.java @@ -0,0 +1,336 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdateComparisonValueListModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateComparisonValueListModel { + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_HINT = "hint"; + @SerializedName(SERIALIZED_NAME_HINT) + private String hint; + + public UpdateComparisonValueListModel() { + } + + public UpdateComparisonValueListModel value(String value) { + this.value = value; + return this; + } + + /** + * The actual comparison value. + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + + public UpdateComparisonValueListModel hint(String hint) { + this.hint = hint; + return this; + } + + /** + * An optional hint for the comparison value. + * @return hint + */ + @javax.annotation.Nullable + public String getHint() { + return hint; + } + + public void setHint(String hint) { + this.hint = hint; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateComparisonValueListModel instance itself + */ + public UpdateComparisonValueListModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateComparisonValueListModel updateComparisonValueListModel = (UpdateComparisonValueListModel) o; + return Objects.equals(this.value, updateComparisonValueListModel.value) && + Objects.equals(this.hint, updateComparisonValueListModel.hint)&& + Objects.equals(this.additionalProperties, updateComparisonValueListModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(value, hint, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateComparisonValueListModel {\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" hint: ").append(toIndentedString(hint)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("value"); + openapiFields.add("hint"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateComparisonValueListModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateComparisonValueListModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateComparisonValueListModel is not found in the empty JSON string", UpdateComparisonValueListModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateComparisonValueListModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + if ((jsonObj.get("hint") != null && !jsonObj.get("hint").isJsonNull()) && !jsonObj.get("hint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hint").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateComparisonValueListModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateComparisonValueListModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateComparisonValueListModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateComparisonValueListModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateComparisonValueListModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateComparisonValueListModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateComparisonValueListModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateComparisonValueListModel + * @throws IOException if the JSON string is invalid with respect to UpdateComparisonValueListModel + */ + public static UpdateComparisonValueListModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateComparisonValueListModel.class); + } + + /** + * Convert an instance of UpdateComparisonValueListModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateComparisonValueModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateComparisonValueModel.java new file mode 100644 index 0000000..c36dab3 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateComparisonValueModel.java @@ -0,0 +1,376 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.UpdateComparisonValueListModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * The value that the user object's attribute is compared to. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateComparisonValueModel { + public static final String SERIALIZED_NAME_STRING_VALUE = "stringValue"; + @SerializedName(SERIALIZED_NAME_STRING_VALUE) + private String stringValue; + + public static final String SERIALIZED_NAME_DOUBLE_VALUE = "doubleValue"; + @SerializedName(SERIALIZED_NAME_DOUBLE_VALUE) + private Double doubleValue; + + public static final String SERIALIZED_NAME_LIST_VALUE = "listValue"; + @SerializedName(SERIALIZED_NAME_LIST_VALUE) + private List listValue; + + public UpdateComparisonValueModel() { + } + + public UpdateComparisonValueModel stringValue(String stringValue) { + this.stringValue = stringValue; + return this; + } + + /** + * The string representation of the comparison value. + * @return stringValue + */ + @javax.annotation.Nullable + public String getStringValue() { + return stringValue; + } + + public void setStringValue(String stringValue) { + this.stringValue = stringValue; + } + + + public UpdateComparisonValueModel doubleValue(Double doubleValue) { + this.doubleValue = doubleValue; + return this; + } + + /** + * The number representation of the comparison value. + * @return doubleValue + */ + @javax.annotation.Nullable + public Double getDoubleValue() { + return doubleValue; + } + + public void setDoubleValue(Double doubleValue) { + this.doubleValue = doubleValue; + } + + + public UpdateComparisonValueModel listValue(List listValue) { + this.listValue = listValue; + return this; + } + + public UpdateComparisonValueModel addListValueItem(UpdateComparisonValueListModel listValueItem) { + if (this.listValue == null) { + this.listValue = new ArrayList<>(); + } + this.listValue.add(listValueItem); + return this; + } + + /** + * The list representation of the comparison value. + * @return listValue + */ + @javax.annotation.Nullable + public List getListValue() { + return listValue; + } + + public void setListValue(List listValue) { + this.listValue = listValue; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateComparisonValueModel instance itself + */ + public UpdateComparisonValueModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateComparisonValueModel updateComparisonValueModel = (UpdateComparisonValueModel) o; + return Objects.equals(this.stringValue, updateComparisonValueModel.stringValue) && + Objects.equals(this.doubleValue, updateComparisonValueModel.doubleValue) && + Objects.equals(this.listValue, updateComparisonValueModel.listValue)&& + Objects.equals(this.additionalProperties, updateComparisonValueModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(stringValue, doubleValue, listValue, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateComparisonValueModel {\n"); + sb.append(" stringValue: ").append(toIndentedString(stringValue)).append("\n"); + sb.append(" doubleValue: ").append(toIndentedString(doubleValue)).append("\n"); + sb.append(" listValue: ").append(toIndentedString(listValue)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("stringValue"); + openapiFields.add("doubleValue"); + openapiFields.add("listValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateComparisonValueModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateComparisonValueModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateComparisonValueModel is not found in the empty JSON string", UpdateComparisonValueModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("stringValue") != null && !jsonObj.get("stringValue").isJsonNull()) && !jsonObj.get("stringValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stringValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stringValue").toString())); + } + if (jsonObj.get("listValue") != null && !jsonObj.get("listValue").isJsonNull()) { + JsonArray jsonArraylistValue = jsonObj.getAsJsonArray("listValue"); + if (jsonArraylistValue != null) { + // ensure the json data is an array + if (!jsonObj.get("listValue").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `listValue` to be an array in the JSON string but got `%s`", jsonObj.get("listValue").toString())); + } + + // validate the optional field `listValue` (array) + for (int i = 0; i < jsonArraylistValue.size(); i++) { + UpdateComparisonValueListModel.validateJsonElement(jsonArraylistValue.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateComparisonValueModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateComparisonValueModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateComparisonValueModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateComparisonValueModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateComparisonValueModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateComparisonValueModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateComparisonValueModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateComparisonValueModel + * @throws IOException if the JSON string is invalid with respect to UpdateComparisonValueModel + */ + public static UpdateComparisonValueModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateComparisonValueModel.class); + } + + /** + * Convert an instance of UpdateComparisonValueModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateConditionModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateConditionModel.java new file mode 100644 index 0000000..016d3da --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateConditionModel.java @@ -0,0 +1,363 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.UpdatePrerequisiteFlagConditionModel; +import com.configcat.publicapi.java.client.model.UpdateSegmentConditionModel; +import com.configcat.publicapi.java.client.model.UpdateUserConditionModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdateConditionModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateConditionModel { + public static final String SERIALIZED_NAME_USER_CONDITION = "userCondition"; + @SerializedName(SERIALIZED_NAME_USER_CONDITION) + private UpdateUserConditionModel userCondition; + + public static final String SERIALIZED_NAME_SEGMENT_CONDITION = "segmentCondition"; + @SerializedName(SERIALIZED_NAME_SEGMENT_CONDITION) + private UpdateSegmentConditionModel segmentCondition; + + public static final String SERIALIZED_NAME_PREREQUISITE_FLAG_CONDITION = "prerequisiteFlagCondition"; + @SerializedName(SERIALIZED_NAME_PREREQUISITE_FLAG_CONDITION) + private UpdatePrerequisiteFlagConditionModel prerequisiteFlagCondition; + + public UpdateConditionModel() { + } + + public UpdateConditionModel userCondition(UpdateUserConditionModel userCondition) { + this.userCondition = userCondition; + return this; + } + + /** + * Get userCondition + * @return userCondition + */ + @javax.annotation.Nullable + public UpdateUserConditionModel getUserCondition() { + return userCondition; + } + + public void setUserCondition(UpdateUserConditionModel userCondition) { + this.userCondition = userCondition; + } + + + public UpdateConditionModel segmentCondition(UpdateSegmentConditionModel segmentCondition) { + this.segmentCondition = segmentCondition; + return this; + } + + /** + * Get segmentCondition + * @return segmentCondition + */ + @javax.annotation.Nullable + public UpdateSegmentConditionModel getSegmentCondition() { + return segmentCondition; + } + + public void setSegmentCondition(UpdateSegmentConditionModel segmentCondition) { + this.segmentCondition = segmentCondition; + } + + + public UpdateConditionModel prerequisiteFlagCondition(UpdatePrerequisiteFlagConditionModel prerequisiteFlagCondition) { + this.prerequisiteFlagCondition = prerequisiteFlagCondition; + return this; + } + + /** + * Get prerequisiteFlagCondition + * @return prerequisiteFlagCondition + */ + @javax.annotation.Nullable + public UpdatePrerequisiteFlagConditionModel getPrerequisiteFlagCondition() { + return prerequisiteFlagCondition; + } + + public void setPrerequisiteFlagCondition(UpdatePrerequisiteFlagConditionModel prerequisiteFlagCondition) { + this.prerequisiteFlagCondition = prerequisiteFlagCondition; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateConditionModel instance itself + */ + public UpdateConditionModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateConditionModel updateConditionModel = (UpdateConditionModel) o; + return Objects.equals(this.userCondition, updateConditionModel.userCondition) && + Objects.equals(this.segmentCondition, updateConditionModel.segmentCondition) && + Objects.equals(this.prerequisiteFlagCondition, updateConditionModel.prerequisiteFlagCondition)&& + Objects.equals(this.additionalProperties, updateConditionModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(userCondition, segmentCondition, prerequisiteFlagCondition, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateConditionModel {\n"); + sb.append(" userCondition: ").append(toIndentedString(userCondition)).append("\n"); + sb.append(" segmentCondition: ").append(toIndentedString(segmentCondition)).append("\n"); + sb.append(" prerequisiteFlagCondition: ").append(toIndentedString(prerequisiteFlagCondition)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("userCondition"); + openapiFields.add("segmentCondition"); + openapiFields.add("prerequisiteFlagCondition"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateConditionModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateConditionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateConditionModel is not found in the empty JSON string", UpdateConditionModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `userCondition` + if (jsonObj.get("userCondition") != null && !jsonObj.get("userCondition").isJsonNull()) { + UpdateUserConditionModel.validateJsonElement(jsonObj.get("userCondition")); + } + // validate the optional field `segmentCondition` + if (jsonObj.get("segmentCondition") != null && !jsonObj.get("segmentCondition").isJsonNull()) { + UpdateSegmentConditionModel.validateJsonElement(jsonObj.get("segmentCondition")); + } + // validate the optional field `prerequisiteFlagCondition` + if (jsonObj.get("prerequisiteFlagCondition") != null && !jsonObj.get("prerequisiteFlagCondition").isJsonNull()) { + UpdatePrerequisiteFlagConditionModel.validateJsonElement(jsonObj.get("prerequisiteFlagCondition")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateConditionModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateConditionModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateConditionModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateConditionModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateConditionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateConditionModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateConditionModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateConditionModel + * @throws IOException if the JSON string is invalid with respect to UpdateConditionModel + */ + public static UpdateConditionModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateConditionModel.class); + } + + /** + * Convert an instance of UpdateConditionModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateConfigRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateConfigRequest.java new file mode 100644 index 0000000..0782f37 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateConfigRequest.java @@ -0,0 +1,354 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdateConfigRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateConfigRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_ORDER = "order"; + @SerializedName(SERIALIZED_NAME_ORDER) + private Integer order; + + public UpdateConfigRequest() { + } + + public UpdateConfigRequest name(String name) { + this.name = name; + return this; + } + + /** + * The name of the Config. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public UpdateConfigRequest description(String description) { + this.description = description; + return this; + } + + /** + * The description of the Config. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + + public UpdateConfigRequest order(Integer order) { + this.order = order; + return this; + } + + /** + * The order of the Config represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. + * @return order + */ + @javax.annotation.Nullable + public Integer getOrder() { + return order; + } + + public void setOrder(Integer order) { + this.order = order; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateConfigRequest instance itself + */ + public UpdateConfigRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateConfigRequest updateConfigRequest = (UpdateConfigRequest) o; + return Objects.equals(this.name, updateConfigRequest.name) && + Objects.equals(this.description, updateConfigRequest.description) && + Objects.equals(this.order, updateConfigRequest.order)&& + Objects.equals(this.additionalProperties, updateConfigRequest.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, order, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateConfigRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("order"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateConfigRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateConfigRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateConfigRequest is not found in the empty JSON string", UpdateConfigRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateConfigRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateConfigRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateConfigRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateConfigRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateConfigRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateConfigRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateConfigRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateConfigRequest + * @throws IOException if the JSON string is invalid with respect to UpdateConfigRequest + */ + public static UpdateConfigRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateConfigRequest.class); + } + + /** + * Convert an instance of UpdateConfigRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateEnvironmentModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateEnvironmentModel.java new file mode 100644 index 0000000..7d22a22 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateEnvironmentModel.java @@ -0,0 +1,383 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdateEnvironmentModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateEnvironmentModel { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_COLOR = "color"; + @SerializedName(SERIALIZED_NAME_COLOR) + private String color; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_ORDER = "order"; + @SerializedName(SERIALIZED_NAME_ORDER) + private Integer order; + + public UpdateEnvironmentModel() { + } + + public UpdateEnvironmentModel name(String name) { + this.name = name; + return this; + } + + /** + * The name of the Environment. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public UpdateEnvironmentModel color(String color) { + this.color = color; + return this; + } + + /** + * The color of the Environment. RGB or HTML color codes are allowed. + * @return color + */ + @javax.annotation.Nullable + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + + public UpdateEnvironmentModel description(String description) { + this.description = description; + return this; + } + + /** + * The description of the Environment. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + + public UpdateEnvironmentModel order(Integer order) { + this.order = order; + return this; + } + + /** + * The order of the Environment represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. + * @return order + */ + @javax.annotation.Nullable + public Integer getOrder() { + return order; + } + + public void setOrder(Integer order) { + this.order = order; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateEnvironmentModel instance itself + */ + public UpdateEnvironmentModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateEnvironmentModel updateEnvironmentModel = (UpdateEnvironmentModel) o; + return Objects.equals(this.name, updateEnvironmentModel.name) && + Objects.equals(this.color, updateEnvironmentModel.color) && + Objects.equals(this.description, updateEnvironmentModel.description) && + Objects.equals(this.order, updateEnvironmentModel.order)&& + Objects.equals(this.additionalProperties, updateEnvironmentModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, color, description, order, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateEnvironmentModel {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("color"); + openapiFields.add("description"); + openapiFields.add("order"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateEnvironmentModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateEnvironmentModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateEnvironmentModel is not found in the empty JSON string", UpdateEnvironmentModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("color") != null && !jsonObj.get("color").isJsonNull()) && !jsonObj.get("color").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateEnvironmentModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateEnvironmentModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateEnvironmentModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateEnvironmentModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateEnvironmentModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateEnvironmentModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateEnvironmentModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateEnvironmentModel + * @throws IOException if the JSON string is invalid with respect to UpdateEnvironmentModel + */ + public static UpdateEnvironmentModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateEnvironmentModel.class); + } + + /** + * Convert an instance of UpdateEnvironmentModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaModel.java new file mode 100644 index 0000000..a84dac2 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaModel.java @@ -0,0 +1,387 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.UpdateTargetingRuleModel; +import com.configcat.publicapi.java.client.model.UpdateValueModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdateEvaluationFormulaModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateEvaluationFormulaModel { + public static final String SERIALIZED_NAME_DEFAULT_VALUE = "defaultValue"; + @SerializedName(SERIALIZED_NAME_DEFAULT_VALUE) + private UpdateValueModel defaultValue; + + public static final String SERIALIZED_NAME_TARGETING_RULES = "targetingRules"; + @SerializedName(SERIALIZED_NAME_TARGETING_RULES) + private List targetingRules; + + public static final String SERIALIZED_NAME_PERCENTAGE_EVALUATION_ATTRIBUTE = "percentageEvaluationAttribute"; + @SerializedName(SERIALIZED_NAME_PERCENTAGE_EVALUATION_ATTRIBUTE) + private String percentageEvaluationAttribute; + + public UpdateEvaluationFormulaModel() { + } + + public UpdateEvaluationFormulaModel defaultValue(UpdateValueModel defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + /** + * Get defaultValue + * @return defaultValue + */ + @javax.annotation.Nonnull + public UpdateValueModel getDefaultValue() { + return defaultValue; + } + + public void setDefaultValue(UpdateValueModel defaultValue) { + this.defaultValue = defaultValue; + } + + + public UpdateEvaluationFormulaModel targetingRules(List targetingRules) { + this.targetingRules = targetingRules; + return this; + } + + public UpdateEvaluationFormulaModel addTargetingRulesItem(UpdateTargetingRuleModel targetingRulesItem) { + if (this.targetingRules == null) { + this.targetingRules = new ArrayList<>(); + } + this.targetingRules.add(targetingRulesItem); + return this; + } + + /** + * The targeting rules of the Feature Flag or Setting. + * @return targetingRules + */ + @javax.annotation.Nullable + public List getTargetingRules() { + return targetingRules; + } + + public void setTargetingRules(List targetingRules) { + this.targetingRules = targetingRules; + } + + + public UpdateEvaluationFormulaModel percentageEvaluationAttribute(String percentageEvaluationAttribute) { + this.percentageEvaluationAttribute = percentageEvaluationAttribute; + return this; + } + + /** + * The user attribute used for percentage evaluation. If not set, it defaults to the `Identifier` user object attribute. + * @return percentageEvaluationAttribute + */ + @javax.annotation.Nullable + public String getPercentageEvaluationAttribute() { + return percentageEvaluationAttribute; + } + + public void setPercentageEvaluationAttribute(String percentageEvaluationAttribute) { + this.percentageEvaluationAttribute = percentageEvaluationAttribute; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateEvaluationFormulaModel instance itself + */ + public UpdateEvaluationFormulaModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateEvaluationFormulaModel updateEvaluationFormulaModel = (UpdateEvaluationFormulaModel) o; + return Objects.equals(this.defaultValue, updateEvaluationFormulaModel.defaultValue) && + Objects.equals(this.targetingRules, updateEvaluationFormulaModel.targetingRules) && + Objects.equals(this.percentageEvaluationAttribute, updateEvaluationFormulaModel.percentageEvaluationAttribute)&& + Objects.equals(this.additionalProperties, updateEvaluationFormulaModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(defaultValue, targetingRules, percentageEvaluationAttribute, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateEvaluationFormulaModel {\n"); + sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); + sb.append(" targetingRules: ").append(toIndentedString(targetingRules)).append("\n"); + sb.append(" percentageEvaluationAttribute: ").append(toIndentedString(percentageEvaluationAttribute)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("defaultValue"); + openapiFields.add("targetingRules"); + openapiFields.add("percentageEvaluationAttribute"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("defaultValue"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateEvaluationFormulaModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateEvaluationFormulaModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateEvaluationFormulaModel is not found in the empty JSON string", UpdateEvaluationFormulaModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateEvaluationFormulaModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `defaultValue` + UpdateValueModel.validateJsonElement(jsonObj.get("defaultValue")); + if (jsonObj.get("targetingRules") != null && !jsonObj.get("targetingRules").isJsonNull()) { + JsonArray jsonArraytargetingRules = jsonObj.getAsJsonArray("targetingRules"); + if (jsonArraytargetingRules != null) { + // ensure the json data is an array + if (!jsonObj.get("targetingRules").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `targetingRules` to be an array in the JSON string but got `%s`", jsonObj.get("targetingRules").toString())); + } + + // validate the optional field `targetingRules` (array) + for (int i = 0; i < jsonArraytargetingRules.size(); i++) { + UpdateTargetingRuleModel.validateJsonElement(jsonArraytargetingRules.get(i)); + }; + } + } + if ((jsonObj.get("percentageEvaluationAttribute") != null && !jsonObj.get("percentageEvaluationAttribute").isJsonNull()) && !jsonObj.get("percentageEvaluationAttribute").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `percentageEvaluationAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("percentageEvaluationAttribute").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateEvaluationFormulaModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateEvaluationFormulaModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateEvaluationFormulaModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateEvaluationFormulaModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateEvaluationFormulaModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateEvaluationFormulaModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateEvaluationFormulaModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateEvaluationFormulaModel + * @throws IOException if the JSON string is invalid with respect to UpdateEvaluationFormulaModel + */ + public static UpdateEvaluationFormulaModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateEvaluationFormulaModel.class); + } + + /** + * Convert an instance of UpdateEvaluationFormulaModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaWithIdModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaWithIdModel.java new file mode 100644 index 0000000..aaba22e --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaWithIdModel.java @@ -0,0 +1,413 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.UpdateTargetingRuleModel; +import com.configcat.publicapi.java.client.model.UpdateValueModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdateEvaluationFormulaWithIdModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateEvaluationFormulaWithIdModel { + public static final String SERIALIZED_NAME_DEFAULT_VALUE = "defaultValue"; + @SerializedName(SERIALIZED_NAME_DEFAULT_VALUE) + private UpdateValueModel defaultValue; + + public static final String SERIALIZED_NAME_TARGETING_RULES = "targetingRules"; + @SerializedName(SERIALIZED_NAME_TARGETING_RULES) + private List targetingRules; + + public static final String SERIALIZED_NAME_PERCENTAGE_EVALUATION_ATTRIBUTE = "percentageEvaluationAttribute"; + @SerializedName(SERIALIZED_NAME_PERCENTAGE_EVALUATION_ATTRIBUTE) + private String percentageEvaluationAttribute; + + public static final String SERIALIZED_NAME_SETTING_ID = "settingId"; + @SerializedName(SERIALIZED_NAME_SETTING_ID) + private Integer settingId; + + public UpdateEvaluationFormulaWithIdModel() { + } + + public UpdateEvaluationFormulaWithIdModel defaultValue(UpdateValueModel defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + /** + * Get defaultValue + * @return defaultValue + */ + @javax.annotation.Nonnull + public UpdateValueModel getDefaultValue() { + return defaultValue; + } + + public void setDefaultValue(UpdateValueModel defaultValue) { + this.defaultValue = defaultValue; + } + + + public UpdateEvaluationFormulaWithIdModel targetingRules(List targetingRules) { + this.targetingRules = targetingRules; + return this; + } + + public UpdateEvaluationFormulaWithIdModel addTargetingRulesItem(UpdateTargetingRuleModel targetingRulesItem) { + if (this.targetingRules == null) { + this.targetingRules = new ArrayList<>(); + } + this.targetingRules.add(targetingRulesItem); + return this; + } + + /** + * The targeting rules of the Feature Flag or Setting. + * @return targetingRules + */ + @javax.annotation.Nullable + public List getTargetingRules() { + return targetingRules; + } + + public void setTargetingRules(List targetingRules) { + this.targetingRules = targetingRules; + } + + + public UpdateEvaluationFormulaWithIdModel percentageEvaluationAttribute(String percentageEvaluationAttribute) { + this.percentageEvaluationAttribute = percentageEvaluationAttribute; + return this; + } + + /** + * The user attribute used for percentage evaluation. If not set, it defaults to the `Identifier` user object attribute. + * @return percentageEvaluationAttribute + */ + @javax.annotation.Nullable + public String getPercentageEvaluationAttribute() { + return percentageEvaluationAttribute; + } + + public void setPercentageEvaluationAttribute(String percentageEvaluationAttribute) { + this.percentageEvaluationAttribute = percentageEvaluationAttribute; + } + + + public UpdateEvaluationFormulaWithIdModel settingId(Integer settingId) { + this.settingId = settingId; + return this; + } + + /** + * The identifier of the feature flag or setting. + * @return settingId + */ + @javax.annotation.Nullable + public Integer getSettingId() { + return settingId; + } + + public void setSettingId(Integer settingId) { + this.settingId = settingId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateEvaluationFormulaWithIdModel instance itself + */ + public UpdateEvaluationFormulaWithIdModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateEvaluationFormulaWithIdModel updateEvaluationFormulaWithIdModel = (UpdateEvaluationFormulaWithIdModel) o; + return Objects.equals(this.defaultValue, updateEvaluationFormulaWithIdModel.defaultValue) && + Objects.equals(this.targetingRules, updateEvaluationFormulaWithIdModel.targetingRules) && + Objects.equals(this.percentageEvaluationAttribute, updateEvaluationFormulaWithIdModel.percentageEvaluationAttribute) && + Objects.equals(this.settingId, updateEvaluationFormulaWithIdModel.settingId)&& + Objects.equals(this.additionalProperties, updateEvaluationFormulaWithIdModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(defaultValue, targetingRules, percentageEvaluationAttribute, settingId, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateEvaluationFormulaWithIdModel {\n"); + sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); + sb.append(" targetingRules: ").append(toIndentedString(targetingRules)).append("\n"); + sb.append(" percentageEvaluationAttribute: ").append(toIndentedString(percentageEvaluationAttribute)).append("\n"); + sb.append(" settingId: ").append(toIndentedString(settingId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("defaultValue"); + openapiFields.add("targetingRules"); + openapiFields.add("percentageEvaluationAttribute"); + openapiFields.add("settingId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("defaultValue"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateEvaluationFormulaWithIdModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateEvaluationFormulaWithIdModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateEvaluationFormulaWithIdModel is not found in the empty JSON string", UpdateEvaluationFormulaWithIdModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateEvaluationFormulaWithIdModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `defaultValue` + UpdateValueModel.validateJsonElement(jsonObj.get("defaultValue")); + if (jsonObj.get("targetingRules") != null && !jsonObj.get("targetingRules").isJsonNull()) { + JsonArray jsonArraytargetingRules = jsonObj.getAsJsonArray("targetingRules"); + if (jsonArraytargetingRules != null) { + // ensure the json data is an array + if (!jsonObj.get("targetingRules").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `targetingRules` to be an array in the JSON string but got `%s`", jsonObj.get("targetingRules").toString())); + } + + // validate the optional field `targetingRules` (array) + for (int i = 0; i < jsonArraytargetingRules.size(); i++) { + UpdateTargetingRuleModel.validateJsonElement(jsonArraytargetingRules.get(i)); + }; + } + } + if ((jsonObj.get("percentageEvaluationAttribute") != null && !jsonObj.get("percentageEvaluationAttribute").isJsonNull()) && !jsonObj.get("percentageEvaluationAttribute").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `percentageEvaluationAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("percentageEvaluationAttribute").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateEvaluationFormulaWithIdModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateEvaluationFormulaWithIdModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateEvaluationFormulaWithIdModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateEvaluationFormulaWithIdModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateEvaluationFormulaWithIdModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateEvaluationFormulaWithIdModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateEvaluationFormulaWithIdModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateEvaluationFormulaWithIdModel + * @throws IOException if the JSON string is invalid with respect to UpdateEvaluationFormulaWithIdModel + */ + public static UpdateEvaluationFormulaWithIdModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateEvaluationFormulaWithIdModel.class); + } + + /** + * Convert an instance of UpdateEvaluationFormulaWithIdModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulasModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulasModel.java new file mode 100644 index 0000000..854ede4 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulasModel.java @@ -0,0 +1,309 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.UpdateEvaluationFormulaWithIdModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdateEvaluationFormulasModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateEvaluationFormulasModel { + public static final String SERIALIZED_NAME_UPDATE_FORMULAS = "updateFormulas"; + @SerializedName(SERIALIZED_NAME_UPDATE_FORMULAS) + private List updateFormulas = new ArrayList<>(); + + public UpdateEvaluationFormulasModel() { + } + + public UpdateEvaluationFormulasModel updateFormulas(List updateFormulas) { + this.updateFormulas = updateFormulas; + return this; + } + + public UpdateEvaluationFormulasModel addUpdateFormulasItem(UpdateEvaluationFormulaWithIdModel updateFormulasItem) { + if (this.updateFormulas == null) { + this.updateFormulas = new ArrayList<>(); + } + this.updateFormulas.add(updateFormulasItem); + return this; + } + + /** + * Evaluation descriptors of each updated Feature Flag and Setting. + * @return updateFormulas + */ + @javax.annotation.Nullable + public List getUpdateFormulas() { + return updateFormulas; + } + + public void setUpdateFormulas(List updateFormulas) { + this.updateFormulas = updateFormulas; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateEvaluationFormulasModel instance itself + */ + public UpdateEvaluationFormulasModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateEvaluationFormulasModel updateEvaluationFormulasModel = (UpdateEvaluationFormulasModel) o; + return Objects.equals(this.updateFormulas, updateEvaluationFormulasModel.updateFormulas)&& + Objects.equals(this.additionalProperties, updateEvaluationFormulasModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(updateFormulas, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateEvaluationFormulasModel {\n"); + sb.append(" updateFormulas: ").append(toIndentedString(updateFormulas)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("updateFormulas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateEvaluationFormulasModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateEvaluationFormulasModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateEvaluationFormulasModel is not found in the empty JSON string", UpdateEvaluationFormulasModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("updateFormulas") != null && !jsonObj.get("updateFormulas").isJsonNull()) { + JsonArray jsonArrayupdateFormulas = jsonObj.getAsJsonArray("updateFormulas"); + if (jsonArrayupdateFormulas != null) { + // ensure the json data is an array + if (!jsonObj.get("updateFormulas").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `updateFormulas` to be an array in the JSON string but got `%s`", jsonObj.get("updateFormulas").toString())); + } + + // validate the optional field `updateFormulas` (array) + for (int i = 0; i < jsonArrayupdateFormulas.size(); i++) { + UpdateEvaluationFormulaWithIdModel.validateJsonElement(jsonArrayupdateFormulas.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateEvaluationFormulasModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateEvaluationFormulasModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateEvaluationFormulasModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateEvaluationFormulasModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateEvaluationFormulasModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateEvaluationFormulasModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateEvaluationFormulasModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateEvaluationFormulasModel + * @throws IOException if the JSON string is invalid with respect to UpdateEvaluationFormulasModel + */ + public static UpdateEvaluationFormulasModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateEvaluationFormulasModel.class); + } + + /** + * Convert an instance of UpdateEvaluationFormulasModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateMemberPermissionsRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateMemberPermissionsRequest.java new file mode 100644 index 0000000..17ddb98 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateMemberPermissionsRequest.java @@ -0,0 +1,388 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdateMemberPermissionsRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateMemberPermissionsRequest { + public static final String SERIALIZED_NAME_PERMISSION_GROUP_IDS = "permissionGroupIds"; + @SerializedName(SERIALIZED_NAME_PERMISSION_GROUP_IDS) + private List permissionGroupIds; + + public static final String SERIALIZED_NAME_IS_ADMIN = "isAdmin"; + @SerializedName(SERIALIZED_NAME_IS_ADMIN) + private Boolean isAdmin; + + public static final String SERIALIZED_NAME_IS_BILLING_MANAGER = "isBillingManager"; + @SerializedName(SERIALIZED_NAME_IS_BILLING_MANAGER) + private Boolean isBillingManager; + + public static final String SERIALIZED_NAME_REMOVE_FROM_PERMISSION_GROUPS_WHERE_ID_NOT_SET = "removeFromPermissionGroupsWhereIdNotSet"; + @SerializedName(SERIALIZED_NAME_REMOVE_FROM_PERMISSION_GROUPS_WHERE_ID_NOT_SET) + private Boolean removeFromPermissionGroupsWhereIdNotSet; + + public UpdateMemberPermissionsRequest() { + } + + public UpdateMemberPermissionsRequest permissionGroupIds(List permissionGroupIds) { + this.permissionGroupIds = permissionGroupIds; + return this; + } + + public UpdateMemberPermissionsRequest addPermissionGroupIdsItem(Long permissionGroupIdsItem) { + if (this.permissionGroupIds == null) { + this.permissionGroupIds = new ArrayList<>(); + } + this.permissionGroupIds.add(permissionGroupIdsItem); + return this; + } + + /** + * List of Permission Group identifiers to where the Member should be added. + * @return permissionGroupIds + */ + @javax.annotation.Nullable + public List getPermissionGroupIds() { + return permissionGroupIds; + } + + public void setPermissionGroupIds(List permissionGroupIds) { + this.permissionGroupIds = permissionGroupIds; + } + + + public UpdateMemberPermissionsRequest isAdmin(Boolean isAdmin) { + this.isAdmin = isAdmin; + return this; + } + + /** + * Indicates that the member must be Organization Admin. + * @return isAdmin + */ + @javax.annotation.Nullable + public Boolean getIsAdmin() { + return isAdmin; + } + + public void setIsAdmin(Boolean isAdmin) { + this.isAdmin = isAdmin; + } + + + public UpdateMemberPermissionsRequest isBillingManager(Boolean isBillingManager) { + this.isBillingManager = isBillingManager; + return this; + } + + /** + * Indicates that the member must be Billing Manager. + * @return isBillingManager + */ + @javax.annotation.Nullable + public Boolean getIsBillingManager() { + return isBillingManager; + } + + public void setIsBillingManager(Boolean isBillingManager) { + this.isBillingManager = isBillingManager; + } + + + public UpdateMemberPermissionsRequest removeFromPermissionGroupsWhereIdNotSet(Boolean removeFromPermissionGroupsWhereIdNotSet) { + this.removeFromPermissionGroupsWhereIdNotSet = removeFromPermissionGroupsWhereIdNotSet; + return this; + } + + /** + * When `true`, the member will be removed from those Permission Groups that are not listed in the `permissionGroupIds` field. + * @return removeFromPermissionGroupsWhereIdNotSet + */ + @javax.annotation.Nullable + public Boolean getRemoveFromPermissionGroupsWhereIdNotSet() { + return removeFromPermissionGroupsWhereIdNotSet; + } + + public void setRemoveFromPermissionGroupsWhereIdNotSet(Boolean removeFromPermissionGroupsWhereIdNotSet) { + this.removeFromPermissionGroupsWhereIdNotSet = removeFromPermissionGroupsWhereIdNotSet; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateMemberPermissionsRequest instance itself + */ + public UpdateMemberPermissionsRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateMemberPermissionsRequest updateMemberPermissionsRequest = (UpdateMemberPermissionsRequest) o; + return Objects.equals(this.permissionGroupIds, updateMemberPermissionsRequest.permissionGroupIds) && + Objects.equals(this.isAdmin, updateMemberPermissionsRequest.isAdmin) && + Objects.equals(this.isBillingManager, updateMemberPermissionsRequest.isBillingManager) && + Objects.equals(this.removeFromPermissionGroupsWhereIdNotSet, updateMemberPermissionsRequest.removeFromPermissionGroupsWhereIdNotSet)&& + Objects.equals(this.additionalProperties, updateMemberPermissionsRequest.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(permissionGroupIds, isAdmin, isBillingManager, removeFromPermissionGroupsWhereIdNotSet, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateMemberPermissionsRequest {\n"); + sb.append(" permissionGroupIds: ").append(toIndentedString(permissionGroupIds)).append("\n"); + sb.append(" isAdmin: ").append(toIndentedString(isAdmin)).append("\n"); + sb.append(" isBillingManager: ").append(toIndentedString(isBillingManager)).append("\n"); + sb.append(" removeFromPermissionGroupsWhereIdNotSet: ").append(toIndentedString(removeFromPermissionGroupsWhereIdNotSet)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("permissionGroupIds"); + openapiFields.add("isAdmin"); + openapiFields.add("isBillingManager"); + openapiFields.add("removeFromPermissionGroupsWhereIdNotSet"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateMemberPermissionsRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateMemberPermissionsRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateMemberPermissionsRequest is not found in the empty JSON string", UpdateMemberPermissionsRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("permissionGroupIds") != null && !jsonObj.get("permissionGroupIds").isJsonNull() && !jsonObj.get("permissionGroupIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `permissionGroupIds` to be an array in the JSON string but got `%s`", jsonObj.get("permissionGroupIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateMemberPermissionsRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateMemberPermissionsRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateMemberPermissionsRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateMemberPermissionsRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateMemberPermissionsRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateMemberPermissionsRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateMemberPermissionsRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateMemberPermissionsRequest + * @throws IOException if the JSON string is invalid with respect to UpdateMemberPermissionsRequest + */ + public static UpdateMemberPermissionsRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateMemberPermissionsRequest.class); + } + + /** + * Convert an instance of UpdateMemberPermissionsRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdatePercentageOptionModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdatePercentageOptionModel.java new file mode 100644 index 0000000..b010a1a --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdatePercentageOptionModel.java @@ -0,0 +1,322 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.UpdateValueModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdatePercentageOptionModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdatePercentageOptionModel { + public static final String SERIALIZED_NAME_PERCENTAGE = "percentage"; + @SerializedName(SERIALIZED_NAME_PERCENTAGE) + private Integer percentage; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private UpdateValueModel value; + + public UpdatePercentageOptionModel() { + } + + public UpdatePercentageOptionModel percentage(Integer percentage) { + this.percentage = percentage; + return this; + } + + /** + * A number between 0 and 100 that represents a randomly allocated fraction of the users. + * @return percentage + */ + @javax.annotation.Nonnull + public Integer getPercentage() { + return percentage; + } + + public void setPercentage(Integer percentage) { + this.percentage = percentage; + } + + + public UpdatePercentageOptionModel value(UpdateValueModel value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nonnull + public UpdateValueModel getValue() { + return value; + } + + public void setValue(UpdateValueModel value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdatePercentageOptionModel instance itself + */ + public UpdatePercentageOptionModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdatePercentageOptionModel updatePercentageOptionModel = (UpdatePercentageOptionModel) o; + return Objects.equals(this.percentage, updatePercentageOptionModel.percentage) && + Objects.equals(this.value, updatePercentageOptionModel.value)&& + Objects.equals(this.additionalProperties, updatePercentageOptionModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(percentage, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdatePercentageOptionModel {\n"); + sb.append(" percentage: ").append(toIndentedString(percentage)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("percentage"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("percentage"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdatePercentageOptionModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdatePercentageOptionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdatePercentageOptionModel is not found in the empty JSON string", UpdatePercentageOptionModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdatePercentageOptionModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `value` + UpdateValueModel.validateJsonElement(jsonObj.get("value")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdatePercentageOptionModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdatePercentageOptionModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdatePercentageOptionModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdatePercentageOptionModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdatePercentageOptionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdatePercentageOptionModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdatePercentageOptionModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdatePercentageOptionModel + * @throws IOException if the JSON string is invalid with respect to UpdatePercentageOptionModel + */ + public static UpdatePercentageOptionModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdatePercentageOptionModel.class); + } + + /** + * Convert an instance of UpdatePercentageOptionModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdatePermissionGroupRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdatePermissionGroupRequest.java new file mode 100644 index 0000000..9ec7a05 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdatePermissionGroupRequest.java @@ -0,0 +1,958 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.AccessType; +import com.configcat.publicapi.java.client.model.CreateOrUpdateEnvironmentAccessModel; +import com.configcat.publicapi.java.client.model.EnvironmentAccessType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdatePermissionGroupRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdatePermissionGroupRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_CAN_MANAGE_MEMBERS = "canManageMembers"; + @SerializedName(SERIALIZED_NAME_CAN_MANAGE_MEMBERS) + private Boolean canManageMembers; + + public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_CONFIG = "canCreateOrUpdateConfig"; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_CONFIG) + private Boolean canCreateOrUpdateConfig; + + public static final String SERIALIZED_NAME_CAN_DELETE_CONFIG = "canDeleteConfig"; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_CONFIG) + private Boolean canDeleteConfig; + + public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_ENVIRONMENT = "canCreateOrUpdateEnvironment"; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_ENVIRONMENT) + private Boolean canCreateOrUpdateEnvironment; + + public static final String SERIALIZED_NAME_CAN_DELETE_ENVIRONMENT = "canDeleteEnvironment"; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_ENVIRONMENT) + private Boolean canDeleteEnvironment; + + public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SETTING = "canCreateOrUpdateSetting"; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SETTING) + private Boolean canCreateOrUpdateSetting; + + public static final String SERIALIZED_NAME_CAN_TAG_SETTING = "canTagSetting"; + @SerializedName(SERIALIZED_NAME_CAN_TAG_SETTING) + private Boolean canTagSetting; + + public static final String SERIALIZED_NAME_CAN_DELETE_SETTING = "canDeleteSetting"; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_SETTING) + private Boolean canDeleteSetting; + + public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_TAG = "canCreateOrUpdateTag"; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_TAG) + private Boolean canCreateOrUpdateTag; + + public static final String SERIALIZED_NAME_CAN_DELETE_TAG = "canDeleteTag"; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_TAG) + private Boolean canDeleteTag; + + public static final String SERIALIZED_NAME_CAN_MANAGE_WEBHOOK = "canManageWebhook"; + @SerializedName(SERIALIZED_NAME_CAN_MANAGE_WEBHOOK) + private Boolean canManageWebhook; + + public static final String SERIALIZED_NAME_CAN_USE_EXPORT_IMPORT = "canUseExportImport"; + @SerializedName(SERIALIZED_NAME_CAN_USE_EXPORT_IMPORT) + private Boolean canUseExportImport; + + public static final String SERIALIZED_NAME_CAN_MANAGE_PRODUCT_PREFERENCES = "canManageProductPreferences"; + @SerializedName(SERIALIZED_NAME_CAN_MANAGE_PRODUCT_PREFERENCES) + private Boolean canManageProductPreferences; + + public static final String SERIALIZED_NAME_CAN_MANAGE_INTEGRATIONS = "canManageIntegrations"; + @SerializedName(SERIALIZED_NAME_CAN_MANAGE_INTEGRATIONS) + private Boolean canManageIntegrations; + + public static final String SERIALIZED_NAME_CAN_VIEW_SDK_KEY = "canViewSdkKey"; + @SerializedName(SERIALIZED_NAME_CAN_VIEW_SDK_KEY) + private Boolean canViewSdkKey; + + public static final String SERIALIZED_NAME_CAN_ROTATE_SDK_KEY = "canRotateSdkKey"; + @SerializedName(SERIALIZED_NAME_CAN_ROTATE_SDK_KEY) + private Boolean canRotateSdkKey; + + public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SEGMENTS = "canCreateOrUpdateSegments"; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SEGMENTS) + private Boolean canCreateOrUpdateSegments; + + public static final String SERIALIZED_NAME_CAN_DELETE_SEGMENTS = "canDeleteSegments"; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_SEGMENTS) + private Boolean canDeleteSegments; + + public static final String SERIALIZED_NAME_CAN_VIEW_PRODUCT_AUDIT_LOG = "canViewProductAuditLog"; + @SerializedName(SERIALIZED_NAME_CAN_VIEW_PRODUCT_AUDIT_LOG) + private Boolean canViewProductAuditLog; + + public static final String SERIALIZED_NAME_CAN_VIEW_PRODUCT_STATISTICS = "canViewProductStatistics"; + @SerializedName(SERIALIZED_NAME_CAN_VIEW_PRODUCT_STATISTICS) + private Boolean canViewProductStatistics; + + public static final String SERIALIZED_NAME_CAN_DISABLE2_F_A = "canDisable2FA"; + @SerializedName(SERIALIZED_NAME_CAN_DISABLE2_F_A) + private Boolean canDisable2FA; + + public static final String SERIALIZED_NAME_ACCESS_TYPE = "accessType"; + @SerializedName(SERIALIZED_NAME_ACCESS_TYPE) + private AccessType accessType; + + public static final String SERIALIZED_NAME_NEW_ENVIRONMENT_ACCESS_TYPE = "newEnvironmentAccessType"; + @SerializedName(SERIALIZED_NAME_NEW_ENVIRONMENT_ACCESS_TYPE) + private EnvironmentAccessType newEnvironmentAccessType; + + public static final String SERIALIZED_NAME_ENVIRONMENT_ACCESSES = "environmentAccesses"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ACCESSES) + private List environmentAccesses; + + public UpdatePermissionGroupRequest() { + } + + public UpdatePermissionGroupRequest name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Permission Group. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public UpdatePermissionGroupRequest canManageMembers(Boolean canManageMembers) { + this.canManageMembers = canManageMembers; + return this; + } + + /** + * Group members can manage team members. + * @return canManageMembers + */ + @javax.annotation.Nullable + public Boolean getCanManageMembers() { + return canManageMembers; + } + + public void setCanManageMembers(Boolean canManageMembers) { + this.canManageMembers = canManageMembers; + } + + + public UpdatePermissionGroupRequest canCreateOrUpdateConfig(Boolean canCreateOrUpdateConfig) { + this.canCreateOrUpdateConfig = canCreateOrUpdateConfig; + return this; + } + + /** + * Group members can create/update Configs. + * @return canCreateOrUpdateConfig + */ + @javax.annotation.Nullable + public Boolean getCanCreateOrUpdateConfig() { + return canCreateOrUpdateConfig; + } + + public void setCanCreateOrUpdateConfig(Boolean canCreateOrUpdateConfig) { + this.canCreateOrUpdateConfig = canCreateOrUpdateConfig; + } + + + public UpdatePermissionGroupRequest canDeleteConfig(Boolean canDeleteConfig) { + this.canDeleteConfig = canDeleteConfig; + return this; + } + + /** + * Group members can delete Configs. + * @return canDeleteConfig + */ + @javax.annotation.Nullable + public Boolean getCanDeleteConfig() { + return canDeleteConfig; + } + + public void setCanDeleteConfig(Boolean canDeleteConfig) { + this.canDeleteConfig = canDeleteConfig; + } + + + public UpdatePermissionGroupRequest canCreateOrUpdateEnvironment(Boolean canCreateOrUpdateEnvironment) { + this.canCreateOrUpdateEnvironment = canCreateOrUpdateEnvironment; + return this; + } + + /** + * Group members can create/update Environments. + * @return canCreateOrUpdateEnvironment + */ + @javax.annotation.Nullable + public Boolean getCanCreateOrUpdateEnvironment() { + return canCreateOrUpdateEnvironment; + } + + public void setCanCreateOrUpdateEnvironment(Boolean canCreateOrUpdateEnvironment) { + this.canCreateOrUpdateEnvironment = canCreateOrUpdateEnvironment; + } + + + public UpdatePermissionGroupRequest canDeleteEnvironment(Boolean canDeleteEnvironment) { + this.canDeleteEnvironment = canDeleteEnvironment; + return this; + } + + /** + * Group members can delete Environments. + * @return canDeleteEnvironment + */ + @javax.annotation.Nullable + public Boolean getCanDeleteEnvironment() { + return canDeleteEnvironment; + } + + public void setCanDeleteEnvironment(Boolean canDeleteEnvironment) { + this.canDeleteEnvironment = canDeleteEnvironment; + } + + + public UpdatePermissionGroupRequest canCreateOrUpdateSetting(Boolean canCreateOrUpdateSetting) { + this.canCreateOrUpdateSetting = canCreateOrUpdateSetting; + return this; + } + + /** + * Group members can create/update Feature Flags and Settings. + * @return canCreateOrUpdateSetting + */ + @javax.annotation.Nullable + public Boolean getCanCreateOrUpdateSetting() { + return canCreateOrUpdateSetting; + } + + public void setCanCreateOrUpdateSetting(Boolean canCreateOrUpdateSetting) { + this.canCreateOrUpdateSetting = canCreateOrUpdateSetting; + } + + + public UpdatePermissionGroupRequest canTagSetting(Boolean canTagSetting) { + this.canTagSetting = canTagSetting; + return this; + } + + /** + * Group members can attach/detach Tags to Feature Flags and Settings. + * @return canTagSetting + */ + @javax.annotation.Nullable + public Boolean getCanTagSetting() { + return canTagSetting; + } + + public void setCanTagSetting(Boolean canTagSetting) { + this.canTagSetting = canTagSetting; + } + + + public UpdatePermissionGroupRequest canDeleteSetting(Boolean canDeleteSetting) { + this.canDeleteSetting = canDeleteSetting; + return this; + } + + /** + * Group members can delete Feature Flags and Settings. + * @return canDeleteSetting + */ + @javax.annotation.Nullable + public Boolean getCanDeleteSetting() { + return canDeleteSetting; + } + + public void setCanDeleteSetting(Boolean canDeleteSetting) { + this.canDeleteSetting = canDeleteSetting; + } + + + public UpdatePermissionGroupRequest canCreateOrUpdateTag(Boolean canCreateOrUpdateTag) { + this.canCreateOrUpdateTag = canCreateOrUpdateTag; + return this; + } + + /** + * Group members can create/update Tags. + * @return canCreateOrUpdateTag + */ + @javax.annotation.Nullable + public Boolean getCanCreateOrUpdateTag() { + return canCreateOrUpdateTag; + } + + public void setCanCreateOrUpdateTag(Boolean canCreateOrUpdateTag) { + this.canCreateOrUpdateTag = canCreateOrUpdateTag; + } + + + public UpdatePermissionGroupRequest canDeleteTag(Boolean canDeleteTag) { + this.canDeleteTag = canDeleteTag; + return this; + } + + /** + * Group members can delete Tags. + * @return canDeleteTag + */ + @javax.annotation.Nullable + public Boolean getCanDeleteTag() { + return canDeleteTag; + } + + public void setCanDeleteTag(Boolean canDeleteTag) { + this.canDeleteTag = canDeleteTag; + } + + + public UpdatePermissionGroupRequest canManageWebhook(Boolean canManageWebhook) { + this.canManageWebhook = canManageWebhook; + return this; + } + + /** + * Group members can create/update/delete Webhooks. + * @return canManageWebhook + */ + @javax.annotation.Nullable + public Boolean getCanManageWebhook() { + return canManageWebhook; + } + + public void setCanManageWebhook(Boolean canManageWebhook) { + this.canManageWebhook = canManageWebhook; + } + + + public UpdatePermissionGroupRequest canUseExportImport(Boolean canUseExportImport) { + this.canUseExportImport = canUseExportImport; + return this; + } + + /** + * Group members can use the export/import feature. + * @return canUseExportImport + */ + @javax.annotation.Nullable + public Boolean getCanUseExportImport() { + return canUseExportImport; + } + + public void setCanUseExportImport(Boolean canUseExportImport) { + this.canUseExportImport = canUseExportImport; + } + + + public UpdatePermissionGroupRequest canManageProductPreferences(Boolean canManageProductPreferences) { + this.canManageProductPreferences = canManageProductPreferences; + return this; + } + + /** + * Group members can update Product preferences. + * @return canManageProductPreferences + */ + @javax.annotation.Nullable + public Boolean getCanManageProductPreferences() { + return canManageProductPreferences; + } + + public void setCanManageProductPreferences(Boolean canManageProductPreferences) { + this.canManageProductPreferences = canManageProductPreferences; + } + + + public UpdatePermissionGroupRequest canManageIntegrations(Boolean canManageIntegrations) { + this.canManageIntegrations = canManageIntegrations; + return this; + } + + /** + * Group members can add and configure integrations. + * @return canManageIntegrations + */ + @javax.annotation.Nullable + public Boolean getCanManageIntegrations() { + return canManageIntegrations; + } + + public void setCanManageIntegrations(Boolean canManageIntegrations) { + this.canManageIntegrations = canManageIntegrations; + } + + + public UpdatePermissionGroupRequest canViewSdkKey(Boolean canViewSdkKey) { + this.canViewSdkKey = canViewSdkKey; + return this; + } + + /** + * Group members has access to SDK keys. + * @return canViewSdkKey + */ + @javax.annotation.Nullable + public Boolean getCanViewSdkKey() { + return canViewSdkKey; + } + + public void setCanViewSdkKey(Boolean canViewSdkKey) { + this.canViewSdkKey = canViewSdkKey; + } + + + public UpdatePermissionGroupRequest canRotateSdkKey(Boolean canRotateSdkKey) { + this.canRotateSdkKey = canRotateSdkKey; + return this; + } + + /** + * Group members can rotate SDK keys. + * @return canRotateSdkKey + */ + @javax.annotation.Nullable + public Boolean getCanRotateSdkKey() { + return canRotateSdkKey; + } + + public void setCanRotateSdkKey(Boolean canRotateSdkKey) { + this.canRotateSdkKey = canRotateSdkKey; + } + + + public UpdatePermissionGroupRequest canCreateOrUpdateSegments(Boolean canCreateOrUpdateSegments) { + this.canCreateOrUpdateSegments = canCreateOrUpdateSegments; + return this; + } + + /** + * Group members can create/update Segments. + * @return canCreateOrUpdateSegments + */ + @javax.annotation.Nullable + public Boolean getCanCreateOrUpdateSegments() { + return canCreateOrUpdateSegments; + } + + public void setCanCreateOrUpdateSegments(Boolean canCreateOrUpdateSegments) { + this.canCreateOrUpdateSegments = canCreateOrUpdateSegments; + } + + + public UpdatePermissionGroupRequest canDeleteSegments(Boolean canDeleteSegments) { + this.canDeleteSegments = canDeleteSegments; + return this; + } + + /** + * Group members can delete Segments. + * @return canDeleteSegments + */ + @javax.annotation.Nullable + public Boolean getCanDeleteSegments() { + return canDeleteSegments; + } + + public void setCanDeleteSegments(Boolean canDeleteSegments) { + this.canDeleteSegments = canDeleteSegments; + } + + + public UpdatePermissionGroupRequest canViewProductAuditLog(Boolean canViewProductAuditLog) { + this.canViewProductAuditLog = canViewProductAuditLog; + return this; + } + + /** + * Group members has access to audit logs. + * @return canViewProductAuditLog + */ + @javax.annotation.Nullable + public Boolean getCanViewProductAuditLog() { + return canViewProductAuditLog; + } + + public void setCanViewProductAuditLog(Boolean canViewProductAuditLog) { + this.canViewProductAuditLog = canViewProductAuditLog; + } + + + public UpdatePermissionGroupRequest canViewProductStatistics(Boolean canViewProductStatistics) { + this.canViewProductStatistics = canViewProductStatistics; + return this; + } + + /** + * Group members has access to product statistics. + * @return canViewProductStatistics + */ + @javax.annotation.Nullable + public Boolean getCanViewProductStatistics() { + return canViewProductStatistics; + } + + public void setCanViewProductStatistics(Boolean canViewProductStatistics) { + this.canViewProductStatistics = canViewProductStatistics; + } + + + public UpdatePermissionGroupRequest canDisable2FA(Boolean canDisable2FA) { + this.canDisable2FA = canDisable2FA; + return this; + } + + /** + * Group members can disable two-factor authentication for other members. + * @return canDisable2FA + */ + @javax.annotation.Nullable + public Boolean getCanDisable2FA() { + return canDisable2FA; + } + + public void setCanDisable2FA(Boolean canDisable2FA) { + this.canDisable2FA = canDisable2FA; + } + + + public UpdatePermissionGroupRequest accessType(AccessType accessType) { + this.accessType = accessType; + return this; + } + + /** + * Get accessType + * @return accessType + */ + @javax.annotation.Nullable + public AccessType getAccessType() { + return accessType; + } + + public void setAccessType(AccessType accessType) { + this.accessType = accessType; + } + + + public UpdatePermissionGroupRequest newEnvironmentAccessType(EnvironmentAccessType newEnvironmentAccessType) { + this.newEnvironmentAccessType = newEnvironmentAccessType; + return this; + } + + /** + * Get newEnvironmentAccessType + * @return newEnvironmentAccessType + */ + @javax.annotation.Nullable + public EnvironmentAccessType getNewEnvironmentAccessType() { + return newEnvironmentAccessType; + } + + public void setNewEnvironmentAccessType(EnvironmentAccessType newEnvironmentAccessType) { + this.newEnvironmentAccessType = newEnvironmentAccessType; + } + + + public UpdatePermissionGroupRequest environmentAccesses(List environmentAccesses) { + this.environmentAccesses = environmentAccesses; + return this; + } + + public UpdatePermissionGroupRequest addEnvironmentAccessesItem(CreateOrUpdateEnvironmentAccessModel environmentAccessesItem) { + if (this.environmentAccesses == null) { + this.environmentAccesses = new ArrayList<>(); + } + this.environmentAccesses.add(environmentAccessesItem); + return this; + } + + /** + * List of environment specific permissions. + * @return environmentAccesses + */ + @javax.annotation.Nullable + public List getEnvironmentAccesses() { + return environmentAccesses; + } + + public void setEnvironmentAccesses(List environmentAccesses) { + this.environmentAccesses = environmentAccesses; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdatePermissionGroupRequest instance itself + */ + public UpdatePermissionGroupRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdatePermissionGroupRequest updatePermissionGroupRequest = (UpdatePermissionGroupRequest) o; + return Objects.equals(this.name, updatePermissionGroupRequest.name) && + Objects.equals(this.canManageMembers, updatePermissionGroupRequest.canManageMembers) && + Objects.equals(this.canCreateOrUpdateConfig, updatePermissionGroupRequest.canCreateOrUpdateConfig) && + Objects.equals(this.canDeleteConfig, updatePermissionGroupRequest.canDeleteConfig) && + Objects.equals(this.canCreateOrUpdateEnvironment, updatePermissionGroupRequest.canCreateOrUpdateEnvironment) && + Objects.equals(this.canDeleteEnvironment, updatePermissionGroupRequest.canDeleteEnvironment) && + Objects.equals(this.canCreateOrUpdateSetting, updatePermissionGroupRequest.canCreateOrUpdateSetting) && + Objects.equals(this.canTagSetting, updatePermissionGroupRequest.canTagSetting) && + Objects.equals(this.canDeleteSetting, updatePermissionGroupRequest.canDeleteSetting) && + Objects.equals(this.canCreateOrUpdateTag, updatePermissionGroupRequest.canCreateOrUpdateTag) && + Objects.equals(this.canDeleteTag, updatePermissionGroupRequest.canDeleteTag) && + Objects.equals(this.canManageWebhook, updatePermissionGroupRequest.canManageWebhook) && + Objects.equals(this.canUseExportImport, updatePermissionGroupRequest.canUseExportImport) && + Objects.equals(this.canManageProductPreferences, updatePermissionGroupRequest.canManageProductPreferences) && + Objects.equals(this.canManageIntegrations, updatePermissionGroupRequest.canManageIntegrations) && + Objects.equals(this.canViewSdkKey, updatePermissionGroupRequest.canViewSdkKey) && + Objects.equals(this.canRotateSdkKey, updatePermissionGroupRequest.canRotateSdkKey) && + Objects.equals(this.canCreateOrUpdateSegments, updatePermissionGroupRequest.canCreateOrUpdateSegments) && + Objects.equals(this.canDeleteSegments, updatePermissionGroupRequest.canDeleteSegments) && + Objects.equals(this.canViewProductAuditLog, updatePermissionGroupRequest.canViewProductAuditLog) && + Objects.equals(this.canViewProductStatistics, updatePermissionGroupRequest.canViewProductStatistics) && + Objects.equals(this.canDisable2FA, updatePermissionGroupRequest.canDisable2FA) && + Objects.equals(this.accessType, updatePermissionGroupRequest.accessType) && + Objects.equals(this.newEnvironmentAccessType, updatePermissionGroupRequest.newEnvironmentAccessType) && + Objects.equals(this.environmentAccesses, updatePermissionGroupRequest.environmentAccesses)&& + Objects.equals(this.additionalProperties, updatePermissionGroupRequest.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, canManageMembers, canCreateOrUpdateConfig, canDeleteConfig, canCreateOrUpdateEnvironment, canDeleteEnvironment, canCreateOrUpdateSetting, canTagSetting, canDeleteSetting, canCreateOrUpdateTag, canDeleteTag, canManageWebhook, canUseExportImport, canManageProductPreferences, canManageIntegrations, canViewSdkKey, canRotateSdkKey, canCreateOrUpdateSegments, canDeleteSegments, canViewProductAuditLog, canViewProductStatistics, canDisable2FA, accessType, newEnvironmentAccessType, environmentAccesses, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdatePermissionGroupRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" canManageMembers: ").append(toIndentedString(canManageMembers)).append("\n"); + sb.append(" canCreateOrUpdateConfig: ").append(toIndentedString(canCreateOrUpdateConfig)).append("\n"); + sb.append(" canDeleteConfig: ").append(toIndentedString(canDeleteConfig)).append("\n"); + sb.append(" canCreateOrUpdateEnvironment: ").append(toIndentedString(canCreateOrUpdateEnvironment)).append("\n"); + sb.append(" canDeleteEnvironment: ").append(toIndentedString(canDeleteEnvironment)).append("\n"); + sb.append(" canCreateOrUpdateSetting: ").append(toIndentedString(canCreateOrUpdateSetting)).append("\n"); + sb.append(" canTagSetting: ").append(toIndentedString(canTagSetting)).append("\n"); + sb.append(" canDeleteSetting: ").append(toIndentedString(canDeleteSetting)).append("\n"); + sb.append(" canCreateOrUpdateTag: ").append(toIndentedString(canCreateOrUpdateTag)).append("\n"); + sb.append(" canDeleteTag: ").append(toIndentedString(canDeleteTag)).append("\n"); + sb.append(" canManageWebhook: ").append(toIndentedString(canManageWebhook)).append("\n"); + sb.append(" canUseExportImport: ").append(toIndentedString(canUseExportImport)).append("\n"); + sb.append(" canManageProductPreferences: ").append(toIndentedString(canManageProductPreferences)).append("\n"); + sb.append(" canManageIntegrations: ").append(toIndentedString(canManageIntegrations)).append("\n"); + sb.append(" canViewSdkKey: ").append(toIndentedString(canViewSdkKey)).append("\n"); + sb.append(" canRotateSdkKey: ").append(toIndentedString(canRotateSdkKey)).append("\n"); + sb.append(" canCreateOrUpdateSegments: ").append(toIndentedString(canCreateOrUpdateSegments)).append("\n"); + sb.append(" canDeleteSegments: ").append(toIndentedString(canDeleteSegments)).append("\n"); + sb.append(" canViewProductAuditLog: ").append(toIndentedString(canViewProductAuditLog)).append("\n"); + sb.append(" canViewProductStatistics: ").append(toIndentedString(canViewProductStatistics)).append("\n"); + sb.append(" canDisable2FA: ").append(toIndentedString(canDisable2FA)).append("\n"); + sb.append(" accessType: ").append(toIndentedString(accessType)).append("\n"); + sb.append(" newEnvironmentAccessType: ").append(toIndentedString(newEnvironmentAccessType)).append("\n"); + sb.append(" environmentAccesses: ").append(toIndentedString(environmentAccesses)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("canManageMembers"); + openapiFields.add("canCreateOrUpdateConfig"); + openapiFields.add("canDeleteConfig"); + openapiFields.add("canCreateOrUpdateEnvironment"); + openapiFields.add("canDeleteEnvironment"); + openapiFields.add("canCreateOrUpdateSetting"); + openapiFields.add("canTagSetting"); + openapiFields.add("canDeleteSetting"); + openapiFields.add("canCreateOrUpdateTag"); + openapiFields.add("canDeleteTag"); + openapiFields.add("canManageWebhook"); + openapiFields.add("canUseExportImport"); + openapiFields.add("canManageProductPreferences"); + openapiFields.add("canManageIntegrations"); + openapiFields.add("canViewSdkKey"); + openapiFields.add("canRotateSdkKey"); + openapiFields.add("canCreateOrUpdateSegments"); + openapiFields.add("canDeleteSegments"); + openapiFields.add("canViewProductAuditLog"); + openapiFields.add("canViewProductStatistics"); + openapiFields.add("canDisable2FA"); + openapiFields.add("accessType"); + openapiFields.add("newEnvironmentAccessType"); + openapiFields.add("environmentAccesses"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdatePermissionGroupRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdatePermissionGroupRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdatePermissionGroupRequest is not found in the empty JSON string", UpdatePermissionGroupRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + // validate the optional field `accessType` + if (jsonObj.get("accessType") != null && !jsonObj.get("accessType").isJsonNull()) { + AccessType.validateJsonElement(jsonObj.get("accessType")); + } + // validate the optional field `newEnvironmentAccessType` + if (jsonObj.get("newEnvironmentAccessType") != null && !jsonObj.get("newEnvironmentAccessType").isJsonNull()) { + EnvironmentAccessType.validateJsonElement(jsonObj.get("newEnvironmentAccessType")); + } + if (jsonObj.get("environmentAccesses") != null && !jsonObj.get("environmentAccesses").isJsonNull()) { + JsonArray jsonArrayenvironmentAccesses = jsonObj.getAsJsonArray("environmentAccesses"); + if (jsonArrayenvironmentAccesses != null) { + // ensure the json data is an array + if (!jsonObj.get("environmentAccesses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `environmentAccesses` to be an array in the JSON string but got `%s`", jsonObj.get("environmentAccesses").toString())); + } + + // validate the optional field `environmentAccesses` (array) + for (int i = 0; i < jsonArrayenvironmentAccesses.size(); i++) { + CreateOrUpdateEnvironmentAccessModel.validateJsonElement(jsonArrayenvironmentAccesses.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdatePermissionGroupRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdatePermissionGroupRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdatePermissionGroupRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdatePermissionGroupRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdatePermissionGroupRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdatePermissionGroupRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdatePermissionGroupRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdatePermissionGroupRequest + * @throws IOException if the JSON string is invalid with respect to UpdatePermissionGroupRequest + */ + public static UpdatePermissionGroupRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdatePermissionGroupRequest.class); + } + + /** + * Convert an instance of UpdatePermissionGroupRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdatePreferencesRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdatePreferencesRequest.java new file mode 100644 index 0000000..bc7515c --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdatePreferencesRequest.java @@ -0,0 +1,430 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.KeyGenerationMode; +import com.configcat.publicapi.java.client.model.UpdateReasonRequiredEnvironmentModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdatePreferencesRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdatePreferencesRequest { + public static final String SERIALIZED_NAME_REASON_REQUIRED = "reasonRequired"; + @SerializedName(SERIALIZED_NAME_REASON_REQUIRED) + private Boolean reasonRequired; + + public static final String SERIALIZED_NAME_KEY_GENERATION_MODE = "keyGenerationMode"; + @SerializedName(SERIALIZED_NAME_KEY_GENERATION_MODE) + private KeyGenerationMode keyGenerationMode; + + public static final String SERIALIZED_NAME_SHOW_VARIATION_ID = "showVariationId"; + @SerializedName(SERIALIZED_NAME_SHOW_VARIATION_ID) + private Boolean showVariationId; + + public static final String SERIALIZED_NAME_MANDATORY_SETTING_HINT = "mandatorySettingHint"; + @SerializedName(SERIALIZED_NAME_MANDATORY_SETTING_HINT) + private Boolean mandatorySettingHint; + + public static final String SERIALIZED_NAME_REASON_REQUIRED_ENVIRONMENTS = "reasonRequiredEnvironments"; + @SerializedName(SERIALIZED_NAME_REASON_REQUIRED_ENVIRONMENTS) + private List reasonRequiredEnvironments; + + public UpdatePreferencesRequest() { + } + + public UpdatePreferencesRequest reasonRequired(Boolean reasonRequired) { + this.reasonRequired = reasonRequired; + return this; + } + + /** + * Indicates that a mandatory note is required for saving and publishing. + * @return reasonRequired + */ + @javax.annotation.Nullable + public Boolean getReasonRequired() { + return reasonRequired; + } + + public void setReasonRequired(Boolean reasonRequired) { + this.reasonRequired = reasonRequired; + } + + + public UpdatePreferencesRequest keyGenerationMode(KeyGenerationMode keyGenerationMode) { + this.keyGenerationMode = keyGenerationMode; + return this; + } + + /** + * Get keyGenerationMode + * @return keyGenerationMode + */ + @javax.annotation.Nullable + public KeyGenerationMode getKeyGenerationMode() { + return keyGenerationMode; + } + + public void setKeyGenerationMode(KeyGenerationMode keyGenerationMode) { + this.keyGenerationMode = keyGenerationMode; + } + + + public UpdatePreferencesRequest showVariationId(Boolean showVariationId) { + this.showVariationId = showVariationId; + return this; + } + + /** + * Indicates whether a variation ID's must be shown on the ConfigCat Dashboard. + * @return showVariationId + */ + @javax.annotation.Nullable + public Boolean getShowVariationId() { + return showVariationId; + } + + public void setShowVariationId(Boolean showVariationId) { + this.showVariationId = showVariationId; + } + + + public UpdatePreferencesRequest mandatorySettingHint(Boolean mandatorySettingHint) { + this.mandatorySettingHint = mandatorySettingHint; + return this; + } + + /** + * Indicates whether Feature flags and Settings must have a hint. + * @return mandatorySettingHint + */ + @javax.annotation.Nullable + public Boolean getMandatorySettingHint() { + return mandatorySettingHint; + } + + public void setMandatorySettingHint(Boolean mandatorySettingHint) { + this.mandatorySettingHint = mandatorySettingHint; + } + + + public UpdatePreferencesRequest reasonRequiredEnvironments(List reasonRequiredEnvironments) { + this.reasonRequiredEnvironments = reasonRequiredEnvironments; + return this; + } + + public UpdatePreferencesRequest addReasonRequiredEnvironmentsItem(UpdateReasonRequiredEnvironmentModel reasonRequiredEnvironmentsItem) { + if (this.reasonRequiredEnvironments == null) { + this.reasonRequiredEnvironments = new ArrayList<>(); + } + this.reasonRequiredEnvironments.add(reasonRequiredEnvironmentsItem); + return this; + } + + /** + * List of Environments where mandatory note must be set before saving and publishing. + * @return reasonRequiredEnvironments + */ + @javax.annotation.Nullable + public List getReasonRequiredEnvironments() { + return reasonRequiredEnvironments; + } + + public void setReasonRequiredEnvironments(List reasonRequiredEnvironments) { + this.reasonRequiredEnvironments = reasonRequiredEnvironments; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdatePreferencesRequest instance itself + */ + public UpdatePreferencesRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdatePreferencesRequest updatePreferencesRequest = (UpdatePreferencesRequest) o; + return Objects.equals(this.reasonRequired, updatePreferencesRequest.reasonRequired) && + Objects.equals(this.keyGenerationMode, updatePreferencesRequest.keyGenerationMode) && + Objects.equals(this.showVariationId, updatePreferencesRequest.showVariationId) && + Objects.equals(this.mandatorySettingHint, updatePreferencesRequest.mandatorySettingHint) && + Objects.equals(this.reasonRequiredEnvironments, updatePreferencesRequest.reasonRequiredEnvironments)&& + Objects.equals(this.additionalProperties, updatePreferencesRequest.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(reasonRequired, keyGenerationMode, showVariationId, mandatorySettingHint, reasonRequiredEnvironments, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdatePreferencesRequest {\n"); + sb.append(" reasonRequired: ").append(toIndentedString(reasonRequired)).append("\n"); + sb.append(" keyGenerationMode: ").append(toIndentedString(keyGenerationMode)).append("\n"); + sb.append(" showVariationId: ").append(toIndentedString(showVariationId)).append("\n"); + sb.append(" mandatorySettingHint: ").append(toIndentedString(mandatorySettingHint)).append("\n"); + sb.append(" reasonRequiredEnvironments: ").append(toIndentedString(reasonRequiredEnvironments)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("reasonRequired"); + openapiFields.add("keyGenerationMode"); + openapiFields.add("showVariationId"); + openapiFields.add("mandatorySettingHint"); + openapiFields.add("reasonRequiredEnvironments"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdatePreferencesRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdatePreferencesRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdatePreferencesRequest is not found in the empty JSON string", UpdatePreferencesRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `keyGenerationMode` + if (jsonObj.get("keyGenerationMode") != null && !jsonObj.get("keyGenerationMode").isJsonNull()) { + KeyGenerationMode.validateJsonElement(jsonObj.get("keyGenerationMode")); + } + if (jsonObj.get("reasonRequiredEnvironments") != null && !jsonObj.get("reasonRequiredEnvironments").isJsonNull()) { + JsonArray jsonArrayreasonRequiredEnvironments = jsonObj.getAsJsonArray("reasonRequiredEnvironments"); + if (jsonArrayreasonRequiredEnvironments != null) { + // ensure the json data is an array + if (!jsonObj.get("reasonRequiredEnvironments").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `reasonRequiredEnvironments` to be an array in the JSON string but got `%s`", jsonObj.get("reasonRequiredEnvironments").toString())); + } + + // validate the optional field `reasonRequiredEnvironments` (array) + for (int i = 0; i < jsonArrayreasonRequiredEnvironments.size(); i++) { + UpdateReasonRequiredEnvironmentModel.validateJsonElement(jsonArrayreasonRequiredEnvironments.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdatePreferencesRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdatePreferencesRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdatePreferencesRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdatePreferencesRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdatePreferencesRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdatePreferencesRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdatePreferencesRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdatePreferencesRequest + * @throws IOException if the JSON string is invalid with respect to UpdatePreferencesRequest + */ + public static UpdatePreferencesRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdatePreferencesRequest.class); + } + + /** + * Convert an instance of UpdatePreferencesRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdatePrerequisiteFlagConditionModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdatePrerequisiteFlagConditionModel.java new file mode 100644 index 0000000..6ed53f3 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdatePrerequisiteFlagConditionModel.java @@ -0,0 +1,352 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.PrerequisiteComparator; +import com.configcat.publicapi.java.client.model.UpdateValueModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Describes a condition that is based on a prerequisite flag. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdatePrerequisiteFlagConditionModel { + public static final String SERIALIZED_NAME_PREREQUISITE_SETTING_ID = "prerequisiteSettingId"; + @SerializedName(SERIALIZED_NAME_PREREQUISITE_SETTING_ID) + private Integer prerequisiteSettingId; + + public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; + @SerializedName(SERIALIZED_NAME_COMPARATOR) + private PrerequisiteComparator comparator; + + public static final String SERIALIZED_NAME_PREREQUISITE_COMPARISON_VALUE = "prerequisiteComparisonValue"; + @SerializedName(SERIALIZED_NAME_PREREQUISITE_COMPARISON_VALUE) + private UpdateValueModel prerequisiteComparisonValue; + + public UpdatePrerequisiteFlagConditionModel() { + } + + public UpdatePrerequisiteFlagConditionModel prerequisiteSettingId(Integer prerequisiteSettingId) { + this.prerequisiteSettingId = prerequisiteSettingId; + return this; + } + + /** + * The prerequisite flag's identifier. + * @return prerequisiteSettingId + */ + @javax.annotation.Nonnull + public Integer getPrerequisiteSettingId() { + return prerequisiteSettingId; + } + + public void setPrerequisiteSettingId(Integer prerequisiteSettingId) { + this.prerequisiteSettingId = prerequisiteSettingId; + } + + + public UpdatePrerequisiteFlagConditionModel comparator(PrerequisiteComparator comparator) { + this.comparator = comparator; + return this; + } + + /** + * Get comparator + * @return comparator + */ + @javax.annotation.Nonnull + public PrerequisiteComparator getComparator() { + return comparator; + } + + public void setComparator(PrerequisiteComparator comparator) { + this.comparator = comparator; + } + + + public UpdatePrerequisiteFlagConditionModel prerequisiteComparisonValue(UpdateValueModel prerequisiteComparisonValue) { + this.prerequisiteComparisonValue = prerequisiteComparisonValue; + return this; + } + + /** + * Get prerequisiteComparisonValue + * @return prerequisiteComparisonValue + */ + @javax.annotation.Nonnull + public UpdateValueModel getPrerequisiteComparisonValue() { + return prerequisiteComparisonValue; + } + + public void setPrerequisiteComparisonValue(UpdateValueModel prerequisiteComparisonValue) { + this.prerequisiteComparisonValue = prerequisiteComparisonValue; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdatePrerequisiteFlagConditionModel instance itself + */ + public UpdatePrerequisiteFlagConditionModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdatePrerequisiteFlagConditionModel updatePrerequisiteFlagConditionModel = (UpdatePrerequisiteFlagConditionModel) o; + return Objects.equals(this.prerequisiteSettingId, updatePrerequisiteFlagConditionModel.prerequisiteSettingId) && + Objects.equals(this.comparator, updatePrerequisiteFlagConditionModel.comparator) && + Objects.equals(this.prerequisiteComparisonValue, updatePrerequisiteFlagConditionModel.prerequisiteComparisonValue)&& + Objects.equals(this.additionalProperties, updatePrerequisiteFlagConditionModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(prerequisiteSettingId, comparator, prerequisiteComparisonValue, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdatePrerequisiteFlagConditionModel {\n"); + sb.append(" prerequisiteSettingId: ").append(toIndentedString(prerequisiteSettingId)).append("\n"); + sb.append(" comparator: ").append(toIndentedString(comparator)).append("\n"); + sb.append(" prerequisiteComparisonValue: ").append(toIndentedString(prerequisiteComparisonValue)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("prerequisiteSettingId"); + openapiFields.add("comparator"); + openapiFields.add("prerequisiteComparisonValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("prerequisiteSettingId"); + openapiRequiredFields.add("comparator"); + openapiRequiredFields.add("prerequisiteComparisonValue"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdatePrerequisiteFlagConditionModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdatePrerequisiteFlagConditionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdatePrerequisiteFlagConditionModel is not found in the empty JSON string", UpdatePrerequisiteFlagConditionModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdatePrerequisiteFlagConditionModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `comparator` + PrerequisiteComparator.validateJsonElement(jsonObj.get("comparator")); + // validate the required field `prerequisiteComparisonValue` + UpdateValueModel.validateJsonElement(jsonObj.get("prerequisiteComparisonValue")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdatePrerequisiteFlagConditionModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdatePrerequisiteFlagConditionModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdatePrerequisiteFlagConditionModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdatePrerequisiteFlagConditionModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdatePrerequisiteFlagConditionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdatePrerequisiteFlagConditionModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdatePrerequisiteFlagConditionModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdatePrerequisiteFlagConditionModel + * @throws IOException if the JSON string is invalid with respect to UpdatePrerequisiteFlagConditionModel + */ + public static UpdatePrerequisiteFlagConditionModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdatePrerequisiteFlagConditionModel.class); + } + + /** + * Convert an instance of UpdatePrerequisiteFlagConditionModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateProductRequest.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateProductRequest.java new file mode 100644 index 0000000..665e48a --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateProductRequest.java @@ -0,0 +1,354 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdateProductRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateProductRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_ORDER = "order"; + @SerializedName(SERIALIZED_NAME_ORDER) + private Integer order; + + public UpdateProductRequest() { + } + + public UpdateProductRequest name(String name) { + this.name = name; + return this; + } + + /** + * The name of the Product. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public UpdateProductRequest description(String description) { + this.description = description; + return this; + } + + /** + * The description of the Product. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + + public UpdateProductRequest order(Integer order) { + this.order = order; + return this; + } + + /** + * The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers. + * @return order + */ + @javax.annotation.Nullable + public Integer getOrder() { + return order; + } + + public void setOrder(Integer order) { + this.order = order; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateProductRequest instance itself + */ + public UpdateProductRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateProductRequest updateProductRequest = (UpdateProductRequest) o; + return Objects.equals(this.name, updateProductRequest.name) && + Objects.equals(this.description, updateProductRequest.description) && + Objects.equals(this.order, updateProductRequest.order)&& + Objects.equals(this.additionalProperties, updateProductRequest.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, order, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateProductRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("order"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateProductRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateProductRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateProductRequest is not found in the empty JSON string", UpdateProductRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateProductRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateProductRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateProductRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateProductRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateProductRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateProductRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateProductRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateProductRequest + * @throws IOException if the JSON string is invalid with respect to UpdateProductRequest + */ + public static UpdateProductRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateProductRequest.class); + } + + /** + * Convert an instance of UpdateProductRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateReasonRequiredEnvironmentModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateReasonRequiredEnvironmentModel.java new file mode 100644 index 0000000..f7fec1c --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateReasonRequiredEnvironmentModel.java @@ -0,0 +1,314 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdateReasonRequiredEnvironmentModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateReasonRequiredEnvironmentModel { + public static final String SERIALIZED_NAME_ENVIRONMENT_ID = "environmentId"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) + private UUID environmentId; + + public static final String SERIALIZED_NAME_REASON_REQUIRED = "reasonRequired"; + @SerializedName(SERIALIZED_NAME_REASON_REQUIRED) + private Boolean reasonRequired; + + public UpdateReasonRequiredEnvironmentModel() { + } + + public UpdateReasonRequiredEnvironmentModel environmentId(UUID environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Identifier of the Environment. + * @return environmentId + */ + @javax.annotation.Nullable + public UUID getEnvironmentId() { + return environmentId; + } + + public void setEnvironmentId(UUID environmentId) { + this.environmentId = environmentId; + } + + + public UpdateReasonRequiredEnvironmentModel reasonRequired(Boolean reasonRequired) { + this.reasonRequired = reasonRequired; + return this; + } + + /** + * Indicates that a mandatory note is required in this Environment for saving and publishing. + * @return reasonRequired + */ + @javax.annotation.Nullable + public Boolean getReasonRequired() { + return reasonRequired; + } + + public void setReasonRequired(Boolean reasonRequired) { + this.reasonRequired = reasonRequired; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateReasonRequiredEnvironmentModel instance itself + */ + public UpdateReasonRequiredEnvironmentModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateReasonRequiredEnvironmentModel updateReasonRequiredEnvironmentModel = (UpdateReasonRequiredEnvironmentModel) o; + return Objects.equals(this.environmentId, updateReasonRequiredEnvironmentModel.environmentId) && + Objects.equals(this.reasonRequired, updateReasonRequiredEnvironmentModel.reasonRequired)&& + Objects.equals(this.additionalProperties, updateReasonRequiredEnvironmentModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(environmentId, reasonRequired, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateReasonRequiredEnvironmentModel {\n"); + sb.append(" environmentId: ").append(toIndentedString(environmentId)).append("\n"); + sb.append(" reasonRequired: ").append(toIndentedString(reasonRequired)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("environmentId"); + openapiFields.add("reasonRequired"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateReasonRequiredEnvironmentModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateReasonRequiredEnvironmentModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateReasonRequiredEnvironmentModel is not found in the empty JSON string", UpdateReasonRequiredEnvironmentModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("environmentId") != null && !jsonObj.get("environmentId").isJsonNull()) && !jsonObj.get("environmentId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `environmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateReasonRequiredEnvironmentModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateReasonRequiredEnvironmentModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateReasonRequiredEnvironmentModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateReasonRequiredEnvironmentModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateReasonRequiredEnvironmentModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateReasonRequiredEnvironmentModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateReasonRequiredEnvironmentModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateReasonRequiredEnvironmentModel + * @throws IOException if the JSON string is invalid with respect to UpdateReasonRequiredEnvironmentModel + */ + public static UpdateReasonRequiredEnvironmentModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateReasonRequiredEnvironmentModel.class); + } + + /** + * Convert an instance of UpdateReasonRequiredEnvironmentModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateRolloutPercentageItemModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateRolloutPercentageItemModel.java new file mode 100644 index 0000000..a3a5196 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateRolloutPercentageItemModel.java @@ -0,0 +1,322 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.SettingValueType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdateRolloutPercentageItemModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateRolloutPercentageItemModel { + public static final String SERIALIZED_NAME_PERCENTAGE = "percentage"; + @SerializedName(SERIALIZED_NAME_PERCENTAGE) + private Long percentage; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private SettingValueType value; + + public UpdateRolloutPercentageItemModel() { + } + + public UpdateRolloutPercentageItemModel percentage(Long percentage) { + this.percentage = percentage; + return this; + } + + /** + * The percentage value for the rule. + * @return percentage + */ + @javax.annotation.Nonnull + public Long getPercentage() { + return percentage; + } + + public void setPercentage(Long percentage) { + this.percentage = percentage; + } + + + public UpdateRolloutPercentageItemModel value(SettingValueType value) { + this.value = value; + return this; + } + + /** + * The value to serve when the user falls in the percentage rule. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. + * @return value + */ + @javax.annotation.Nonnull + public SettingValueType getValue() { + return value; + } + + public void setValue(SettingValueType value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateRolloutPercentageItemModel instance itself + */ + public UpdateRolloutPercentageItemModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateRolloutPercentageItemModel updateRolloutPercentageItemModel = (UpdateRolloutPercentageItemModel) o; + return Objects.equals(this.percentage, updateRolloutPercentageItemModel.percentage) && + Objects.equals(this.value, updateRolloutPercentageItemModel.value)&& + Objects.equals(this.additionalProperties, updateRolloutPercentageItemModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(percentage, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateRolloutPercentageItemModel {\n"); + sb.append(" percentage: ").append(toIndentedString(percentage)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("percentage"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("percentage"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateRolloutPercentageItemModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateRolloutPercentageItemModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateRolloutPercentageItemModel is not found in the empty JSON string", UpdateRolloutPercentageItemModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateRolloutPercentageItemModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `value` + SettingValueType.validateJsonElement(jsonObj.get("value")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateRolloutPercentageItemModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateRolloutPercentageItemModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateRolloutPercentageItemModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateRolloutPercentageItemModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateRolloutPercentageItemModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateRolloutPercentageItemModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateRolloutPercentageItemModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateRolloutPercentageItemModel + * @throws IOException if the JSON string is invalid with respect to UpdateRolloutPercentageItemModel + */ + public static UpdateRolloutPercentageItemModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateRolloutPercentageItemModel.class); + } + + /** + * Convert an instance of UpdateRolloutPercentageItemModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateRolloutRuleModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateRolloutRuleModel.java new file mode 100644 index 0000000..2ca2bac --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateRolloutRuleModel.java @@ -0,0 +1,457 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.RolloutRuleComparator; +import com.configcat.publicapi.java.client.model.SegmentComparator; +import com.configcat.publicapi.java.client.model.SettingValueType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdateRolloutRuleModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateRolloutRuleModel { + public static final String SERIALIZED_NAME_COMPARISON_ATTRIBUTE = "comparisonAttribute"; + @SerializedName(SERIALIZED_NAME_COMPARISON_ATTRIBUTE) + private String comparisonAttribute; + + public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; + @SerializedName(SERIALIZED_NAME_COMPARATOR) + private RolloutRuleComparator comparator; + + public static final String SERIALIZED_NAME_COMPARISON_VALUE = "comparisonValue"; + @SerializedName(SERIALIZED_NAME_COMPARISON_VALUE) + private String comparisonValue; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private SettingValueType value; + + public static final String SERIALIZED_NAME_SEGMENT_COMPARATOR = "segmentComparator"; + @SerializedName(SERIALIZED_NAME_SEGMENT_COMPARATOR) + private SegmentComparator segmentComparator; + + public static final String SERIALIZED_NAME_SEGMENT_ID = "segmentId"; + @SerializedName(SERIALIZED_NAME_SEGMENT_ID) + private UUID segmentId; + + public UpdateRolloutRuleModel() { + } + + public UpdateRolloutRuleModel comparisonAttribute(String comparisonAttribute) { + this.comparisonAttribute = comparisonAttribute; + return this; + } + + /** + * The user attribute to compare. + * @return comparisonAttribute + */ + @javax.annotation.Nullable + public String getComparisonAttribute() { + return comparisonAttribute; + } + + public void setComparisonAttribute(String comparisonAttribute) { + this.comparisonAttribute = comparisonAttribute; + } + + + public UpdateRolloutRuleModel comparator(RolloutRuleComparator comparator) { + this.comparator = comparator; + return this; + } + + /** + * Get comparator + * @return comparator + */ + @javax.annotation.Nullable + public RolloutRuleComparator getComparator() { + return comparator; + } + + public void setComparator(RolloutRuleComparator comparator) { + this.comparator = comparator; + } + + + public UpdateRolloutRuleModel comparisonValue(String comparisonValue) { + this.comparisonValue = comparisonValue; + return this; + } + + /** + * The value to compare against. + * @return comparisonValue + */ + @javax.annotation.Nullable + public String getComparisonValue() { + return comparisonValue; + } + + public void setComparisonValue(String comparisonValue) { + this.comparisonValue = comparisonValue; + } + + + public UpdateRolloutRuleModel value(SettingValueType value) { + this.value = value; + return this; + } + + /** + * The value to serve when the comparison matches. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. + * @return value + */ + @javax.annotation.Nonnull + public SettingValueType getValue() { + return value; + } + + public void setValue(SettingValueType value) { + this.value = value; + } + + + public UpdateRolloutRuleModel segmentComparator(SegmentComparator segmentComparator) { + this.segmentComparator = segmentComparator; + return this; + } + + /** + * Get segmentComparator + * @return segmentComparator + */ + @javax.annotation.Nullable + public SegmentComparator getSegmentComparator() { + return segmentComparator; + } + + public void setSegmentComparator(SegmentComparator segmentComparator) { + this.segmentComparator = segmentComparator; + } + + + public UpdateRolloutRuleModel segmentId(UUID segmentId) { + this.segmentId = segmentId; + return this; + } + + /** + * The segment to compare against. + * @return segmentId + */ + @javax.annotation.Nullable + public UUID getSegmentId() { + return segmentId; + } + + public void setSegmentId(UUID segmentId) { + this.segmentId = segmentId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateRolloutRuleModel instance itself + */ + public UpdateRolloutRuleModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateRolloutRuleModel updateRolloutRuleModel = (UpdateRolloutRuleModel) o; + return Objects.equals(this.comparisonAttribute, updateRolloutRuleModel.comparisonAttribute) && + Objects.equals(this.comparator, updateRolloutRuleModel.comparator) && + Objects.equals(this.comparisonValue, updateRolloutRuleModel.comparisonValue) && + Objects.equals(this.value, updateRolloutRuleModel.value) && + Objects.equals(this.segmentComparator, updateRolloutRuleModel.segmentComparator) && + Objects.equals(this.segmentId, updateRolloutRuleModel.segmentId)&& + Objects.equals(this.additionalProperties, updateRolloutRuleModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(comparisonAttribute, comparator, comparisonValue, value, segmentComparator, segmentId, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateRolloutRuleModel {\n"); + sb.append(" comparisonAttribute: ").append(toIndentedString(comparisonAttribute)).append("\n"); + sb.append(" comparator: ").append(toIndentedString(comparator)).append("\n"); + sb.append(" comparisonValue: ").append(toIndentedString(comparisonValue)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" segmentComparator: ").append(toIndentedString(segmentComparator)).append("\n"); + sb.append(" segmentId: ").append(toIndentedString(segmentId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("comparisonAttribute"); + openapiFields.add("comparator"); + openapiFields.add("comparisonValue"); + openapiFields.add("value"); + openapiFields.add("segmentComparator"); + openapiFields.add("segmentId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateRolloutRuleModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateRolloutRuleModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateRolloutRuleModel is not found in the empty JSON string", UpdateRolloutRuleModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateRolloutRuleModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("comparisonAttribute") != null && !jsonObj.get("comparisonAttribute").isJsonNull()) && !jsonObj.get("comparisonAttribute").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `comparisonAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonAttribute").toString())); + } + // validate the optional field `comparator` + if (jsonObj.get("comparator") != null && !jsonObj.get("comparator").isJsonNull()) { + RolloutRuleComparator.validateJsonElement(jsonObj.get("comparator")); + } + if ((jsonObj.get("comparisonValue") != null && !jsonObj.get("comparisonValue").isJsonNull()) && !jsonObj.get("comparisonValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `comparisonValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonValue").toString())); + } + // validate the required field `value` + SettingValueType.validateJsonElement(jsonObj.get("value")); + // validate the optional field `segmentComparator` + if (jsonObj.get("segmentComparator") != null && !jsonObj.get("segmentComparator").isJsonNull()) { + SegmentComparator.validateJsonElement(jsonObj.get("segmentComparator")); + } + if ((jsonObj.get("segmentId") != null && !jsonObj.get("segmentId").isJsonNull()) && !jsonObj.get("segmentId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `segmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("segmentId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateRolloutRuleModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateRolloutRuleModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateRolloutRuleModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateRolloutRuleModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateRolloutRuleModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateRolloutRuleModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateRolloutRuleModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateRolloutRuleModel + * @throws IOException if the JSON string is invalid with respect to UpdateRolloutRuleModel + */ + public static UpdateRolloutRuleModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateRolloutRuleModel.class); + } + + /** + * Convert an instance of UpdateRolloutRuleModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateSegmentConditionModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateSegmentConditionModel.java new file mode 100644 index 0000000..fde91c6 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateSegmentConditionModel.java @@ -0,0 +1,326 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.SegmentComparator; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Describes a condition that is based on a segment. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateSegmentConditionModel { + public static final String SERIALIZED_NAME_SEGMENT_ID = "segmentId"; + @SerializedName(SERIALIZED_NAME_SEGMENT_ID) + private UUID segmentId; + + public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; + @SerializedName(SERIALIZED_NAME_COMPARATOR) + private SegmentComparator comparator; + + public UpdateSegmentConditionModel() { + } + + public UpdateSegmentConditionModel segmentId(UUID segmentId) { + this.segmentId = segmentId; + return this; + } + + /** + * The segment's identifier. + * @return segmentId + */ + @javax.annotation.Nonnull + public UUID getSegmentId() { + return segmentId; + } + + public void setSegmentId(UUID segmentId) { + this.segmentId = segmentId; + } + + + public UpdateSegmentConditionModel comparator(SegmentComparator comparator) { + this.comparator = comparator; + return this; + } + + /** + * Get comparator + * @return comparator + */ + @javax.annotation.Nonnull + public SegmentComparator getComparator() { + return comparator; + } + + public void setComparator(SegmentComparator comparator) { + this.comparator = comparator; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateSegmentConditionModel instance itself + */ + public UpdateSegmentConditionModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSegmentConditionModel updateSegmentConditionModel = (UpdateSegmentConditionModel) o; + return Objects.equals(this.segmentId, updateSegmentConditionModel.segmentId) && + Objects.equals(this.comparator, updateSegmentConditionModel.comparator)&& + Objects.equals(this.additionalProperties, updateSegmentConditionModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(segmentId, comparator, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateSegmentConditionModel {\n"); + sb.append(" segmentId: ").append(toIndentedString(segmentId)).append("\n"); + sb.append(" comparator: ").append(toIndentedString(comparator)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("segmentId"); + openapiFields.add("comparator"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("segmentId"); + openapiRequiredFields.add("comparator"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateSegmentConditionModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateSegmentConditionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateSegmentConditionModel is not found in the empty JSON string", UpdateSegmentConditionModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateSegmentConditionModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("segmentId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `segmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("segmentId").toString())); + } + // validate the required field `comparator` + SegmentComparator.validateJsonElement(jsonObj.get("comparator")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateSegmentConditionModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateSegmentConditionModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateSegmentConditionModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateSegmentConditionModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateSegmentConditionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateSegmentConditionModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateSegmentConditionModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateSegmentConditionModel + * @throws IOException if the JSON string is invalid with respect to UpdateSegmentConditionModel + */ + public static UpdateSegmentConditionModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateSegmentConditionModel.class); + } + + /** + * Convert an instance of UpdateSegmentConditionModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateSegmentModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateSegmentModel.java new file mode 100644 index 0000000..468c9d7 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateSegmentModel.java @@ -0,0 +1,417 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.RolloutRuleComparator; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdateSegmentModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateSegmentModel { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_COMPARISON_ATTRIBUTE = "comparisonAttribute"; + @SerializedName(SERIALIZED_NAME_COMPARISON_ATTRIBUTE) + private String comparisonAttribute; + + public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; + @SerializedName(SERIALIZED_NAME_COMPARATOR) + private RolloutRuleComparator comparator; + + public static final String SERIALIZED_NAME_COMPARISON_VALUE = "comparisonValue"; + @SerializedName(SERIALIZED_NAME_COMPARISON_VALUE) + private String comparisonValue; + + public UpdateSegmentModel() { + } + + public UpdateSegmentModel name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public UpdateSegmentModel description(String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + + public UpdateSegmentModel comparisonAttribute(String comparisonAttribute) { + this.comparisonAttribute = comparisonAttribute; + return this; + } + + /** + * Get comparisonAttribute + * @return comparisonAttribute + */ + @javax.annotation.Nullable + public String getComparisonAttribute() { + return comparisonAttribute; + } + + public void setComparisonAttribute(String comparisonAttribute) { + this.comparisonAttribute = comparisonAttribute; + } + + + public UpdateSegmentModel comparator(RolloutRuleComparator comparator) { + this.comparator = comparator; + return this; + } + + /** + * Get comparator + * @return comparator + */ + @javax.annotation.Nullable + public RolloutRuleComparator getComparator() { + return comparator; + } + + public void setComparator(RolloutRuleComparator comparator) { + this.comparator = comparator; + } + + + public UpdateSegmentModel comparisonValue(String comparisonValue) { + this.comparisonValue = comparisonValue; + return this; + } + + /** + * Get comparisonValue + * @return comparisonValue + */ + @javax.annotation.Nullable + public String getComparisonValue() { + return comparisonValue; + } + + public void setComparisonValue(String comparisonValue) { + this.comparisonValue = comparisonValue; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateSegmentModel instance itself + */ + public UpdateSegmentModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSegmentModel updateSegmentModel = (UpdateSegmentModel) o; + return Objects.equals(this.name, updateSegmentModel.name) && + Objects.equals(this.description, updateSegmentModel.description) && + Objects.equals(this.comparisonAttribute, updateSegmentModel.comparisonAttribute) && + Objects.equals(this.comparator, updateSegmentModel.comparator) && + Objects.equals(this.comparisonValue, updateSegmentModel.comparisonValue)&& + Objects.equals(this.additionalProperties, updateSegmentModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, comparisonAttribute, comparator, comparisonValue, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateSegmentModel {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" comparisonAttribute: ").append(toIndentedString(comparisonAttribute)).append("\n"); + sb.append(" comparator: ").append(toIndentedString(comparator)).append("\n"); + sb.append(" comparisonValue: ").append(toIndentedString(comparisonValue)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("comparisonAttribute"); + openapiFields.add("comparator"); + openapiFields.add("comparisonValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateSegmentModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateSegmentModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateSegmentModel is not found in the empty JSON string", UpdateSegmentModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if ((jsonObj.get("comparisonAttribute") != null && !jsonObj.get("comparisonAttribute").isJsonNull()) && !jsonObj.get("comparisonAttribute").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `comparisonAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonAttribute").toString())); + } + // validate the optional field `comparator` + if (jsonObj.get("comparator") != null && !jsonObj.get("comparator").isJsonNull()) { + RolloutRuleComparator.validateJsonElement(jsonObj.get("comparator")); + } + if ((jsonObj.get("comparisonValue") != null && !jsonObj.get("comparisonValue").isJsonNull()) && !jsonObj.get("comparisonValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `comparisonValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonValue").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateSegmentModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateSegmentModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateSegmentModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateSegmentModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateSegmentModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateSegmentModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateSegmentModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateSegmentModel + * @throws IOException if the JSON string is invalid with respect to UpdateSegmentModel + */ + public static UpdateSegmentModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateSegmentModel.class); + } + + /** + * Convert an instance of UpdateSegmentModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueModel.java new file mode 100644 index 0000000..6ba0494 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueModel.java @@ -0,0 +1,395 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.SettingValueType; +import com.configcat.publicapi.java.client.model.UpdateRolloutPercentageItemModel; +import com.configcat.publicapi.java.client.model.UpdateRolloutRuleModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdateSettingValueModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateSettingValueModel { + public static final String SERIALIZED_NAME_ROLLOUT_RULES = "rolloutRules"; + @SerializedName(SERIALIZED_NAME_ROLLOUT_RULES) + private List rolloutRules = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS = "rolloutPercentageItems"; + @SerializedName(SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS) + private List rolloutPercentageItems = new ArrayList<>(); + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private SettingValueType value; + + public UpdateSettingValueModel() { + } + + public UpdateSettingValueModel rolloutRules(List rolloutRules) { + this.rolloutRules = rolloutRules; + return this; + } + + public UpdateSettingValueModel addRolloutRulesItem(UpdateRolloutRuleModel rolloutRulesItem) { + if (this.rolloutRules == null) { + this.rolloutRules = new ArrayList<>(); + } + this.rolloutRules.add(rolloutRulesItem); + return this; + } + + /** + * The targeting rule collection. + * @return rolloutRules + */ + @javax.annotation.Nullable + public List getRolloutRules() { + return rolloutRules; + } + + public void setRolloutRules(List rolloutRules) { + this.rolloutRules = rolloutRules; + } + + + public UpdateSettingValueModel rolloutPercentageItems(List rolloutPercentageItems) { + this.rolloutPercentageItems = rolloutPercentageItems; + return this; + } + + public UpdateSettingValueModel addRolloutPercentageItemsItem(UpdateRolloutPercentageItemModel rolloutPercentageItemsItem) { + if (this.rolloutPercentageItems == null) { + this.rolloutPercentageItems = new ArrayList<>(); + } + this.rolloutPercentageItems.add(rolloutPercentageItemsItem); + return this; + } + + /** + * The percentage rule collection. + * @return rolloutPercentageItems + */ + @javax.annotation.Nullable + public List getRolloutPercentageItems() { + return rolloutPercentageItems; + } + + public void setRolloutPercentageItems(List rolloutPercentageItems) { + this.rolloutPercentageItems = rolloutPercentageItems; + } + + + public UpdateSettingValueModel value(SettingValueType value) { + this.value = value; + return this; + } + + /** + * The value to serve. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. + * @return value + */ + @javax.annotation.Nonnull + public SettingValueType getValue() { + return value; + } + + public void setValue(SettingValueType value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateSettingValueModel instance itself + */ + public UpdateSettingValueModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSettingValueModel updateSettingValueModel = (UpdateSettingValueModel) o; + return Objects.equals(this.rolloutRules, updateSettingValueModel.rolloutRules) && + Objects.equals(this.rolloutPercentageItems, updateSettingValueModel.rolloutPercentageItems) && + Objects.equals(this.value, updateSettingValueModel.value)&& + Objects.equals(this.additionalProperties, updateSettingValueModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(rolloutRules, rolloutPercentageItems, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateSettingValueModel {\n"); + sb.append(" rolloutRules: ").append(toIndentedString(rolloutRules)).append("\n"); + sb.append(" rolloutPercentageItems: ").append(toIndentedString(rolloutPercentageItems)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rolloutRules"); + openapiFields.add("rolloutPercentageItems"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateSettingValueModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateSettingValueModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateSettingValueModel is not found in the empty JSON string", UpdateSettingValueModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateSettingValueModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("rolloutRules") != null && !jsonObj.get("rolloutRules").isJsonNull()) { + JsonArray jsonArrayrolloutRules = jsonObj.getAsJsonArray("rolloutRules"); + if (jsonArrayrolloutRules != null) { + // ensure the json data is an array + if (!jsonObj.get("rolloutRules").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rolloutRules` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutRules").toString())); + } + + // validate the optional field `rolloutRules` (array) + for (int i = 0; i < jsonArrayrolloutRules.size(); i++) { + UpdateRolloutRuleModel.validateJsonElement(jsonArrayrolloutRules.get(i)); + }; + } + } + if (jsonObj.get("rolloutPercentageItems") != null && !jsonObj.get("rolloutPercentageItems").isJsonNull()) { + JsonArray jsonArrayrolloutPercentageItems = jsonObj.getAsJsonArray("rolloutPercentageItems"); + if (jsonArrayrolloutPercentageItems != null) { + // ensure the json data is an array + if (!jsonObj.get("rolloutPercentageItems").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rolloutPercentageItems` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutPercentageItems").toString())); + } + + // validate the optional field `rolloutPercentageItems` (array) + for (int i = 0; i < jsonArrayrolloutPercentageItems.size(); i++) { + UpdateRolloutPercentageItemModel.validateJsonElement(jsonArrayrolloutPercentageItems.get(i)); + }; + } + } + // validate the required field `value` + SettingValueType.validateJsonElement(jsonObj.get("value")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateSettingValueModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateSettingValueModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateSettingValueModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateSettingValueModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateSettingValueModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateSettingValueModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateSettingValueModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateSettingValueModel + * @throws IOException if the JSON string is invalid with respect to UpdateSettingValueModel + */ + public static UpdateSettingValueModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateSettingValueModel.class); + } + + /** + * Convert an instance of UpdateSettingValueModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueWithSettingIdModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueWithSettingIdModel.java new file mode 100644 index 0000000..bb5bcdb --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueWithSettingIdModel.java @@ -0,0 +1,421 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.SettingValueType; +import com.configcat.publicapi.java.client.model.UpdateRolloutPercentageItemModel; +import com.configcat.publicapi.java.client.model.UpdateRolloutRuleModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdateSettingValueWithSettingIdModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateSettingValueWithSettingIdModel { + public static final String SERIALIZED_NAME_ROLLOUT_RULES = "rolloutRules"; + @SerializedName(SERIALIZED_NAME_ROLLOUT_RULES) + private List rolloutRules = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS = "rolloutPercentageItems"; + @SerializedName(SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS) + private List rolloutPercentageItems = new ArrayList<>(); + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private SettingValueType value; + + public static final String SERIALIZED_NAME_SETTING_ID = "settingId"; + @SerializedName(SERIALIZED_NAME_SETTING_ID) + private Integer settingId; + + public UpdateSettingValueWithSettingIdModel() { + } + + public UpdateSettingValueWithSettingIdModel rolloutRules(List rolloutRules) { + this.rolloutRules = rolloutRules; + return this; + } + + public UpdateSettingValueWithSettingIdModel addRolloutRulesItem(UpdateRolloutRuleModel rolloutRulesItem) { + if (this.rolloutRules == null) { + this.rolloutRules = new ArrayList<>(); + } + this.rolloutRules.add(rolloutRulesItem); + return this; + } + + /** + * The targeting rule collection. + * @return rolloutRules + */ + @javax.annotation.Nullable + public List getRolloutRules() { + return rolloutRules; + } + + public void setRolloutRules(List rolloutRules) { + this.rolloutRules = rolloutRules; + } + + + public UpdateSettingValueWithSettingIdModel rolloutPercentageItems(List rolloutPercentageItems) { + this.rolloutPercentageItems = rolloutPercentageItems; + return this; + } + + public UpdateSettingValueWithSettingIdModel addRolloutPercentageItemsItem(UpdateRolloutPercentageItemModel rolloutPercentageItemsItem) { + if (this.rolloutPercentageItems == null) { + this.rolloutPercentageItems = new ArrayList<>(); + } + this.rolloutPercentageItems.add(rolloutPercentageItemsItem); + return this; + } + + /** + * The percentage rule collection. + * @return rolloutPercentageItems + */ + @javax.annotation.Nullable + public List getRolloutPercentageItems() { + return rolloutPercentageItems; + } + + public void setRolloutPercentageItems(List rolloutPercentageItems) { + this.rolloutPercentageItems = rolloutPercentageItems; + } + + + public UpdateSettingValueWithSettingIdModel value(SettingValueType value) { + this.value = value; + return this; + } + + /** + * The value to serve. It must respect the setting type. In some generated clients for strictly typed languages you may use double/float properties to handle integer values. + * @return value + */ + @javax.annotation.Nonnull + public SettingValueType getValue() { + return value; + } + + public void setValue(SettingValueType value) { + this.value = value; + } + + + public UpdateSettingValueWithSettingIdModel settingId(Integer settingId) { + this.settingId = settingId; + return this; + } + + /** + * The id of the Setting. + * @return settingId + */ + @javax.annotation.Nullable + public Integer getSettingId() { + return settingId; + } + + public void setSettingId(Integer settingId) { + this.settingId = settingId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateSettingValueWithSettingIdModel instance itself + */ + public UpdateSettingValueWithSettingIdModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSettingValueWithSettingIdModel updateSettingValueWithSettingIdModel = (UpdateSettingValueWithSettingIdModel) o; + return Objects.equals(this.rolloutRules, updateSettingValueWithSettingIdModel.rolloutRules) && + Objects.equals(this.rolloutPercentageItems, updateSettingValueWithSettingIdModel.rolloutPercentageItems) && + Objects.equals(this.value, updateSettingValueWithSettingIdModel.value) && + Objects.equals(this.settingId, updateSettingValueWithSettingIdModel.settingId)&& + Objects.equals(this.additionalProperties, updateSettingValueWithSettingIdModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(rolloutRules, rolloutPercentageItems, value, settingId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateSettingValueWithSettingIdModel {\n"); + sb.append(" rolloutRules: ").append(toIndentedString(rolloutRules)).append("\n"); + sb.append(" rolloutPercentageItems: ").append(toIndentedString(rolloutPercentageItems)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" settingId: ").append(toIndentedString(settingId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rolloutRules"); + openapiFields.add("rolloutPercentageItems"); + openapiFields.add("value"); + openapiFields.add("settingId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateSettingValueWithSettingIdModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateSettingValueWithSettingIdModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateSettingValueWithSettingIdModel is not found in the empty JSON string", UpdateSettingValueWithSettingIdModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateSettingValueWithSettingIdModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("rolloutRules") != null && !jsonObj.get("rolloutRules").isJsonNull()) { + JsonArray jsonArrayrolloutRules = jsonObj.getAsJsonArray("rolloutRules"); + if (jsonArrayrolloutRules != null) { + // ensure the json data is an array + if (!jsonObj.get("rolloutRules").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rolloutRules` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutRules").toString())); + } + + // validate the optional field `rolloutRules` (array) + for (int i = 0; i < jsonArrayrolloutRules.size(); i++) { + UpdateRolloutRuleModel.validateJsonElement(jsonArrayrolloutRules.get(i)); + }; + } + } + if (jsonObj.get("rolloutPercentageItems") != null && !jsonObj.get("rolloutPercentageItems").isJsonNull()) { + JsonArray jsonArrayrolloutPercentageItems = jsonObj.getAsJsonArray("rolloutPercentageItems"); + if (jsonArrayrolloutPercentageItems != null) { + // ensure the json data is an array + if (!jsonObj.get("rolloutPercentageItems").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rolloutPercentageItems` to be an array in the JSON string but got `%s`", jsonObj.get("rolloutPercentageItems").toString())); + } + + // validate the optional field `rolloutPercentageItems` (array) + for (int i = 0; i < jsonArrayrolloutPercentageItems.size(); i++) { + UpdateRolloutPercentageItemModel.validateJsonElement(jsonArrayrolloutPercentageItems.get(i)); + }; + } + } + // validate the required field `value` + SettingValueType.validateJsonElement(jsonObj.get("value")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateSettingValueWithSettingIdModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateSettingValueWithSettingIdModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateSettingValueWithSettingIdModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateSettingValueWithSettingIdModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateSettingValueWithSettingIdModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateSettingValueWithSettingIdModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateSettingValueWithSettingIdModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateSettingValueWithSettingIdModel + * @throws IOException if the JSON string is invalid with respect to UpdateSettingValueWithSettingIdModel + */ + public static UpdateSettingValueWithSettingIdModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateSettingValueWithSettingIdModel.class); + } + + /** + * Convert an instance of UpdateSettingValueWithSettingIdModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValuesWithIdModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValuesWithIdModel.java new file mode 100644 index 0000000..d690880 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValuesWithIdModel.java @@ -0,0 +1,309 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.UpdateSettingValueWithSettingIdModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdateSettingValuesWithIdModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateSettingValuesWithIdModel { + public static final String SERIALIZED_NAME_SETTING_VALUES = "settingValues"; + @SerializedName(SERIALIZED_NAME_SETTING_VALUES) + private List settingValues = new ArrayList<>(); + + public UpdateSettingValuesWithIdModel() { + } + + public UpdateSettingValuesWithIdModel settingValues(List settingValues) { + this.settingValues = settingValues; + return this; + } + + public UpdateSettingValuesWithIdModel addSettingValuesItem(UpdateSettingValueWithSettingIdModel settingValuesItem) { + if (this.settingValues == null) { + this.settingValues = new ArrayList<>(); + } + this.settingValues.add(settingValuesItem); + return this; + } + + /** + * The values to update. + * @return settingValues + */ + @javax.annotation.Nullable + public List getSettingValues() { + return settingValues; + } + + public void setSettingValues(List settingValues) { + this.settingValues = settingValues; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateSettingValuesWithIdModel instance itself + */ + public UpdateSettingValuesWithIdModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSettingValuesWithIdModel updateSettingValuesWithIdModel = (UpdateSettingValuesWithIdModel) o; + return Objects.equals(this.settingValues, updateSettingValuesWithIdModel.settingValues)&& + Objects.equals(this.additionalProperties, updateSettingValuesWithIdModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(settingValues, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateSettingValuesWithIdModel {\n"); + sb.append(" settingValues: ").append(toIndentedString(settingValues)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("settingValues"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateSettingValuesWithIdModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateSettingValuesWithIdModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateSettingValuesWithIdModel is not found in the empty JSON string", UpdateSettingValuesWithIdModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("settingValues") != null && !jsonObj.get("settingValues").isJsonNull()) { + JsonArray jsonArraysettingValues = jsonObj.getAsJsonArray("settingValues"); + if (jsonArraysettingValues != null) { + // ensure the json data is an array + if (!jsonObj.get("settingValues").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `settingValues` to be an array in the JSON string but got `%s`", jsonObj.get("settingValues").toString())); + } + + // validate the optional field `settingValues` (array) + for (int i = 0; i < jsonArraysettingValues.size(); i++) { + UpdateSettingValueWithSettingIdModel.validateJsonElement(jsonArraysettingValues.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateSettingValuesWithIdModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateSettingValuesWithIdModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateSettingValuesWithIdModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateSettingValuesWithIdModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateSettingValuesWithIdModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateSettingValuesWithIdModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateSettingValuesWithIdModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateSettingValuesWithIdModel + * @throws IOException if the JSON string is invalid with respect to UpdateSettingValuesWithIdModel + */ + public static UpdateSettingValuesWithIdModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateSettingValuesWithIdModel.class); + } + + /** + * Convert an instance of UpdateSettingValuesWithIdModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateTagModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateTagModel.java new file mode 100644 index 0000000..7919e3c --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateTagModel.java @@ -0,0 +1,328 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdateTagModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateTagModel { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_COLOR = "color"; + @SerializedName(SERIALIZED_NAME_COLOR) + private String color; + + public UpdateTagModel() { + } + + public UpdateTagModel name(String name) { + this.name = name; + return this; + } + + /** + * Name of the Tag. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public UpdateTagModel color(String color) { + this.color = color; + return this; + } + + /** + * Color of the Tag. Possible values: `panther`, `whale`, `salmon`, `lizard`, `canary`, `koala`, or any HTML color code. + * @return color + */ + @javax.annotation.Nullable + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateTagModel instance itself + */ + public UpdateTagModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateTagModel updateTagModel = (UpdateTagModel) o; + return Objects.equals(this.name, updateTagModel.name) && + Objects.equals(this.color, updateTagModel.color)&& + Objects.equals(this.additionalProperties, updateTagModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, color, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateTagModel {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("color"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateTagModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateTagModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateTagModel is not found in the empty JSON string", UpdateTagModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("color") != null && !jsonObj.get("color").isJsonNull()) && !jsonObj.get("color").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateTagModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateTagModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateTagModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateTagModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateTagModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateTagModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateTagModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateTagModel + * @throws IOException if the JSON string is invalid with respect to UpdateTagModel + */ + public static UpdateTagModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateTagModel.class); + } + + /** + * Convert an instance of UpdateTagModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateTargetingRuleModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateTargetingRuleModel.java new file mode 100644 index 0000000..7fe0089 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateTargetingRuleModel.java @@ -0,0 +1,401 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.UpdateConditionModel; +import com.configcat.publicapi.java.client.model.UpdatePercentageOptionModel; +import com.configcat.publicapi.java.client.model.UpdateValueModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UpdateTargetingRuleModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateTargetingRuleModel { + public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; + @SerializedName(SERIALIZED_NAME_CONDITIONS) + private List conditions; + + public static final String SERIALIZED_NAME_PERCENTAGE_OPTIONS = "percentageOptions"; + @SerializedName(SERIALIZED_NAME_PERCENTAGE_OPTIONS) + private List percentageOptions; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private UpdateValueModel value; + + public UpdateTargetingRuleModel() { + } + + public UpdateTargetingRuleModel conditions(List conditions) { + this.conditions = conditions; + return this; + } + + public UpdateTargetingRuleModel addConditionsItem(UpdateConditionModel conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList<>(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * The list of conditions that are combined with logical AND operators. It can be one of the following: - User condition - Segment condition - Prerequisite flag condition + * @return conditions + */ + @javax.annotation.Nullable + public List getConditions() { + return conditions; + } + + public void setConditions(List conditions) { + this.conditions = conditions; + } + + + public UpdateTargetingRuleModel percentageOptions(List percentageOptions) { + this.percentageOptions = percentageOptions; + return this; + } + + public UpdateTargetingRuleModel addPercentageOptionsItem(UpdatePercentageOptionModel percentageOptionsItem) { + if (this.percentageOptions == null) { + this.percentageOptions = new ArrayList<>(); + } + this.percentageOptions.add(percentageOptionsItem); + return this; + } + + /** + * The percentage options from where the evaluation process will choose a value based on the flag's percentage evaluation attribute. + * @return percentageOptions + */ + @javax.annotation.Nullable + public List getPercentageOptions() { + return percentageOptions; + } + + public void setPercentageOptions(List percentageOptions) { + this.percentageOptions = percentageOptions; + } + + + public UpdateTargetingRuleModel value(UpdateValueModel value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nullable + public UpdateValueModel getValue() { + return value; + } + + public void setValue(UpdateValueModel value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateTargetingRuleModel instance itself + */ + public UpdateTargetingRuleModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateTargetingRuleModel updateTargetingRuleModel = (UpdateTargetingRuleModel) o; + return Objects.equals(this.conditions, updateTargetingRuleModel.conditions) && + Objects.equals(this.percentageOptions, updateTargetingRuleModel.percentageOptions) && + Objects.equals(this.value, updateTargetingRuleModel.value)&& + Objects.equals(this.additionalProperties, updateTargetingRuleModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(conditions, percentageOptions, value, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateTargetingRuleModel {\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append(" percentageOptions: ").append(toIndentedString(percentageOptions)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("conditions"); + openapiFields.add("percentageOptions"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateTargetingRuleModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateTargetingRuleModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateTargetingRuleModel is not found in the empty JSON string", UpdateTargetingRuleModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("conditions") != null && !jsonObj.get("conditions").isJsonNull()) { + JsonArray jsonArrayconditions = jsonObj.getAsJsonArray("conditions"); + if (jsonArrayconditions != null) { + // ensure the json data is an array + if (!jsonObj.get("conditions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `conditions` to be an array in the JSON string but got `%s`", jsonObj.get("conditions").toString())); + } + + // validate the optional field `conditions` (array) + for (int i = 0; i < jsonArrayconditions.size(); i++) { + UpdateConditionModel.validateJsonElement(jsonArrayconditions.get(i)); + }; + } + } + if (jsonObj.get("percentageOptions") != null && !jsonObj.get("percentageOptions").isJsonNull()) { + JsonArray jsonArraypercentageOptions = jsonObj.getAsJsonArray("percentageOptions"); + if (jsonArraypercentageOptions != null) { + // ensure the json data is an array + if (!jsonObj.get("percentageOptions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `percentageOptions` to be an array in the JSON string but got `%s`", jsonObj.get("percentageOptions").toString())); + } + + // validate the optional field `percentageOptions` (array) + for (int i = 0; i < jsonArraypercentageOptions.size(); i++) { + UpdatePercentageOptionModel.validateJsonElement(jsonArraypercentageOptions.get(i)); + }; + } + } + // validate the optional field `value` + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { + UpdateValueModel.validateJsonElement(jsonObj.get("value")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateTargetingRuleModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateTargetingRuleModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateTargetingRuleModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateTargetingRuleModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateTargetingRuleModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateTargetingRuleModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateTargetingRuleModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateTargetingRuleModel + * @throws IOException if the JSON string is invalid with respect to UpdateTargetingRuleModel + */ + public static UpdateTargetingRuleModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateTargetingRuleModel.class); + } + + /** + * Convert an instance of UpdateTargetingRuleModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateUserConditionModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateUserConditionModel.java new file mode 100644 index 0000000..706438c --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateUserConditionModel.java @@ -0,0 +1,355 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.UpdateComparisonValueModel; +import com.configcat.publicapi.java.client.model.UserComparator; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Describes a condition that is based on user attributes. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateUserConditionModel { + public static final String SERIALIZED_NAME_COMPARISON_ATTRIBUTE = "comparisonAttribute"; + @SerializedName(SERIALIZED_NAME_COMPARISON_ATTRIBUTE) + private String comparisonAttribute; + + public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; + @SerializedName(SERIALIZED_NAME_COMPARATOR) + private UserComparator comparator; + + public static final String SERIALIZED_NAME_COMPARISON_VALUE = "comparisonValue"; + @SerializedName(SERIALIZED_NAME_COMPARISON_VALUE) + private UpdateComparisonValueModel comparisonValue; + + public UpdateUserConditionModel() { + } + + public UpdateUserConditionModel comparisonAttribute(String comparisonAttribute) { + this.comparisonAttribute = comparisonAttribute; + return this; + } + + /** + * The User Object attribute that the condition is based on. Can be \"User ID\", \"Email\", \"Country\" or any custom attribute. + * @return comparisonAttribute + */ + @javax.annotation.Nonnull + public String getComparisonAttribute() { + return comparisonAttribute; + } + + public void setComparisonAttribute(String comparisonAttribute) { + this.comparisonAttribute = comparisonAttribute; + } + + + public UpdateUserConditionModel comparator(UserComparator comparator) { + this.comparator = comparator; + return this; + } + + /** + * Get comparator + * @return comparator + */ + @javax.annotation.Nonnull + public UserComparator getComparator() { + return comparator; + } + + public void setComparator(UserComparator comparator) { + this.comparator = comparator; + } + + + public UpdateUserConditionModel comparisonValue(UpdateComparisonValueModel comparisonValue) { + this.comparisonValue = comparisonValue; + return this; + } + + /** + * Get comparisonValue + * @return comparisonValue + */ + @javax.annotation.Nonnull + public UpdateComparisonValueModel getComparisonValue() { + return comparisonValue; + } + + public void setComparisonValue(UpdateComparisonValueModel comparisonValue) { + this.comparisonValue = comparisonValue; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateUserConditionModel instance itself + */ + public UpdateUserConditionModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateUserConditionModel updateUserConditionModel = (UpdateUserConditionModel) o; + return Objects.equals(this.comparisonAttribute, updateUserConditionModel.comparisonAttribute) && + Objects.equals(this.comparator, updateUserConditionModel.comparator) && + Objects.equals(this.comparisonValue, updateUserConditionModel.comparisonValue)&& + Objects.equals(this.additionalProperties, updateUserConditionModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(comparisonAttribute, comparator, comparisonValue, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateUserConditionModel {\n"); + sb.append(" comparisonAttribute: ").append(toIndentedString(comparisonAttribute)).append("\n"); + sb.append(" comparator: ").append(toIndentedString(comparator)).append("\n"); + sb.append(" comparisonValue: ").append(toIndentedString(comparisonValue)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("comparisonAttribute"); + openapiFields.add("comparator"); + openapiFields.add("comparisonValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("comparisonAttribute"); + openapiRequiredFields.add("comparator"); + openapiRequiredFields.add("comparisonValue"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateUserConditionModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateUserConditionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateUserConditionModel is not found in the empty JSON string", UpdateUserConditionModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateUserConditionModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("comparisonAttribute").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `comparisonAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonAttribute").toString())); + } + // validate the required field `comparator` + UserComparator.validateJsonElement(jsonObj.get("comparator")); + // validate the required field `comparisonValue` + UpdateComparisonValueModel.validateJsonElement(jsonObj.get("comparisonValue")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateUserConditionModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateUserConditionModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateUserConditionModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateUserConditionModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateUserConditionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateUserConditionModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateUserConditionModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateUserConditionModel + * @throws IOException if the JSON string is invalid with respect to UpdateUserConditionModel + */ + public static UpdateUserConditionModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateUserConditionModel.class); + } + + /** + * Convert an instance of UpdateUserConditionModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UpdateValueModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UpdateValueModel.java new file mode 100644 index 0000000..42110a7 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateValueModel.java @@ -0,0 +1,377 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Represents the value of a Feature Flag or Setting. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UpdateValueModel { + public static final String SERIALIZED_NAME_BOOL_VALUE = "boolValue"; + @SerializedName(SERIALIZED_NAME_BOOL_VALUE) + private Boolean boolValue; + + public static final String SERIALIZED_NAME_STRING_VALUE = "stringValue"; + @SerializedName(SERIALIZED_NAME_STRING_VALUE) + private String stringValue; + + public static final String SERIALIZED_NAME_INT_VALUE = "intValue"; + @SerializedName(SERIALIZED_NAME_INT_VALUE) + private Integer intValue; + + public static final String SERIALIZED_NAME_DOUBLE_VALUE = "doubleValue"; + @SerializedName(SERIALIZED_NAME_DOUBLE_VALUE) + private Double doubleValue; + + public UpdateValueModel() { + } + + public UpdateValueModel boolValue(Boolean boolValue) { + this.boolValue = boolValue; + return this; + } + + /** + * The served value in case of a boolean Feature Flag. + * @return boolValue + */ + @javax.annotation.Nullable + public Boolean getBoolValue() { + return boolValue; + } + + public void setBoolValue(Boolean boolValue) { + this.boolValue = boolValue; + } + + + public UpdateValueModel stringValue(String stringValue) { + this.stringValue = stringValue; + return this; + } + + /** + * The served value in case of a text Setting. + * @return stringValue + */ + @javax.annotation.Nullable + public String getStringValue() { + return stringValue; + } + + public void setStringValue(String stringValue) { + this.stringValue = stringValue; + } + + + public UpdateValueModel intValue(Integer intValue) { + this.intValue = intValue; + return this; + } + + /** + * The served value in case of a whole number Setting. + * @return intValue + */ + @javax.annotation.Nullable + public Integer getIntValue() { + return intValue; + } + + public void setIntValue(Integer intValue) { + this.intValue = intValue; + } + + + public UpdateValueModel doubleValue(Double doubleValue) { + this.doubleValue = doubleValue; + return this; + } + + /** + * The served value in case of a decimal number Setting. + * @return doubleValue + */ + @javax.annotation.Nullable + public Double getDoubleValue() { + return doubleValue; + } + + public void setDoubleValue(Double doubleValue) { + this.doubleValue = doubleValue; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateValueModel instance itself + */ + public UpdateValueModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateValueModel updateValueModel = (UpdateValueModel) o; + return Objects.equals(this.boolValue, updateValueModel.boolValue) && + Objects.equals(this.stringValue, updateValueModel.stringValue) && + Objects.equals(this.intValue, updateValueModel.intValue) && + Objects.equals(this.doubleValue, updateValueModel.doubleValue)&& + Objects.equals(this.additionalProperties, updateValueModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(boolValue, stringValue, intValue, doubleValue, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateValueModel {\n"); + sb.append(" boolValue: ").append(toIndentedString(boolValue)).append("\n"); + sb.append(" stringValue: ").append(toIndentedString(stringValue)).append("\n"); + sb.append(" intValue: ").append(toIndentedString(intValue)).append("\n"); + sb.append(" doubleValue: ").append(toIndentedString(doubleValue)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("boolValue"); + openapiFields.add("stringValue"); + openapiFields.add("intValue"); + openapiFields.add("doubleValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateValueModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateValueModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateValueModel is not found in the empty JSON string", UpdateValueModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("stringValue") != null && !jsonObj.get("stringValue").isJsonNull()) && !jsonObj.get("stringValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stringValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stringValue").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateValueModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateValueModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateValueModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateValueModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateValueModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateValueModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateValueModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateValueModel + * @throws IOException if the JSON string is invalid with respect to UpdateValueModel + */ + public static UpdateValueModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateValueModel.class); + } + + /** + * Convert an instance of UpdateValueModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UserComparator.java b/src/main/java/com/configcat/publicapi/java/client/model/UserComparator.java new file mode 100644 index 0000000..c8a4362 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UserComparator.java @@ -0,0 +1,146 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * The comparison operator which defines the relation between the comparison attribute and the comparison value. + */ +@JsonAdapter(UserComparator.Adapter.class) +public enum UserComparator { + + IS_ONE_OF("isOneOf"), + + IS_NOT_ONE_OF("isNotOneOf"), + + CONTAINS_ANY_OF("containsAnyOf"), + + DOES_NOT_CONTAIN_ANY_OF("doesNotContainAnyOf"), + + SEM_VER_IS_ONE_OF("semVerIsOneOf"), + + SEM_VER_IS_NOT_ONE_OF("semVerIsNotOneOf"), + + SEM_VER_LESS("semVerLess"), + + SEM_VER_LESS_OR_EQUALS("semVerLessOrEquals"), + + SEM_VER_GREATER("semVerGreater"), + + SEM_VER_GREATER_OR_EQUALS("semVerGreaterOrEquals"), + + NUMBER_EQUALS("numberEquals"), + + NUMBER_DOES_NOT_EQUAL("numberDoesNotEqual"), + + NUMBER_LESS("numberLess"), + + NUMBER_LESS_OR_EQUALS("numberLessOrEquals"), + + NUMBER_GREATER("numberGreater"), + + NUMBER_GREATER_OR_EQUALS("numberGreaterOrEquals"), + + SENSITIVE_IS_ONE_OF("sensitiveIsOneOf"), + + SENSITIVE_IS_NOT_ONE_OF("sensitiveIsNotOneOf"), + + DATE_TIME_BEFORE("dateTimeBefore"), + + DATE_TIME_AFTER("dateTimeAfter"), + + SENSITIVE_TEXT_EQUALS("sensitiveTextEquals"), + + SENSITIVE_TEXT_DOES_NOT_EQUAL("sensitiveTextDoesNotEqual"), + + SENSITIVE_TEXT_STARTS_WITH_ANY_OF("sensitiveTextStartsWithAnyOf"), + + SENSITIVE_TEXT_NOT_STARTS_WITH_ANY_OF("sensitiveTextNotStartsWithAnyOf"), + + SENSITIVE_TEXT_ENDS_WITH_ANY_OF("sensitiveTextEndsWithAnyOf"), + + SENSITIVE_TEXT_NOT_ENDS_WITH_ANY_OF("sensitiveTextNotEndsWithAnyOf"), + + SENSITIVE_ARRAY_CONTAINS_ANY_OF("sensitiveArrayContainsAnyOf"), + + SENSITIVE_ARRAY_DOES_NOT_CONTAIN_ANY_OF("sensitiveArrayDoesNotContainAnyOf"), + + TEXT_EQUALS("textEquals"), + + TEXT_DOES_NOT_EQUAL("textDoesNotEqual"), + + TEXT_STARTS_WITH_ANY_OF("textStartsWithAnyOf"), + + TEXT_NOT_STARTS_WITH_ANY_OF("textNotStartsWithAnyOf"), + + TEXT_ENDS_WITH_ANY_OF("textEndsWithAnyOf"), + + TEXT_NOT_ENDS_WITH_ANY_OF("textNotEndsWithAnyOf"), + + ARRAY_CONTAINS_ANY_OF("arrayContainsAnyOf"), + + ARRAY_DOES_NOT_CONTAIN_ANY_OF("arrayDoesNotContainAnyOf"); + + private String value; + + UserComparator(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static UserComparator fromValue(String value) { + for (UserComparator b : UserComparator.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final UserComparator enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public UserComparator read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return UserComparator.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + UserComparator.fromValue(value); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UserConditionModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UserConditionModel.java new file mode 100644 index 0000000..6ac68d4 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UserConditionModel.java @@ -0,0 +1,355 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.ComparisonValueModel; +import com.configcat.publicapi.java.client.model.UserComparator; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Describes a condition that is based on user attributes. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UserConditionModel { + public static final String SERIALIZED_NAME_COMPARISON_ATTRIBUTE = "comparisonAttribute"; + @SerializedName(SERIALIZED_NAME_COMPARISON_ATTRIBUTE) + private String comparisonAttribute; + + public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; + @SerializedName(SERIALIZED_NAME_COMPARATOR) + private UserComparator comparator; + + public static final String SERIALIZED_NAME_COMPARISON_VALUE = "comparisonValue"; + @SerializedName(SERIALIZED_NAME_COMPARISON_VALUE) + private ComparisonValueModel comparisonValue; + + public UserConditionModel() { + } + + public UserConditionModel comparisonAttribute(String comparisonAttribute) { + this.comparisonAttribute = comparisonAttribute; + return this; + } + + /** + * The User Object attribute that the condition is based on. Can be \"User ID\", \"Email\", \"Country\" or any custom attribute. + * @return comparisonAttribute + */ + @javax.annotation.Nonnull + public String getComparisonAttribute() { + return comparisonAttribute; + } + + public void setComparisonAttribute(String comparisonAttribute) { + this.comparisonAttribute = comparisonAttribute; + } + + + public UserConditionModel comparator(UserComparator comparator) { + this.comparator = comparator; + return this; + } + + /** + * Get comparator + * @return comparator + */ + @javax.annotation.Nonnull + public UserComparator getComparator() { + return comparator; + } + + public void setComparator(UserComparator comparator) { + this.comparator = comparator; + } + + + public UserConditionModel comparisonValue(ComparisonValueModel comparisonValue) { + this.comparisonValue = comparisonValue; + return this; + } + + /** + * Get comparisonValue + * @return comparisonValue + */ + @javax.annotation.Nonnull + public ComparisonValueModel getComparisonValue() { + return comparisonValue; + } + + public void setComparisonValue(ComparisonValueModel comparisonValue) { + this.comparisonValue = comparisonValue; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UserConditionModel instance itself + */ + public UserConditionModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserConditionModel userConditionModel = (UserConditionModel) o; + return Objects.equals(this.comparisonAttribute, userConditionModel.comparisonAttribute) && + Objects.equals(this.comparator, userConditionModel.comparator) && + Objects.equals(this.comparisonValue, userConditionModel.comparisonValue)&& + Objects.equals(this.additionalProperties, userConditionModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(comparisonAttribute, comparator, comparisonValue, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserConditionModel {\n"); + sb.append(" comparisonAttribute: ").append(toIndentedString(comparisonAttribute)).append("\n"); + sb.append(" comparator: ").append(toIndentedString(comparator)).append("\n"); + sb.append(" comparisonValue: ").append(toIndentedString(comparisonValue)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("comparisonAttribute"); + openapiFields.add("comparator"); + openapiFields.add("comparisonValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("comparisonAttribute"); + openapiRequiredFields.add("comparator"); + openapiRequiredFields.add("comparisonValue"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserConditionModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserConditionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserConditionModel is not found in the empty JSON string", UserConditionModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserConditionModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("comparisonAttribute").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `comparisonAttribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparisonAttribute").toString())); + } + // validate the required field `comparator` + UserComparator.validateJsonElement(jsonObj.get("comparator")); + // validate the required field `comparisonValue` + ComparisonValueModel.validateJsonElement(jsonObj.get("comparisonValue")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserConditionModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserConditionModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserConditionModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserConditionModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UserConditionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UserConditionModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserConditionModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserConditionModel + * @throws IOException if the JSON string is invalid with respect to UserConditionModel + */ + public static UserConditionModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserConditionModel.class); + } + + /** + * Convert an instance of UserConditionModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/UserModel.java b/src/main/java/com/configcat/publicapi/java/client/model/UserModel.java new file mode 100644 index 0000000..52f76f4 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UserModel.java @@ -0,0 +1,382 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * UserModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class UserModel { + public static final String SERIALIZED_NAME_USER_ID = "userId"; + @SerializedName(SERIALIZED_NAME_USER_ID) + private String userId; + + public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; + @SerializedName(SERIALIZED_NAME_FULL_NAME) + private String fullName; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_TWO_FACTOR_ENABLED = "twoFactorEnabled"; + @SerializedName(SERIALIZED_NAME_TWO_FACTOR_ENABLED) + private Boolean twoFactorEnabled; + + public UserModel() { + } + + public UserModel userId(String userId) { + this.userId = userId; + return this; + } + + /** + * Identifier of the Member. + * @return userId + */ + @javax.annotation.Nullable + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + + public UserModel fullName(String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Name of the Member. + * @return fullName + */ + @javax.annotation.Nullable + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + + public UserModel email(String email) { + this.email = email; + return this; + } + + /** + * Email of the Member. + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + public UserModel twoFactorEnabled(Boolean twoFactorEnabled) { + this.twoFactorEnabled = twoFactorEnabled; + return this; + } + + /** + * Determines whether 2FA is enabled for the Member. + * @return twoFactorEnabled + */ + @javax.annotation.Nonnull + public Boolean getTwoFactorEnabled() { + return twoFactorEnabled; + } + + public void setTwoFactorEnabled(Boolean twoFactorEnabled) { + this.twoFactorEnabled = twoFactorEnabled; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UserModel instance itself + */ + public UserModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserModel userModel = (UserModel) o; + return Objects.equals(this.userId, userModel.userId) && + Objects.equals(this.fullName, userModel.fullName) && + Objects.equals(this.email, userModel.email) && + Objects.equals(this.twoFactorEnabled, userModel.twoFactorEnabled)&& + Objects.equals(this.additionalProperties, userModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(userId, fullName, email, twoFactorEnabled, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserModel {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" twoFactorEnabled: ").append(toIndentedString(twoFactorEnabled)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("userId"); + openapiFields.add("fullName"); + openapiFields.add("email"); + openapiFields.add("twoFactorEnabled"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("userId"); + openapiRequiredFields.add("fullName"); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("twoFactorEnabled"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserModel is not found in the empty JSON string", UserModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("userId") != null && !jsonObj.get("userId").isJsonNull()) && !jsonObj.get("userId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString())); + } + if ((jsonObj.get("fullName") != null && !jsonObj.get("fullName").isJsonNull()) && !jsonObj.get("fullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UserModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UserModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserModel + * @throws IOException if the JSON string is invalid with respect to UserModel + */ + public static UserModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserModel.class); + } + + /** + * Convert an instance of UserModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/ValueModel.java b/src/main/java/com/configcat/publicapi/java/client/model/ValueModel.java new file mode 100644 index 0000000..3ed0264 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/ValueModel.java @@ -0,0 +1,376 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * Represents the value of a Feature Flag or Setting. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class ValueModel { + public static final String SERIALIZED_NAME_BOOL_VALUE = "boolValue"; + @SerializedName(SERIALIZED_NAME_BOOL_VALUE) + private Boolean boolValue; + + public static final String SERIALIZED_NAME_STRING_VALUE = "stringValue"; + @SerializedName(SERIALIZED_NAME_STRING_VALUE) + private String stringValue; + + public static final String SERIALIZED_NAME_INT_VALUE = "intValue"; + @SerializedName(SERIALIZED_NAME_INT_VALUE) + private Integer intValue; + + public static final String SERIALIZED_NAME_DOUBLE_VALUE = "doubleValue"; + @SerializedName(SERIALIZED_NAME_DOUBLE_VALUE) + private Double doubleValue; + + public ValueModel() { + } + + public ValueModel boolValue(Boolean boolValue) { + this.boolValue = boolValue; + return this; + } + + /** + * The served value in case of a boolean Feature Flag. + * @return boolValue + */ + @javax.annotation.Nullable + public Boolean getBoolValue() { + return boolValue; + } + + public void setBoolValue(Boolean boolValue) { + this.boolValue = boolValue; + } + + + public ValueModel stringValue(String stringValue) { + this.stringValue = stringValue; + return this; + } + + /** + * The served value in case of a text Setting. + * @return stringValue + */ + @javax.annotation.Nullable + public String getStringValue() { + return stringValue; + } + + public void setStringValue(String stringValue) { + this.stringValue = stringValue; + } + + + public ValueModel intValue(Integer intValue) { + this.intValue = intValue; + return this; + } + + /** + * The served value in case of a whole number Setting. + * @return intValue + */ + @javax.annotation.Nullable + public Integer getIntValue() { + return intValue; + } + + public void setIntValue(Integer intValue) { + this.intValue = intValue; + } + + + public ValueModel doubleValue(Double doubleValue) { + this.doubleValue = doubleValue; + return this; + } + + /** + * The served value in case of a decimal number Setting. + * @return doubleValue + */ + @javax.annotation.Nullable + public Double getDoubleValue() { + return doubleValue; + } + + public void setDoubleValue(Double doubleValue) { + this.doubleValue = doubleValue; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ValueModel instance itself + */ + public ValueModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ValueModel valueModel = (ValueModel) o; + return Objects.equals(this.boolValue, valueModel.boolValue) && + Objects.equals(this.stringValue, valueModel.stringValue) && + Objects.equals(this.intValue, valueModel.intValue) && + Objects.equals(this.doubleValue, valueModel.doubleValue)&& + Objects.equals(this.additionalProperties, valueModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(boolValue, stringValue, intValue, doubleValue, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ValueModel {\n"); + sb.append(" boolValue: ").append(toIndentedString(boolValue)).append("\n"); + sb.append(" stringValue: ").append(toIndentedString(stringValue)).append("\n"); + sb.append(" intValue: ").append(toIndentedString(intValue)).append("\n"); + sb.append(" doubleValue: ").append(toIndentedString(doubleValue)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("boolValue"); + openapiFields.add("stringValue"); + openapiFields.add("intValue"); + openapiFields.add("doubleValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("boolValue"); + openapiRequiredFields.add("stringValue"); + openapiRequiredFields.add("intValue"); + openapiRequiredFields.add("doubleValue"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ValueModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ValueModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ValueModel is not found in the empty JSON string", ValueModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ValueModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("stringValue") != null && !jsonObj.get("stringValue").isJsonNull()) && !jsonObj.get("stringValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stringValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stringValue").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ValueModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ValueModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ValueModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ValueModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ValueModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ValueModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ValueModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ValueModel + * @throws IOException if the JSON string is invalid with respect to ValueModel + */ + public static ValueModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ValueModel.class); + } + + /** + * Convert an instance of ValueModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/WebHookHttpMethod.java b/src/main/java/com/configcat/publicapi/java/client/model/WebHookHttpMethod.java new file mode 100644 index 0000000..01b30f7 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/WebHookHttpMethod.java @@ -0,0 +1,78 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets WebHookHttpMethod + */ +@JsonAdapter(WebHookHttpMethod.Adapter.class) +public enum WebHookHttpMethod { + + GET("get"), + + POST("post"); + + private String value; + + WebHookHttpMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WebHookHttpMethod fromValue(String value) { + for (WebHookHttpMethod b : WebHookHttpMethod.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WebHookHttpMethod enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WebHookHttpMethod read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WebHookHttpMethod.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + WebHookHttpMethod.fromValue(value); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/WebHookRequestModel.java b/src/main/java/com/configcat/publicapi/java/client/model/WebHookRequestModel.java new file mode 100644 index 0000000..8e356d9 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/WebHookRequestModel.java @@ -0,0 +1,418 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.WebHookHttpMethod; +import com.configcat.publicapi.java.client.model.WebhookHeaderModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * WebHookRequestModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class WebHookRequestModel { + public static final String SERIALIZED_NAME_URL = "url"; + @SerializedName(SERIALIZED_NAME_URL) + private String url; + + public static final String SERIALIZED_NAME_CONTENT = "content"; + @SerializedName(SERIALIZED_NAME_CONTENT) + private String content; + + public static final String SERIALIZED_NAME_HTTP_METHOD = "httpMethod"; + @SerializedName(SERIALIZED_NAME_HTTP_METHOD) + private WebHookHttpMethod httpMethod; + + public static final String SERIALIZED_NAME_WEB_HOOK_HEADERS = "webHookHeaders"; + @SerializedName(SERIALIZED_NAME_WEB_HOOK_HEADERS) + private List webHookHeaders; + + public WebHookRequestModel() { + } + + public WebHookRequestModel url(String url) { + this.url = url; + return this; + } + + /** + * The URL of the Webhook. + * @return url + */ + @javax.annotation.Nonnull + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + + public WebHookRequestModel content(String content) { + this.content = content; + return this; + } + + /** + * The HTTP body content. + * @return content + */ + @javax.annotation.Nullable + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + + public WebHookRequestModel httpMethod(WebHookHttpMethod httpMethod) { + this.httpMethod = httpMethod; + return this; + } + + /** + * Get httpMethod + * @return httpMethod + */ + @javax.annotation.Nullable + public WebHookHttpMethod getHttpMethod() { + return httpMethod; + } + + public void setHttpMethod(WebHookHttpMethod httpMethod) { + this.httpMethod = httpMethod; + } + + + public WebHookRequestModel webHookHeaders(List webHookHeaders) { + this.webHookHeaders = webHookHeaders; + return this; + } + + public WebHookRequestModel addWebHookHeadersItem(WebhookHeaderModel webHookHeadersItem) { + if (this.webHookHeaders == null) { + this.webHookHeaders = new ArrayList<>(); + } + this.webHookHeaders.add(webHookHeadersItem); + return this; + } + + /** + * List of HTTP headers. + * @return webHookHeaders + */ + @javax.annotation.Nullable + public List getWebHookHeaders() { + return webHookHeaders; + } + + public void setWebHookHeaders(List webHookHeaders) { + this.webHookHeaders = webHookHeaders; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WebHookRequestModel instance itself + */ + public WebHookRequestModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebHookRequestModel webHookRequestModel = (WebHookRequestModel) o; + return Objects.equals(this.url, webHookRequestModel.url) && + Objects.equals(this.content, webHookRequestModel.content) && + Objects.equals(this.httpMethod, webHookRequestModel.httpMethod) && + Objects.equals(this.webHookHeaders, webHookRequestModel.webHookHeaders)&& + Objects.equals(this.additionalProperties, webHookRequestModel.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(url, content, httpMethod, webHookHeaders, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebHookRequestModel {\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" httpMethod: ").append(toIndentedString(httpMethod)).append("\n"); + sb.append(" webHookHeaders: ").append(toIndentedString(webHookHeaders)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("url"); + openapiFields.add("content"); + openapiFields.add("httpMethod"); + openapiFields.add("webHookHeaders"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("url"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebHookRequestModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebHookRequestModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebHookRequestModel is not found in the empty JSON string", WebHookRequestModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebHookRequestModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + } + if ((jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) && !jsonObj.get("content").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `content` to be a primitive type in the JSON string but got `%s`", jsonObj.get("content").toString())); + } + // validate the optional field `httpMethod` + if (jsonObj.get("httpMethod") != null && !jsonObj.get("httpMethod").isJsonNull()) { + WebHookHttpMethod.validateJsonElement(jsonObj.get("httpMethod")); + } + if (jsonObj.get("webHookHeaders") != null && !jsonObj.get("webHookHeaders").isJsonNull()) { + JsonArray jsonArraywebHookHeaders = jsonObj.getAsJsonArray("webHookHeaders"); + if (jsonArraywebHookHeaders != null) { + // ensure the json data is an array + if (!jsonObj.get("webHookHeaders").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `webHookHeaders` to be an array in the JSON string but got `%s`", jsonObj.get("webHookHeaders").toString())); + } + + // validate the optional field `webHookHeaders` (array) + for (int i = 0; i < jsonArraywebHookHeaders.size(); i++) { + WebhookHeaderModel.validateJsonElement(jsonArraywebHookHeaders.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebHookRequestModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebHookRequestModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebHookRequestModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebHookRequestModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WebHookRequestModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WebHookRequestModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebHookRequestModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebHookRequestModel + * @throws IOException if the JSON string is invalid with respect to WebHookRequestModel + */ + public static WebHookRequestModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebHookRequestModel.class); + } + + /** + * Convert an instance of WebHookRequestModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/WebhookConfig.java b/src/main/java/com/configcat/publicapi/java/client/model/WebhookConfig.java new file mode 100644 index 0000000..bde467d --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/WebhookConfig.java @@ -0,0 +1,326 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * The Config where the applied changes will invoke the Webhook. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class WebhookConfig { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_CONFIG_ID = "configId"; + @SerializedName(SERIALIZED_NAME_CONFIG_ID) + private UUID configId; + + public WebhookConfig() { + } + + public WebhookConfig name(String name) { + this.name = name; + return this; + } + + /** + * The Config's name. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public WebhookConfig configId(UUID configId) { + this.configId = configId; + return this; + } + + /** + * The Config's identifier. + * @return configId + */ + @javax.annotation.Nonnull + public UUID getConfigId() { + return configId; + } + + public void setConfigId(UUID configId) { + this.configId = configId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WebhookConfig instance itself + */ + public WebhookConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebhookConfig webhookConfig = (WebhookConfig) o; + return Objects.equals(this.name, webhookConfig.name) && + Objects.equals(this.configId, webhookConfig.configId)&& + Objects.equals(this.additionalProperties, webhookConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, configId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebhookConfig {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" configId: ").append(toIndentedString(configId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("configId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("configId"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebhookConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebhookConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookConfig is not found in the empty JSON string", WebhookConfig.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebhookConfig.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("configId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `configId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("configId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebhookConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebhookConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebhookConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebhookConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WebhookConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WebhookConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebhookConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebhookConfig + * @throws IOException if the JSON string is invalid with respect to WebhookConfig + */ + public static WebhookConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebhookConfig.class); + } + + /** + * Convert an instance of WebhookConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/WebhookEnvironment.java b/src/main/java/com/configcat/publicapi/java/client/model/WebhookEnvironment.java new file mode 100644 index 0000000..3db9671 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/WebhookEnvironment.java @@ -0,0 +1,326 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * The Environment where the applied changes will invoke the Webhook. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class WebhookEnvironment { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_ENVIRONMENT_ID = "environmentId"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) + private UUID environmentId; + + public WebhookEnvironment() { + } + + public WebhookEnvironment name(String name) { + this.name = name; + return this; + } + + /** + * The Environment's name. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public WebhookEnvironment environmentId(UUID environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * The Environment's identifier. + * @return environmentId + */ + @javax.annotation.Nonnull + public UUID getEnvironmentId() { + return environmentId; + } + + public void setEnvironmentId(UUID environmentId) { + this.environmentId = environmentId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WebhookEnvironment instance itself + */ + public WebhookEnvironment putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebhookEnvironment webhookEnvironment = (WebhookEnvironment) o; + return Objects.equals(this.name, webhookEnvironment.name) && + Objects.equals(this.environmentId, webhookEnvironment.environmentId)&& + Objects.equals(this.additionalProperties, webhookEnvironment.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, environmentId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebhookEnvironment {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" environmentId: ").append(toIndentedString(environmentId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("environmentId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("environmentId"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebhookEnvironment + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebhookEnvironment.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookEnvironment is not found in the empty JSON string", WebhookEnvironment.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebhookEnvironment.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("environmentId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `environmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebhookEnvironment.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebhookEnvironment' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebhookEnvironment.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebhookEnvironment value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WebhookEnvironment read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WebhookEnvironment instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebhookEnvironment given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebhookEnvironment + * @throws IOException if the JSON string is invalid with respect to WebhookEnvironment + */ + public static WebhookEnvironment fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebhookEnvironment.class); + } + + /** + * Convert an instance of WebhookEnvironment to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/WebhookHeaderModel.java b/src/main/java/com/configcat/publicapi/java/client/model/WebhookHeaderModel.java new file mode 100644 index 0000000..630a3b0 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/WebhookHeaderModel.java @@ -0,0 +1,351 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * WebhookHeaderModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class WebhookHeaderModel { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_IS_SECURE = "isSecure"; + @SerializedName(SERIALIZED_NAME_IS_SECURE) + private Boolean isSecure; + + public WebhookHeaderModel() { + } + + public WebhookHeaderModel key(String key) { + this.key = key; + return this; + } + + /** + * The HTTP header key. + * @return key + */ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + + public WebhookHeaderModel value(String value) { + this.value = value; + return this; + } + + /** + * The HTTP header value. + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + + public WebhookHeaderModel isSecure(Boolean isSecure) { + this.isSecure = isSecure; + return this; + } + + /** + * Indicates whether the header value is sensitive. + * @return isSecure + */ + @javax.annotation.Nullable + public Boolean getIsSecure() { + return isSecure; + } + + public void setIsSecure(Boolean isSecure) { + this.isSecure = isSecure; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WebhookHeaderModel instance itself + */ + public WebhookHeaderModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebhookHeaderModel webhookHeaderModel = (WebhookHeaderModel) o; + return Objects.equals(this.key, webhookHeaderModel.key) && + Objects.equals(this.value, webhookHeaderModel.value) && + Objects.equals(this.isSecure, webhookHeaderModel.isSecure)&& + Objects.equals(this.additionalProperties, webhookHeaderModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(key, value, isSecure, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebhookHeaderModel {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" isSecure: ").append(toIndentedString(isSecure)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + openapiFields.add("isSecure"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebhookHeaderModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebhookHeaderModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookHeaderModel is not found in the empty JSON string", WebhookHeaderModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebhookHeaderModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebhookHeaderModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebhookHeaderModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebhookHeaderModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebhookHeaderModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WebhookHeaderModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WebhookHeaderModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebhookHeaderModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebhookHeaderModel + * @throws IOException if the JSON string is invalid with respect to WebhookHeaderModel + */ + public static WebhookHeaderModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebhookHeaderModel.class); + } + + /** + * Convert an instance of WebhookHeaderModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/WebhookHeaderResponseModel.java b/src/main/java/com/configcat/publicapi/java/client/model/WebhookHeaderResponseModel.java new file mode 100644 index 0000000..4b2d0eb --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/WebhookHeaderResponseModel.java @@ -0,0 +1,352 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * WebhookHeaderResponseModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class WebhookHeaderResponseModel { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_IS_SECURE = "isSecure"; + @SerializedName(SERIALIZED_NAME_IS_SECURE) + private Boolean isSecure; + + public WebhookHeaderResponseModel() { + } + + public WebhookHeaderResponseModel key(String key) { + this.key = key; + return this; + } + + /** + * The HTTP header key. + * @return key + */ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + + public WebhookHeaderResponseModel value(String value) { + this.value = value; + return this; + } + + /** + * The HTTP header value. + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + + public WebhookHeaderResponseModel isSecure(Boolean isSecure) { + this.isSecure = isSecure; + return this; + } + + /** + * Indicates whether the header value is sensitive. + * @return isSecure + */ + @javax.annotation.Nonnull + public Boolean getIsSecure() { + return isSecure; + } + + public void setIsSecure(Boolean isSecure) { + this.isSecure = isSecure; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WebhookHeaderResponseModel instance itself + */ + public WebhookHeaderResponseModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebhookHeaderResponseModel webhookHeaderResponseModel = (WebhookHeaderResponseModel) o; + return Objects.equals(this.key, webhookHeaderResponseModel.key) && + Objects.equals(this.value, webhookHeaderResponseModel.value) && + Objects.equals(this.isSecure, webhookHeaderResponseModel.isSecure)&& + Objects.equals(this.additionalProperties, webhookHeaderResponseModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(key, value, isSecure, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebhookHeaderResponseModel {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" isSecure: ").append(toIndentedString(isSecure)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + openapiFields.add("isSecure"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + openapiRequiredFields.add("isSecure"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebhookHeaderResponseModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebhookHeaderResponseModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookHeaderResponseModel is not found in the empty JSON string", WebhookHeaderResponseModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebhookHeaderResponseModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebhookHeaderResponseModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebhookHeaderResponseModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebhookHeaderResponseModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebhookHeaderResponseModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WebhookHeaderResponseModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WebhookHeaderResponseModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebhookHeaderResponseModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebhookHeaderResponseModel + * @throws IOException if the JSON string is invalid with respect to WebhookHeaderResponseModel + */ + public static WebhookHeaderResponseModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebhookHeaderResponseModel.class); + } + + /** + * Convert an instance of WebhookHeaderResponseModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/WebhookResponseModel.java b/src/main/java/com/configcat/publicapi/java/client/model/WebhookResponseModel.java new file mode 100644 index 0000000..7da1d97 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/WebhookResponseModel.java @@ -0,0 +1,490 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.configcat.publicapi.java.client.model.WebHookHttpMethod; +import com.configcat.publicapi.java.client.model.WebhookConfig; +import com.configcat.publicapi.java.client.model.WebhookEnvironment; +import com.configcat.publicapi.java.client.model.WebhookHeaderResponseModel; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * WebhookResponseModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class WebhookResponseModel { + public static final String SERIALIZED_NAME_WEBHOOK_ID = "webhookId"; + @SerializedName(SERIALIZED_NAME_WEBHOOK_ID) + private Integer webhookId; + + public static final String SERIALIZED_NAME_URL = "url"; + @SerializedName(SERIALIZED_NAME_URL) + private String url; + + public static final String SERIALIZED_NAME_HTTP_METHOD = "httpMethod"; + @SerializedName(SERIALIZED_NAME_HTTP_METHOD) + private WebHookHttpMethod httpMethod; + + public static final String SERIALIZED_NAME_CONTENT = "content"; + @SerializedName(SERIALIZED_NAME_CONTENT) + private String content; + + public static final String SERIALIZED_NAME_WEB_HOOK_HEADERS = "webHookHeaders"; + @SerializedName(SERIALIZED_NAME_WEB_HOOK_HEADERS) + private List webHookHeaders = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CONFIG = "config"; + @SerializedName(SERIALIZED_NAME_CONFIG) + private WebhookConfig config; + + public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT) + private WebhookEnvironment environment; + + public WebhookResponseModel() { + } + + public WebhookResponseModel webhookId(Integer webhookId) { + this.webhookId = webhookId; + return this; + } + + /** + * The identifier of the Webhook. + * @return webhookId + */ + @javax.annotation.Nonnull + public Integer getWebhookId() { + return webhookId; + } + + public void setWebhookId(Integer webhookId) { + this.webhookId = webhookId; + } + + + public WebhookResponseModel url(String url) { + this.url = url; + return this; + } + + /** + * The URL of the Webhook. + * @return url + */ + @javax.annotation.Nonnull + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + + public WebhookResponseModel httpMethod(WebHookHttpMethod httpMethod) { + this.httpMethod = httpMethod; + return this; + } + + /** + * Get httpMethod + * @return httpMethod + */ + @javax.annotation.Nonnull + public WebHookHttpMethod getHttpMethod() { + return httpMethod; + } + + public void setHttpMethod(WebHookHttpMethod httpMethod) { + this.httpMethod = httpMethod; + } + + + public WebhookResponseModel content(String content) { + this.content = content; + return this; + } + + /** + * The HTTP body content. + * @return content + */ + @javax.annotation.Nullable + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + + public WebhookResponseModel webHookHeaders(List webHookHeaders) { + this.webHookHeaders = webHookHeaders; + return this; + } + + public WebhookResponseModel addWebHookHeadersItem(WebhookHeaderResponseModel webHookHeadersItem) { + if (this.webHookHeaders == null) { + this.webHookHeaders = new ArrayList<>(); + } + this.webHookHeaders.add(webHookHeadersItem); + return this; + } + + /** + * List of HTTP headers that the Webhook must send. + * @return webHookHeaders + */ + @javax.annotation.Nonnull + public List getWebHookHeaders() { + return webHookHeaders; + } + + public void setWebHookHeaders(List webHookHeaders) { + this.webHookHeaders = webHookHeaders; + } + + + public WebhookResponseModel config(WebhookConfig config) { + this.config = config; + return this; + } + + /** + * Get config + * @return config + */ + @javax.annotation.Nonnull + public WebhookConfig getConfig() { + return config; + } + + public void setConfig(WebhookConfig config) { + this.config = config; + } + + + public WebhookResponseModel environment(WebhookEnvironment environment) { + this.environment = environment; + return this; + } + + /** + * Get environment + * @return environment + */ + @javax.annotation.Nonnull + public WebhookEnvironment getEnvironment() { + return environment; + } + + public void setEnvironment(WebhookEnvironment environment) { + this.environment = environment; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WebhookResponseModel instance itself + */ + public WebhookResponseModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebhookResponseModel webhookResponseModel = (WebhookResponseModel) o; + return Objects.equals(this.webhookId, webhookResponseModel.webhookId) && + Objects.equals(this.url, webhookResponseModel.url) && + Objects.equals(this.httpMethod, webhookResponseModel.httpMethod) && + Objects.equals(this.content, webhookResponseModel.content) && + Objects.equals(this.webHookHeaders, webhookResponseModel.webHookHeaders) && + Objects.equals(this.config, webhookResponseModel.config) && + Objects.equals(this.environment, webhookResponseModel.environment)&& + Objects.equals(this.additionalProperties, webhookResponseModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(webhookId, url, httpMethod, content, webHookHeaders, config, environment, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebhookResponseModel {\n"); + sb.append(" webhookId: ").append(toIndentedString(webhookId)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" httpMethod: ").append(toIndentedString(httpMethod)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" webHookHeaders: ").append(toIndentedString(webHookHeaders)).append("\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("webhookId"); + openapiFields.add("url"); + openapiFields.add("httpMethod"); + openapiFields.add("content"); + openapiFields.add("webHookHeaders"); + openapiFields.add("config"); + openapiFields.add("environment"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("webhookId"); + openapiRequiredFields.add("url"); + openapiRequiredFields.add("httpMethod"); + openapiRequiredFields.add("content"); + openapiRequiredFields.add("webHookHeaders"); + openapiRequiredFields.add("config"); + openapiRequiredFields.add("environment"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebhookResponseModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebhookResponseModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookResponseModel is not found in the empty JSON string", WebhookResponseModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebhookResponseModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + } + // validate the required field `httpMethod` + WebHookHttpMethod.validateJsonElement(jsonObj.get("httpMethod")); + if ((jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) && !jsonObj.get("content").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `content` to be a primitive type in the JSON string but got `%s`", jsonObj.get("content").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("webHookHeaders").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `webHookHeaders` to be an array in the JSON string but got `%s`", jsonObj.get("webHookHeaders").toString())); + } + + JsonArray jsonArraywebHookHeaders = jsonObj.getAsJsonArray("webHookHeaders"); + // validate the required field `webHookHeaders` (array) + for (int i = 0; i < jsonArraywebHookHeaders.size(); i++) { + WebhookHeaderResponseModel.validateJsonElement(jsonArraywebHookHeaders.get(i)); + }; + // validate the required field `config` + WebhookConfig.validateJsonElement(jsonObj.get("config")); + // validate the required field `environment` + WebhookEnvironment.validateJsonElement(jsonObj.get("environment")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebhookResponseModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebhookResponseModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebhookResponseModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebhookResponseModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WebhookResponseModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WebhookResponseModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebhookResponseModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebhookResponseModel + * @throws IOException if the JSON string is invalid with respect to WebhookResponseModel + */ + public static WebhookResponseModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebhookResponseModel.class); + } + + /** + * Convert an instance of WebhookResponseModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/configcat/publicapi/java/client/model/WebhookSigningKeysModel.java b/src/main/java/com/configcat/publicapi/java/client/model/WebhookSigningKeysModel.java new file mode 100644 index 0000000..411fbc1 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/WebhookSigningKeysModel.java @@ -0,0 +1,325 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.configcat.publicapi.java.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.configcat.publicapi.java.client.JSON; + +/** + * WebhookSigningKeysModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-06-10T21:25:35.532049258Z[Etc/UTC]", comments = "Generator version: 7.7.0") +public class WebhookSigningKeysModel { + public static final String SERIALIZED_NAME_KEY1 = "key1"; + @SerializedName(SERIALIZED_NAME_KEY1) + private String key1; + + public static final String SERIALIZED_NAME_KEY2 = "key2"; + @SerializedName(SERIALIZED_NAME_KEY2) + private String key2; + + public WebhookSigningKeysModel() { + } + + public WebhookSigningKeysModel key1(String key1) { + this.key1 = key1; + return this; + } + + /** + * The first signing key. + * @return key1 + */ + @javax.annotation.Nullable + public String getKey1() { + return key1; + } + + public void setKey1(String key1) { + this.key1 = key1; + } + + + public WebhookSigningKeysModel key2(String key2) { + this.key2 = key2; + return this; + } + + /** + * The second signing key. + * @return key2 + */ + @javax.annotation.Nullable + public String getKey2() { + return key2; + } + + public void setKey2(String key2) { + this.key2 = key2; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WebhookSigningKeysModel instance itself + */ + public WebhookSigningKeysModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebhookSigningKeysModel webhookSigningKeysModel = (WebhookSigningKeysModel) o; + return Objects.equals(this.key1, webhookSigningKeysModel.key1) && + Objects.equals(this.key2, webhookSigningKeysModel.key2)&& + Objects.equals(this.additionalProperties, webhookSigningKeysModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(key1, key2, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebhookSigningKeysModel {\n"); + sb.append(" key1: ").append(toIndentedString(key1)).append("\n"); + sb.append(" key2: ").append(toIndentedString(key2)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key1"); + openapiFields.add("key2"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key1"); + openapiRequiredFields.add("key2"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebhookSigningKeysModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebhookSigningKeysModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookSigningKeysModel is not found in the empty JSON string", WebhookSigningKeysModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebhookSigningKeysModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("key1") != null && !jsonObj.get("key1").isJsonNull()) && !jsonObj.get("key1").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key1").toString())); + } + if ((jsonObj.get("key2") != null && !jsonObj.get("key2").isJsonNull()) && !jsonObj.get("key2").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key2").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebhookSigningKeysModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebhookSigningKeysModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebhookSigningKeysModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebhookSigningKeysModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WebhookSigningKeysModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WebhookSigningKeysModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebhookSigningKeysModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebhookSigningKeysModel + * @throws IOException if the JSON string is invalid with respect to WebhookSigningKeysModel + */ + public static WebhookSigningKeysModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebhookSigningKeysModel.class); + } + + /** + * Convert an instance of WebhookSigningKeysModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} +