diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore index 699c138..ba9c2a1 100644 --- a/.openapi-generator-ignore +++ b/.openapi-generator-ignore @@ -8,4 +8,6 @@ /.github/workflows/maven.yml .gitignore build.gradle -pom.xml \ No newline at end of file +build.sbt +pom.xml +src/test/ \ No newline at end of file diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 3048718..c16bdcc 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,10 +1,11 @@ .travis.yml README.md api/openapi.yaml -build.sbt +docs/AccessType.md docs/AddOrUpdateIntegrationLinkModel.md docs/AddOrUpdateJiraIntegrationLinkModel.md docs/AuditLogItemModel.md +docs/AuditLogType.md docs/AuditLogsApi.md docs/CodeReferenceModel.md docs/CodeReferenceRequest.md @@ -31,8 +32,10 @@ docs/CreateTagModel.md docs/DeleteIntegrationLinkModel.md docs/DeleteRepositoryReportsRequest.md docs/EnvironmentAccessModel.md +docs/EnvironmentAccessType.md docs/EnvironmentModel.md docs/EnvironmentsApi.md +docs/EvaluationVersion.md docs/FeatureFlagLimitations.md docs/FeatureFlagSettingValuesApi.md docs/FeatureFlagSettingValuesUsingSdkKeyApi.md @@ -44,18 +47,22 @@ docs/InitialValue.md docs/IntegrationLinkDetail.md docs/IntegrationLinkDetailsModel.md docs/IntegrationLinkModel.md +docs/IntegrationLinkType.md docs/IntegrationLinksApi.md docs/IntegrationModel.md +docs/IntegrationType.md docs/IntegrationsApi.md docs/IntegrationsModel.md docs/InvitationModel.md docs/InviteMembersRequest.md docs/JsonPatchOperation.md +docs/KeyGenerationMode.md docs/MeApi.md docs/MeModel.md docs/MemberModel.md docs/MembersApi.md docs/ModifyIntegrationRequest.md +docs/OperationType.md docs/OrganizationAdminModel.md docs/OrganizationInvitationModel.md docs/OrganizationMemberModel.md @@ -69,6 +76,7 @@ docs/PercentageOptionModel.md docs/PermissionGroupModel.md docs/PermissionGroupsApi.md docs/PreferencesModel.md +docs/PrerequisiteComparator.md docs/PrerequisiteFlagConditionModel.md docs/ProductModel.md docs/ProductsApi.md @@ -77,9 +85,11 @@ docs/ReferenceLine.md docs/ReferenceLines.md docs/ReplaceSettingModel.md docs/RolloutPercentageItemModel.md +docs/RolloutRuleComparator.md docs/RolloutRuleModel.md docs/SdkKeysApi.md docs/SdkKeysModel.md +docs/SegmentComparator.md docs/SegmentConditionModel.md docs/SegmentListModel.md docs/SegmentModel.md @@ -88,6 +98,7 @@ docs/SettingDataModel.md docs/SettingFormulaModel.md docs/SettingModel.md docs/SettingTagModel.md +docs/SettingType.md docs/SettingValueModel.md docs/TagModel.md docs/TagsApi.md @@ -107,9 +118,11 @@ docs/UpdateSettingValueModel.md docs/UpdateSettingValueWithSettingIdModel.md docs/UpdateSettingValuesWithIdModel.md docs/UpdateTagModel.md +docs/UserComparator.md docs/UserConditionModel.md docs/UserModel.md docs/ValueModel.md +docs/WebHookHttpMethod.md docs/WebHookRequest.md docs/WebhookConfig.md docs/WebhookEnvironment.md @@ -163,9 +176,11 @@ src/main/java/com/configcat/publicapi/java/client/auth/Authentication.java src/main/java/com/configcat/publicapi/java/client/auth/HttpBasicAuth.java src/main/java/com/configcat/publicapi/java/client/auth/HttpBearerAuth.java src/main/java/com/configcat/publicapi/java/client/model/AbstractOpenApiSchema.java +src/main/java/com/configcat/publicapi/java/client/model/AccessType.java src/main/java/com/configcat/publicapi/java/client/model/AddOrUpdateIntegrationLinkModel.java src/main/java/com/configcat/publicapi/java/client/model/AddOrUpdateJiraIntegrationLinkModel.java src/main/java/com/configcat/publicapi/java/client/model/AuditLogItemModel.java +src/main/java/com/configcat/publicapi/java/client/model/AuditLogType.java src/main/java/com/configcat/publicapi/java/client/model/CodeReferenceModel.java src/main/java/com/configcat/publicapi/java/client/model/CodeReferenceRequest.java src/main/java/com/configcat/publicapi/java/client/model/ComparisonValueListModel.java @@ -189,21 +204,27 @@ 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/EnvironmentAccessModel.java +src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessType.java src/main/java/com/configcat/publicapi/java/client/model/EnvironmentModel.java +src/main/java/com/configcat/publicapi/java/client/model/EvaluationVersion.java src/main/java/com/configcat/publicapi/java/client/model/FeatureFlagLimitations.java src/main/java/com/configcat/publicapi/java/client/model/FlagReference.java src/main/java/com/configcat/publicapi/java/client/model/InitialValue.java src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetail.java src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetailsModel.java src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkModel.java +src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkType.java src/main/java/com/configcat/publicapi/java/client/model/IntegrationModel.java +src/main/java/com/configcat/publicapi/java/client/model/IntegrationType.java src/main/java/com/configcat/publicapi/java/client/model/IntegrationsModel.java src/main/java/com/configcat/publicapi/java/client/model/InvitationModel.java src/main/java/com/configcat/publicapi/java/client/model/InviteMembersRequest.java src/main/java/com/configcat/publicapi/java/client/model/JsonPatchOperation.java +src/main/java/com/configcat/publicapi/java/client/model/KeyGenerationMode.java src/main/java/com/configcat/publicapi/java/client/model/MeModel.java src/main/java/com/configcat/publicapi/java/client/model/MemberModel.java src/main/java/com/configcat/publicapi/java/client/model/ModifyIntegrationRequest.java +src/main/java/com/configcat/publicapi/java/client/model/OperationType.java src/main/java/com/configcat/publicapi/java/client/model/OrganizationAdminModel.java src/main/java/com/configcat/publicapi/java/client/model/OrganizationInvitationModel.java src/main/java/com/configcat/publicapi/java/client/model/OrganizationMemberModel.java @@ -215,6 +236,7 @@ src/main/java/com/configcat/publicapi/java/client/model/OrganizationProductModel src/main/java/com/configcat/publicapi/java/client/model/PercentageOptionModel.java src/main/java/com/configcat/publicapi/java/client/model/PermissionGroupModel.java src/main/java/com/configcat/publicapi/java/client/model/PreferencesModel.java +src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteComparator.java 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 @@ -222,8 +244,10 @@ 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/ReplaceSettingModel.java src/main/java/com/configcat/publicapi/java/client/model/RolloutPercentageItemModel.java +src/main/java/com/configcat/publicapi/java/client/model/RolloutRuleComparator.java src/main/java/com/configcat/publicapi/java/client/model/RolloutRuleModel.java src/main/java/com/configcat/publicapi/java/client/model/SdkKeysModel.java +src/main/java/com/configcat/publicapi/java/client/model/SegmentComparator.java src/main/java/com/configcat/publicapi/java/client/model/SegmentConditionModel.java src/main/java/com/configcat/publicapi/java/client/model/SegmentListModel.java src/main/java/com/configcat/publicapi/java/client/model/SegmentModel.java @@ -231,6 +255,7 @@ src/main/java/com/configcat/publicapi/java/client/model/SettingDataModel.java src/main/java/com/configcat/publicapi/java/client/model/SettingFormulaModel.java 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/TagModel.java src/main/java/com/configcat/publicapi/java/client/model/TargetingRuleModel.java @@ -249,9 +274,11 @@ src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueModel. 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/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/WebhookConfig.java src/main/java/com/configcat/publicapi/java/client/model/WebhookEnvironment.java diff --git a/README.md b/README.md index ccb4b35..9af2ad5 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ConfigCat Public Management API - API version: v1 - - Build date: 2024-09-10T12:39:37.024419310Z[Etc/UTC] + - Build date: 2024-10-09T12:38:06.739118192Z[Etc/UTC] - Generator version: 7.7.0 The purpose of this API is to access the ConfigCat platform programmatically. @@ -138,7 +138,7 @@ public class Example { 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. - String auditLogType = "productCreated"; // String | Filter Audit logs by Audit log type. + 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 { @@ -257,9 +257,11 @@ Class | Method | HTTP request | Description ## Documentation for Models + - [AccessType](docs/AccessType.md) - [AddOrUpdateIntegrationLinkModel](docs/AddOrUpdateIntegrationLinkModel.md) - [AddOrUpdateJiraIntegrationLinkModel](docs/AddOrUpdateJiraIntegrationLinkModel.md) - [AuditLogItemModel](docs/AuditLogItemModel.md) + - [AuditLogType](docs/AuditLogType.md) - [CodeReferenceModel](docs/CodeReferenceModel.md) - [CodeReferenceRequest](docs/CodeReferenceRequest.md) - [ComparisonValueListModel](docs/ComparisonValueListModel.md) @@ -283,21 +285,27 @@ Class | Method | HTTP request | Description - [DeleteIntegrationLinkModel](docs/DeleteIntegrationLinkModel.md) - [DeleteRepositoryReportsRequest](docs/DeleteRepositoryReportsRequest.md) - [EnvironmentAccessModel](docs/EnvironmentAccessModel.md) + - [EnvironmentAccessType](docs/EnvironmentAccessType.md) - [EnvironmentModel](docs/EnvironmentModel.md) + - [EvaluationVersion](docs/EvaluationVersion.md) - [FeatureFlagLimitations](docs/FeatureFlagLimitations.md) - [FlagReference](docs/FlagReference.md) - [InitialValue](docs/InitialValue.md) - [IntegrationLinkDetail](docs/IntegrationLinkDetail.md) - [IntegrationLinkDetailsModel](docs/IntegrationLinkDetailsModel.md) - [IntegrationLinkModel](docs/IntegrationLinkModel.md) + - [IntegrationLinkType](docs/IntegrationLinkType.md) - [IntegrationModel](docs/IntegrationModel.md) + - [IntegrationType](docs/IntegrationType.md) - [IntegrationsModel](docs/IntegrationsModel.md) - [InvitationModel](docs/InvitationModel.md) - [InviteMembersRequest](docs/InviteMembersRequest.md) - [JsonPatchOperation](docs/JsonPatchOperation.md) + - [KeyGenerationMode](docs/KeyGenerationMode.md) - [MeModel](docs/MeModel.md) - [MemberModel](docs/MemberModel.md) - [ModifyIntegrationRequest](docs/ModifyIntegrationRequest.md) + - [OperationType](docs/OperationType.md) - [OrganizationAdminModel](docs/OrganizationAdminModel.md) - [OrganizationInvitationModel](docs/OrganizationInvitationModel.md) - [OrganizationMemberModel](docs/OrganizationMemberModel.md) @@ -309,6 +317,7 @@ Class | Method | HTTP request | Description - [PercentageOptionModel](docs/PercentageOptionModel.md) - [PermissionGroupModel](docs/PermissionGroupModel.md) - [PreferencesModel](docs/PreferencesModel.md) + - [PrerequisiteComparator](docs/PrerequisiteComparator.md) - [PrerequisiteFlagConditionModel](docs/PrerequisiteFlagConditionModel.md) - [ProductModel](docs/ProductModel.md) - [ReasonRequiredEnvironmentModel](docs/ReasonRequiredEnvironmentModel.md) @@ -316,8 +325,10 @@ Class | Method | HTTP request | Description - [ReferenceLines](docs/ReferenceLines.md) - [ReplaceSettingModel](docs/ReplaceSettingModel.md) - [RolloutPercentageItemModel](docs/RolloutPercentageItemModel.md) + - [RolloutRuleComparator](docs/RolloutRuleComparator.md) - [RolloutRuleModel](docs/RolloutRuleModel.md) - [SdkKeysModel](docs/SdkKeysModel.md) + - [SegmentComparator](docs/SegmentComparator.md) - [SegmentConditionModel](docs/SegmentConditionModel.md) - [SegmentListModel](docs/SegmentListModel.md) - [SegmentModel](docs/SegmentModel.md) @@ -325,6 +336,7 @@ Class | Method | HTTP request | Description - [SettingFormulaModel](docs/SettingFormulaModel.md) - [SettingModel](docs/SettingModel.md) - [SettingTagModel](docs/SettingTagModel.md) + - [SettingType](docs/SettingType.md) - [SettingValueModel](docs/SettingValueModel.md) - [TagModel](docs/TagModel.md) - [TargetingRuleModel](docs/TargetingRuleModel.md) @@ -343,9 +355,11 @@ Class | Method | HTTP request | Description - [UpdateSettingValueWithSettingIdModel](docs/UpdateSettingValueWithSettingIdModel.md) - [UpdateSettingValuesWithIdModel](docs/UpdateSettingValuesWithIdModel.md) - [UpdateTagModel](docs/UpdateTagModel.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) - [WebhookConfig](docs/WebhookConfig.md) - [WebhookEnvironment](docs/WebhookEnvironment.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index 8060022..bffa46f 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -878,85 +878,9 @@ paths: name: auditLogType required: false schema: - 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 - - organizationAdminDisabled2FA - - tagAdded - - tagChanged - - tagRemoved - - settingTagAdded - - settingTagRemoved - - publicApiAccessTokenAdded - - publicApiAccessTokenRemoved - - domainAdded - - domainVerified - - domainRemoved - - domainSamlConfigured - - domainSamlDeleted - - autoProvisioningConfigurationChanged - - samlIdpConfigurationAdded - - samlIdpConfigurationRemoved - - samlIdpConfigurationUpdated - - organizationMemberJoined - - organizationMemberProductJoinRequested - - organizationMemberProductJoinRequestRejected - - organizationMemberProductJoinRequestApproved - - codeReferencesUploaded - - codeReferenceDeleted - - codeReferenceStaleBranchDeleted - - segmentCreated - - segmentChanged - - segmentDeleted - - webhookSigningKeyDeleted - - webhookSigningKeyCreated - type: string + allOf: + - $ref: '#/components/schemas/AuditLogType' + nullable: true style: form - description: Filter Audit logs by starting UTC date. explode: true @@ -1540,11 +1464,7 @@ paths: name: integrationLinkType required: true schema: - enum: - - trello - - jira - - monday - type: string + $ref: '#/components/schemas/IntegrationLinkType' style: simple - description: The key of the integration link. explode: false @@ -1685,85 +1605,9 @@ paths: name: auditLogType required: false schema: - 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 - - organizationAdminDisabled2FA - - tagAdded - - tagChanged - - tagRemoved - - settingTagAdded - - settingTagRemoved - - publicApiAccessTokenAdded - - publicApiAccessTokenRemoved - - domainAdded - - domainVerified - - domainRemoved - - domainSamlConfigured - - domainSamlDeleted - - autoProvisioningConfigurationChanged - - samlIdpConfigurationAdded - - samlIdpConfigurationRemoved - - samlIdpConfigurationUpdated - - organizationMemberJoined - - organizationMemberProductJoinRequested - - organizationMemberProductJoinRequestRejected - - organizationMemberProductJoinRequestApproved - - codeReferencesUploaded - - codeReferenceDeleted - - codeReferenceStaleBranchDeleted - - segmentCreated - - segmentChanged - - segmentDeleted - - webhookSigningKeyDeleted - - webhookSigningKeyCreated - type: string + allOf: + - $ref: '#/components/schemas/AuditLogType' + nullable: true style: form - description: Filter Audit logs by starting UTC date. explode: true @@ -5309,11 +5153,7 @@ paths: name: integrationLinkType required: true schema: - enum: - - trello - - jira - - monday - type: string + $ref: '#/components/schemas/IntegrationLinkType' style: simple - description: The key of the integration link. explode: false @@ -5370,11 +5210,7 @@ paths: name: integrationLinkType required: true schema: - enum: - - trello - - jira - - monday - type: string + $ref: '#/components/schemas/IntegrationLinkType' style: simple - description: The key of the integration link. explode: false @@ -5870,6 +5706,13 @@ paths: - application/json components: schemas: + AccessType: + description: Represent the Feature Management permission. + enum: + - readOnly + - full + - custom + type: string AddOrUpdateIntegrationLinkModel: additionalProperties: false example: @@ -5938,85 +5781,7 @@ components: format: date-time type: string auditLogTypeEnum: - 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 - - organizationAdminDisabled2FA - - tagAdded - - tagChanged - - tagRemoved - - settingTagAdded - - settingTagRemoved - - publicApiAccessTokenAdded - - publicApiAccessTokenRemoved - - domainAdded - - domainVerified - - domainRemoved - - domainSamlConfigured - - domainSamlDeleted - - autoProvisioningConfigurationChanged - - samlIdpConfigurationAdded - - samlIdpConfigurationRemoved - - samlIdpConfigurationUpdated - - organizationMemberJoined - - organizationMemberProductJoinRequested - - organizationMemberProductJoinRequestRejected - - organizationMemberProductJoinRequestApproved - - codeReferencesUploaded - - codeReferenceDeleted - - codeReferenceStaleBranchDeleted - - segmentCreated - - segmentChanged - - segmentDeleted - - webhookSigningKeyDeleted - - webhookSigningKeyCreated - type: string + $ref: '#/components/schemas/AuditLogType' changeSetId: format: uuid nullable: true @@ -6045,6 +5810,87 @@ components: 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 + - organizationMemberJoined + - organizationMemberProductJoinRequested + - organizationMemberProductJoinRequestRejected + - organizationMemberProductJoinRequestApproved + - organizationMemberRemoved + - codeReferencesUploaded + - codeReferenceDeleted + - codeReferenceStaleBranchDeleted + - segmentCreated + - segmentChanged + - segmentDeleted + - webhookSigningKeyDeleted + - webhookSigningKeyCreated + type: string CodeReferenceModel: additionalProperties: false example: @@ -6377,12 +6223,7 @@ components: nullable: true type: string 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 + $ref: '#/components/schemas/EvaluationVersion' type: object ConfigSettingFormulaModel: additionalProperties: false @@ -7314,12 +7155,7 @@ components: nullable: true type: integer 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 + $ref: '#/components/schemas/EvaluationVersion' required: - name type: object @@ -7372,15 +7208,7 @@ components: key: parameters properties: integrationType: - description: Type of the Integration. - enum: - - dataDog - - slack - - amplitude - - mixPanel - - segment - - pubNub - type: string + $ref: '#/components/schemas/IntegrationType' name: description: Name of the Integration. minLength: 1 @@ -7416,51 +7244,47 @@ components: additionalProperties: false example: environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - environmentAccessType: full + environmentAccessType: null properties: environmentId: description: Identifier of the Environment. format: uuid type: string environmentAccessType: - description: Represent the environment specific Feature Management permission. - enum: - - full - - readOnly - - none - type: string + $ref: '#/components/schemas/EnvironmentAccessType' type: object CreatePermissionGroupRequest: additionalProperties: false example: canViewProductStatistics: true - canDeleteConfig: true canDeleteTag: true environmentAccesses: - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - environmentAccessType: full + environmentAccessType: null - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - environmentAccessType: full - canDeleteEnvironment: true - canCreateOrUpdateConfig: true + environmentAccessType: null canManageProductPreferences: true canManageIntegrations: true canDeleteSegments: true accessType: readOnly - canTagSetting: true canManageMembers: true canManageWebhook: true canUseExportImport: true canViewSdkKey: true - canCreateOrUpdateEnvironment: true canDeleteSetting: true - name: name 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 - canCreateOrUpdateSegments: true - canCreateOrUpdateSetting: true properties: name: description: Name of the Permission Group. @@ -7528,25 +7352,19 @@ components: description: Group members has access to product statistics. type: boolean accessType: - description: Represent the Feature Management permission. - enum: - - readOnly - - full - - custom - type: string + $ref: '#/components/schemas/AccessType' newEnvironmentAccessType: - description: Represent the environment specific Feature Management permission. - enum: - - full - - readOnly - - none - type: string + $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 @@ -7604,26 +7422,7 @@ components: minLength: 1 type: string comparator: - enum: - - isOneOf - - isNotOneOf - - contains - - doesNotContain - - semVerIsOneOf - - semVerIsNotOneOf - - semVerLess - - semVerLessOrEquals - - semVerGreater - - semVerGreaterOrEquals - - numberEquals - - numberDoesNotEqual - - numberLess - - numberLessOrEquals - - numberGreater - - numberGreaterOrEquals - - sensitiveIsOneOf - - sensitiveIsNotOneOf - type: string + $ref: '#/components/schemas/RolloutRuleComparator' comparisonValue: description: The value to compare with the given user attribute's value. minLength: 1 @@ -7682,13 +7481,7 @@ components: minLength: 1 type: string settingType: - description: The type of the Feature Flag or Setting. - enum: - - boolean - - string - - int - - double - type: string + $ref: '#/components/schemas/SettingType' initialValues: description: "Optional, initial value of the Feature Flag or Setting in\ \ the given Environments." @@ -7768,7 +7561,7 @@ components: example: environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 color: color - environmentAccessType: full + environmentAccessType: null name: name description: description order: 6 @@ -7799,13 +7592,15 @@ components: when the Feature Flags or Settings in the given Environment are saved. type: boolean environmentAccessType: - description: Represent the environment specific Feature Management permission. - enum: - - full - - readOnly - - none - type: string + $ref: '#/components/schemas/EnvironmentAccessType' type: object + EnvironmentAccessType: + description: Represent the environment specific Feature Management permission. + enum: + - full + - readOnly + - none + type: string EnvironmentModel: additionalProperties: false description: Details of the Environment. @@ -7853,6 +7648,13 @@ components: 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: additionalProperties: false description: Subscription limitations regarding Feature flag or Setting values @@ -8174,15 +7976,17 @@ components: nullable: true type: string integrationLinkType: - enum: - - trello - - jira - - monday - type: string + $ref: '#/components/schemas/IntegrationLinkType' url: nullable: true type: string type: object + IntegrationLinkType: + enum: + - trello + - jira + - monday + type: string IntegrationModel: additionalProperties: false description: Details of the Integration. @@ -8219,15 +8023,7 @@ components: nullable: true type: string integrationType: - description: Type of the Integration. - enum: - - dataDog - - slack - - amplitude - - mixPanel - - segment - - pubNub - type: string + $ref: '#/components/schemas/IntegrationType' parameters: additionalProperties: nullable: true @@ -8252,6 +8048,15 @@ components: nullable: true type: array type: object + IntegrationType: + enum: + - dataDog + - slack + - amplitude + - mixPanel + - segment + - pubNub + type: string IntegrationsModel: additionalProperties: false example: @@ -8365,16 +8170,7 @@ components: value: "" properties: op: - description: The JSON Patch operation. (https://jsonpatch.com) - enum: - - unknown - - add - - remove - - replace - - move - - copy - - test - type: string + $ref: '#/components/schemas/OperationType' path: description: The source path. minLength: 1 @@ -8390,6 +8186,15 @@ components: - op - path type: object + KeyGenerationMode: + description: Determines the Feature Flag key generation mode. + enum: + - camelCase + - lowerCase + - upperCase + - pascalCase + - kebabCase + type: string MeModel: additionalProperties: false example: @@ -8478,6 +8283,16 @@ components: - name - parameters type: object + OperationType: + enum: + - unknown + - add + - remove + - replace + - move + - copy + - test + type: string OrganizationAdminModel: additionalProperties: false description: Describes an Organization Admin. @@ -8761,14 +8576,14 @@ components: environmentAccesses: - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 color: color - environmentAccessType: full + environmentAccessType: null name: name description: description order: 6 reasonRequired: true - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 color: color - environmentAccessType: full + environmentAccessType: null name: name description: description order: 6 @@ -8796,6 +8611,7 @@ components: order: 0 reasonRequired: true canDeleteConfig: true + canDisable2FA: true canDeleteEnvironment: true canCreateOrUpdateConfig: true canTagSetting: true @@ -8873,20 +8689,14 @@ components: 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: - description: Represent the Feature Management permission. - enum: - - readOnly - - full - - custom - type: string + $ref: '#/components/schemas/AccessType' newEnvironmentAccessType: - description: Represent the environment specific Feature Management permission. - enum: - - full - - readOnly - - none - type: string + $ref: '#/components/schemas/EnvironmentAccessType' environmentAccesses: description: List of environment specific permissions. items: @@ -8915,14 +8725,7 @@ components: description: Indicates that a mandatory note required for saving and publishing. type: boolean keyGenerationMode: - description: Determines the Feature Flag key generation mode. - enum: - - camelCase - - lowerCase - - upperCase - - pascalCase - - kebabCase - type: string + $ref: '#/components/schemas/KeyGenerationMode' showVariationId: description: Indicates whether a variation ID's must be shown on the ConfigCat Dashboard. @@ -8938,6 +8741,13 @@ components: 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: additionalProperties: false description: Describes a condition that is based on a prerequisite flag. @@ -8955,12 +8765,7 @@ components: format: int32 type: integer comparator: - description: Prerequisite flag comparison operator used during the evaluation - process. - enum: - - equals - - doesNotEqual - type: string + $ref: '#/components/schemas/PrerequisiteComparator' prerequisiteComparisonValue: $ref: '#/components/schemas/ValueModel' required: @@ -9150,6 +8955,29 @@ components: 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: additionalProperties: false example: @@ -9167,27 +8995,7 @@ components: nullable: true type: string comparator: - enum: - - isOneOf - - isNotOneOf - - contains - - doesNotContain - - semVerIsOneOf - - semVerIsNotOneOf - - semVerLess - - semVerLessOrEquals - - semVerGreater - - semVerGreaterOrEquals - - numberEquals - - numberDoesNotEqual - - numberLess - - numberLessOrEquals - - numberGreater - - numberGreaterOrEquals - - sensitiveIsOneOf - - sensitiveIsNotOneOf - nullable: true - type: string + $ref: '#/components/schemas/RolloutRuleComparator' comparisonValue: description: The value to compare against. nullable: true @@ -9197,12 +9005,7 @@ components: the setting type. nullable: true segmentComparator: - description: The segment comparison operator. - enum: - - isIn - - isNotIn - nullable: true - type: string + $ref: '#/components/schemas/SegmentComparator' segmentId: description: The segment to compare against. format: uuid @@ -9224,6 +9027,12 @@ components: nullable: true type: string type: object + SegmentComparator: + description: The segment comparison operator used during the evaluation process. + enum: + - isIn + - isNotIn + type: string SegmentConditionModel: additionalProperties: false description: Describes a condition that is based on a segment. @@ -9236,12 +9045,7 @@ components: format: uuid type: string comparator: - description: The segment comparison operator used during the evaluation - process. - enum: - - isIn - - isNotIn - type: string + $ref: '#/components/schemas/SegmentComparator' required: - comparator - segmentId @@ -9382,28 +9186,7 @@ components: nullable: true type: string comparator: - 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 + $ref: '#/components/schemas/RolloutRuleComparator' comparisonValue: description: The value to compare with the given user attribute's value. nullable: true @@ -9441,13 +9224,7 @@ components: nullable: true type: string settingType: - description: The type of the Feature Flag or Setting. - enum: - - boolean - - string - - int - - double - type: string + $ref: '#/components/schemas/SettingType' order: description: The order of the Feature Flag or Setting represented on the ConfigCat Dashboard. @@ -9804,13 +9581,7 @@ components: format: int32 type: integer settingType: - description: The type of the Feature Flag or Setting. - enum: - - boolean - - string - - int - - double - type: string + $ref: '#/components/schemas/SettingType' configId: description: Identifier of the Feature Flag's Config. format: uuid @@ -9847,6 +9618,14 @@ components: nullable: true type: string type: object + SettingType: + description: The type of the Feature Flag or Setting. + enum: + - boolean + - string + - int + - double + type: string SettingValueModel: additionalProperties: false example: @@ -10798,33 +10577,34 @@ components: additionalProperties: false example: canViewProductStatistics: true - canDeleteConfig: true canDeleteTag: true environmentAccesses: - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - environmentAccessType: full + environmentAccessType: null - environmentId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - environmentAccessType: full - canDeleteEnvironment: true - canCreateOrUpdateConfig: true + environmentAccessType: null canManageProductPreferences: true canManageIntegrations: true canDeleteSegments: true accessType: readOnly - canTagSetting: true canManageMembers: true canManageWebhook: true canUseExportImport: true canViewSdkKey: true - canCreateOrUpdateEnvironment: true canDeleteSetting: true - name: name 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 - canCreateOrUpdateSegments: true - canCreateOrUpdateSetting: true properties: name: description: Name of the Permission Group. @@ -10912,20 +10692,15 @@ components: description: Group members has access to product statistics. nullable: true type: boolean - accessType: - enum: - - readOnly - - full - - custom + canDisable2FA: + description: Group members can disable two-factor authentication for other + members. nullable: true - type: string + type: boolean + accessType: + $ref: '#/components/schemas/AccessType' newEnvironmentAccessType: - enum: - - full - - readOnly - - none - nullable: true - type: string + $ref: '#/components/schemas/EnvironmentAccessType' environmentAccesses: description: List of environment specific permissions. items: @@ -10952,15 +10727,7 @@ components: nullable: true type: boolean keyGenerationMode: - description: Determines the Feature Flag key generation mode. - enum: - - camelCase - - lowerCase - - upperCase - - pascalCase - - kebabCase - nullable: true - type: string + $ref: '#/components/schemas/KeyGenerationMode' showVariationId: description: Indicates whether a variation ID's must be shown on the ConfigCat Dashboard. @@ -11044,27 +10811,7 @@ components: nullable: true type: string comparator: - enum: - - isOneOf - - isNotOneOf - - contains - - doesNotContain - - semVerIsOneOf - - semVerIsNotOneOf - - semVerLess - - semVerLessOrEquals - - semVerGreater - - semVerGreaterOrEquals - - numberEquals - - numberDoesNotEqual - - numberLess - - numberLessOrEquals - - numberGreater - - numberGreaterOrEquals - - sensitiveIsOneOf - - sensitiveIsNotOneOf - nullable: true - type: string + $ref: '#/components/schemas/RolloutRuleComparator' comparisonValue: nullable: true type: string @@ -11223,6 +10970,47 @@ components: 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: additionalProperties: false description: Describes a condition that is based on user attributes. @@ -11245,46 +11033,7 @@ components: minLength: 1 type: string comparator: - 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 + $ref: '#/components/schemas/UserComparator' comparisonValue: $ref: '#/components/schemas/ComparisonValueModel' required: @@ -11344,6 +11093,11 @@ components: nullable: true type: number type: object + WebHookHttpMethod: + enum: + - get + - post + type: string WebHookRequest: additionalProperties: false example: @@ -11370,11 +11124,7 @@ components: nullable: true type: string httpMethod: - description: The HTTP method of the remote endpoint. - enum: - - get - - post - type: string + $ref: '#/components/schemas/WebHookHttpMethod' webHookHeaders: description: List of HTTP headers. items: @@ -11470,11 +11220,7 @@ components: nullable: true type: string httpMethod: - description: The HTTP method. - enum: - - get - - post - type: string + $ref: '#/components/schemas/WebHookHttpMethod' content: description: The HTTP body content. nullable: true diff --git a/build.gradle b/build.gradle index fc89f56..0b40df4 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ apply plugin: 'signing' apply plugin: 'maven-publish' group = 'com.configcat' -version = '1.0.0' +version = '1.0.1' buildscript { repositories { @@ -96,6 +96,7 @@ dependencies { implementation 'javax.ws.rs:jsr311-api:1.1.1' implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation 'com.fasterxml.jackson.core:jackson-core:2.15.0-rc1' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' @@ -104,6 +105,7 @@ dependencies { } javadoc { + failOnError = false options.tags = [ "http.response.details:a:Http Response Details" ] } diff --git a/build.sbt b/build.sbt index 93cc723..5b3784d 100644 --- a/build.sbt +++ b/build.sbt @@ -17,6 +17,7 @@ lazy val root = (project in file(".")). "javax.ws.rs" % "jsr311-api" % "1.1.1", "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "com.fasterxml.jackson.core" % "jackson-core" % "2.15.0-rc1", "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", 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/AuditLogItemModel.md b/docs/AuditLogItemModel.md index 74f2266..059b8b8 100644 --- a/docs/AuditLogItemModel.md +++ b/docs/AuditLogItemModel.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**auditLogId** | **Long** | | [optional] | |**auditLogDateTime** | **OffsetDateTime** | | [optional] | -|**auditLogTypeEnum** | [**AuditLogTypeEnumEnum**](#AuditLogTypeEnumEnum) | | [optional] | +|**auditLogTypeEnum** | **AuditLogType** | | [optional] | |**changeSetId** | **UUID** | | [optional] | |**truncated** | **Boolean** | | [optional] | |**auditLogType** | **String** | | [optional] | @@ -22,87 +22,3 @@ -## Enum: AuditLogTypeEnumEnum - -| Name | Value | -|---- | -----| -| 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" | -| ORGANIZATION_ADMIN_DISABLED2_FA | "organizationAdminDisabled2FA" | -| 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" | -| ORGANIZATION_MEMBER_JOINED | "organizationMemberJoined" | -| ORGANIZATION_MEMBER_PRODUCT_JOIN_REQUESTED | "organizationMemberProductJoinRequested" | -| ORGANIZATION_MEMBER_PRODUCT_JOIN_REQUEST_REJECTED | "organizationMemberProductJoinRequestRejected" | -| ORGANIZATION_MEMBER_PRODUCT_JOIN_REQUEST_APPROVED | "organizationMemberProductJoinRequestApproved" | -| 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" | - - - diff --git a/docs/AuditLogType.md b/docs/AuditLogType.md new file mode 100644 index 0000000..ffebdc6 --- /dev/null +++ b/docs/AuditLogType.md @@ -0,0 +1,165 @@ + + +# 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"`) + +* `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"`) + + + diff --git a/docs/AuditLogsApi.md b/docs/AuditLogsApi.md index 47d1c7d..7993fa4 100644 --- a/docs/AuditLogsApi.md +++ b/docs/AuditLogsApi.md @@ -41,7 +41,7 @@ public class Example { 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. - String auditLogType = "productCreated"; // String | Filter Audit logs by Audit log type. + 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 { @@ -65,7 +65,7 @@ public class Example { | **productId** | **UUID**| The identifier of the Product. | | | **configId** | **UUID**| The identifier of the Config. | [optional] | | **environmentId** | **UUID**| The identifier of the Environment. | [optional] | -| **auditLogType** | **String**| 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, organizationAdminDisabled2FA, tagAdded, tagChanged, tagRemoved, settingTagAdded, settingTagRemoved, publicApiAccessTokenAdded, publicApiAccessTokenRemoved, domainAdded, domainVerified, domainRemoved, domainSamlConfigured, domainSamlDeleted, autoProvisioningConfigurationChanged, samlIdpConfigurationAdded, samlIdpConfigurationRemoved, samlIdpConfigurationUpdated, organizationMemberJoined, organizationMemberProductJoinRequested, organizationMemberProductJoinRequestRejected, organizationMemberProductJoinRequestApproved, codeReferencesUploaded, codeReferenceDeleted, codeReferenceStaleBranchDeleted, segmentCreated, segmentChanged, segmentDeleted, webhookSigningKeyDeleted, webhookSigningKeyCreated] | +| **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, organizationMemberJoined, organizationMemberProductJoinRequested, organizationMemberProductJoinRequestRejected, organizationMemberProductJoinRequestApproved, organizationMemberRemoved, codeReferencesUploaded, codeReferenceDeleted, codeReferenceStaleBranchDeleted, segmentCreated, segmentChanged, segmentDeleted, webhookSigningKeyDeleted, webhookSigningKeyCreated] | | **fromUtcDateTime** | **OffsetDateTime**| Filter Audit logs by starting UTC date. | [optional] | | **toUtcDateTime** | **OffsetDateTime**| Filter Audit logs by ending UTC date. | [optional] | @@ -194,7 +194,7 @@ public class Example { 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. - String auditLogType = "productCreated"; // String | Filter Audit logs by Audit log type. + 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 { @@ -219,7 +219,7 @@ public class Example { | **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** | **String**| 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, organizationAdminDisabled2FA, tagAdded, tagChanged, tagRemoved, settingTagAdded, settingTagRemoved, publicApiAccessTokenAdded, publicApiAccessTokenRemoved, domainAdded, domainVerified, domainRemoved, domainSamlConfigured, domainSamlDeleted, autoProvisioningConfigurationChanged, samlIdpConfigurationAdded, samlIdpConfigurationRemoved, samlIdpConfigurationUpdated, organizationMemberJoined, organizationMemberProductJoinRequested, organizationMemberProductJoinRequestRejected, organizationMemberProductJoinRequestApproved, codeReferencesUploaded, codeReferenceDeleted, codeReferenceStaleBranchDeleted, segmentCreated, segmentChanged, segmentDeleted, webhookSigningKeyDeleted, webhookSigningKeyCreated] | +| **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, organizationMemberJoined, organizationMemberProductJoinRequested, organizationMemberProductJoinRequestRejected, organizationMemberProductJoinRequestApproved, organizationMemberRemoved, codeReferencesUploaded, codeReferenceDeleted, codeReferenceStaleBranchDeleted, segmentCreated, segmentChanged, segmentDeleted, webhookSigningKeyDeleted, webhookSigningKeyCreated] | | **fromUtcDateTime** | **OffsetDateTime**| Filter Audit logs by starting UTC date. | [optional] | | **toUtcDateTime** | **OffsetDateTime**| Filter Audit logs by ending UTC date. | [optional] | diff --git a/docs/ConfigModel.md b/docs/ConfigModel.md index c8da3a3..c50cf67 100644 --- a/docs/ConfigModel.md +++ b/docs/ConfigModel.md @@ -14,16 +14,7 @@ Details of the Config. |**description** | **String** | Description of the Config. | [optional] | |**order** | **Integer** | The order of the Config represented on the ConfigCat Dashboard. | [optional] | |**migratedConfigId** | **UUID** | | [optional] | -|**evaluationVersion** | [**EvaluationVersionEnum**](#EvaluationVersionEnum) | Determines the evaluation version of a Config. Using `v2` enables the new features of Config V2 (https://configcat.com/docs/advanced/config-v2). | [optional] | - - - -## Enum: EvaluationVersionEnum - -| Name | Value | -|---- | -----| -| V1 | "v1" | -| V2 | "v2" | +|**evaluationVersion** | **EvaluationVersion** | | [optional] | diff --git a/docs/CreateConfigRequest.md b/docs/CreateConfigRequest.md index 158eb53..475189d 100644 --- a/docs/CreateConfigRequest.md +++ b/docs/CreateConfigRequest.md @@ -10,16 +10,7 @@ |**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** | [**EvaluationVersionEnum**](#EvaluationVersionEnum) | Determines the evaluation version of a Config. Using `v2` enables the new features of Config V2 (https://configcat.com/docs/advanced/config-v2). | [optional] | - - - -## Enum: EvaluationVersionEnum - -| Name | Value | -|---- | -----| -| V1 | "v1" | -| V2 | "v2" | +|**evaluationVersion** | **EvaluationVersion** | | [optional] | diff --git a/docs/CreateIntegrationModel.md b/docs/CreateIntegrationModel.md index d423ad9..f2c2d78 100644 --- a/docs/CreateIntegrationModel.md +++ b/docs/CreateIntegrationModel.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**integrationType** | [**IntegrationTypeEnum**](#IntegrationTypeEnum) | Type of the Integration. | | +|**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. | | @@ -15,16 +15,3 @@ -## Enum: IntegrationTypeEnum - -| Name | Value | -|---- | -----| -| DATA_DOG | "dataDog" | -| SLACK | "slack" | -| AMPLITUDE | "amplitude" | -| MIX_PANEL | "mixPanel" | -| SEGMENT | "segment" | -| PUB_NUB | "pubNub" | - - - diff --git a/docs/CreateOrUpdateEnvironmentAccessModel.md b/docs/CreateOrUpdateEnvironmentAccessModel.md index 9ce60f8..1bd23a1 100644 --- a/docs/CreateOrUpdateEnvironmentAccessModel.md +++ b/docs/CreateOrUpdateEnvironmentAccessModel.md @@ -8,17 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**environmentId** | **UUID** | Identifier of the Environment. | [optional] | -|**environmentAccessType** | [**EnvironmentAccessTypeEnum**](#EnvironmentAccessTypeEnum) | Represent the environment specific Feature Management permission. | [optional] | - - - -## Enum: EnvironmentAccessTypeEnum - -| Name | Value | -|---- | -----| -| FULL | "full" | -| READ_ONLY | "readOnly" | -| NONE | "none" | +|**environmentAccessType** | **EnvironmentAccessType** | | [optional] | diff --git a/docs/CreatePermissionGroupRequest.md b/docs/CreatePermissionGroupRequest.md index 12f5a58..af04058 100644 --- a/docs/CreatePermissionGroupRequest.md +++ b/docs/CreatePermissionGroupRequest.md @@ -28,29 +28,10 @@ |**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** | [**AccessTypeEnum**](#AccessTypeEnum) | Represent the Feature Management permission. | [optional] | -|**newEnvironmentAccessType** | [**NewEnvironmentAccessTypeEnum**](#NewEnvironmentAccessTypeEnum) | Represent the environment specific Feature Management permission. | [optional] | +|**accessType** | **AccessType** | | [optional] | +|**newEnvironmentAccessType** | **EnvironmentAccessType** | | [optional] | |**environmentAccesses** | [**List<CreateOrUpdateEnvironmentAccessModel>**](CreateOrUpdateEnvironmentAccessModel.md) | List of environment specific permissions. | [optional] | - - - -## Enum: AccessTypeEnum - -| Name | Value | -|---- | -----| -| READ_ONLY | "readOnly" | -| FULL | "full" | -| CUSTOM | "custom" | - - - -## Enum: NewEnvironmentAccessTypeEnum - -| Name | Value | -|---- | -----| -| FULL | "full" | -| READ_ONLY | "readOnly" | -| NONE | "none" | +|**canDisable2FA** | **Boolean** | Group members can disable two-factor authentication for other members. | [optional] | diff --git a/docs/CreateSegmentModel.md b/docs/CreateSegmentModel.md index a09ddb8..a382243 100644 --- a/docs/CreateSegmentModel.md +++ b/docs/CreateSegmentModel.md @@ -10,33 +10,8 @@ |**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** | [**ComparatorEnum**](#ComparatorEnum) | | | +|**comparator** | **RolloutRuleComparator** | | | |**comparisonValue** | **String** | The value to compare with the given user attribute's value. | | -## Enum: ComparatorEnum - -| Name | Value | -|---- | -----| -| 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" | - - - diff --git a/docs/CreateSettingInitialValues.md b/docs/CreateSettingInitialValues.md index 42a9b1f..7de962e 100644 --- a/docs/CreateSettingInitialValues.md +++ b/docs/CreateSettingInitialValues.md @@ -12,19 +12,8 @@ |**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** | [**SettingTypeEnum**](#SettingTypeEnum) | The type 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] | -## Enum: SettingTypeEnum - -| Name | Value | -|---- | -----| -| BOOLEAN | "boolean" | -| STRING | "string" | -| INT | "int" | -| DOUBLE | "double" | - - - diff --git a/docs/EnvironmentAccessModel.md b/docs/EnvironmentAccessModel.md index 8def4ef..e2f787c 100644 --- a/docs/EnvironmentAccessModel.md +++ b/docs/EnvironmentAccessModel.md @@ -13,17 +13,7 @@ |**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** | [**EnvironmentAccessTypeEnum**](#EnvironmentAccessTypeEnum) | Represent the environment specific Feature Management permission. | [optional] | - - - -## Enum: EnvironmentAccessTypeEnum - -| Name | Value | -|---- | -----| -| FULL | "full" | -| READ_ONLY | "readOnly" | -| NONE | "none" | +|**environmentAccessType** | **EnvironmentAccessType** | | [optional] | 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/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/IntegrationLinkModel.md b/docs/IntegrationLinkModel.md index 27598ae..d81537c 100644 --- a/docs/IntegrationLinkModel.md +++ b/docs/IntegrationLinkModel.md @@ -9,18 +9,8 @@ |------------ | ------------- | ------------- | -------------| |**key** | **String** | | [optional] | |**description** | **String** | | [optional] | -|**integrationLinkType** | [**IntegrationLinkTypeEnum**](#IntegrationLinkTypeEnum) | | [optional] | +|**integrationLinkType** | **IntegrationLinkType** | | [optional] | |**url** | **String** | | [optional] | -## Enum: IntegrationLinkTypeEnum - -| Name | Value | -|---- | -----| -| TRELLO | "trello" | -| JIRA | "jira" | -| MONDAY | "monday" | - - - 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 index 4cc4d9c..1e44563 100644 --- a/docs/IntegrationLinksApi.md +++ b/docs/IntegrationLinksApi.md @@ -42,7 +42,7 @@ public class Example { 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 integrationLinkType = "trello"; // String | The integration link's type. + 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 { @@ -65,7 +65,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **environmentId** | **UUID**| The identifier of the Environment. | | | **settingId** | **Integer**| The id of the Setting. | | -| **integrationLinkType** | **String**| The integration link's type. | [enum: trello, jira, monday] | +| **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] | @@ -121,7 +121,7 @@ public class Example { 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 integrationLinkType = "trello"; // String | The integration's type. + 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); @@ -143,7 +143,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **environmentId** | **UUID**| The identifier of the Environment. | | | **settingId** | **Integer**| The id of the Setting. | | -| **integrationLinkType** | **String**| The integration's type. | [enum: trello, jira, monday] | +| **integrationLinkType** | [**IntegrationLinkType**](.md)| The integration's type. | [enum: trello, jira, monday] | | **key** | **String**| The key of the integration link. | | ### Return type @@ -196,7 +196,7 @@ public class Example { Basic.setPassword("YOUR PASSWORD"); IntegrationLinksApi apiInstance = new IntegrationLinksApi(defaultClient); - String integrationLinkType = "trello"; // String | The integration link's type. + 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); @@ -216,7 +216,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **integrationLinkType** | **String**| The integration link's type. | [enum: trello, jira, monday] | +| **integrationLinkType** | [**IntegrationLinkType**](.md)| The integration link's type. | [enum: trello, jira, monday] | | **key** | **String**| The key of the integration link. | | ### Return type diff --git a/docs/IntegrationModel.md b/docs/IntegrationModel.md index f88849a..46fbccf 100644 --- a/docs/IntegrationModel.md +++ b/docs/IntegrationModel.md @@ -11,23 +11,10 @@ Details of the Integration. |**product** | [**ProductModel**](ProductModel.md) | | [optional] | |**integrationId** | **UUID** | Identifier of the Integration. | [optional] | |**name** | **String** | Name of the Integration. | [optional] | -|**integrationType** | [**IntegrationTypeEnum**](#IntegrationTypeEnum) | Type 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] | -## Enum: IntegrationTypeEnum - -| Name | Value | -|---- | -----| -| DATA_DOG | "dataDog" | -| SLACK | "slack" | -| AMPLITUDE | "amplitude" | -| MIX_PANEL | "mixPanel" | -| SEGMENT | "segment" | -| PUB_NUB | "pubNub" | - - - 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/JsonPatchOperation.md b/docs/JsonPatchOperation.md index da33511..cf7d095 100644 --- a/docs/JsonPatchOperation.md +++ b/docs/JsonPatchOperation.md @@ -7,24 +7,10 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**op** | [**OpEnum**](#OpEnum) | The JSON Patch operation. (https://jsonpatch.com) | | +|**op** | **OperationType** | | | |**path** | **String** | The source path. | | |**from** | **String** | The target path. | [optional] | |**value** | **Object** | The discrete value. | [optional] | -## Enum: OpEnum - -| Name | Value | -|---- | -----| -| UNKNOWN | "unknown" | -| ADD | "add" | -| REMOVE | "remove" | -| REPLACE | "replace" | -| MOVE | "move" | -| COPY | "copy" | -| TEST | "test" | - - - 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/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/PermissionGroupModel.md b/docs/PermissionGroupModel.md index 24c1d4b..0cff1be 100644 --- a/docs/PermissionGroupModel.md +++ b/docs/PermissionGroupModel.md @@ -29,30 +29,11 @@ |**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** | [**AccessTypeEnum**](#AccessTypeEnum) | Represent the Feature Management permission. | [optional] | -|**newEnvironmentAccessType** | [**NewEnvironmentAccessTypeEnum**](#NewEnvironmentAccessTypeEnum) | Represent the environment specific Feature Management permission. | [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] | -## Enum: AccessTypeEnum - -| Name | Value | -|---- | -----| -| READ_ONLY | "readOnly" | -| FULL | "full" | -| CUSTOM | "custom" | - - - -## Enum: NewEnvironmentAccessTypeEnum - -| Name | Value | -|---- | -----| -| FULL | "full" | -| READ_ONLY | "readOnly" | -| NONE | "none" | - - - diff --git a/docs/PreferencesModel.md b/docs/PreferencesModel.md index daf9157..f80cb08 100644 --- a/docs/PreferencesModel.md +++ b/docs/PreferencesModel.md @@ -8,22 +8,10 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**reasonRequired** | **Boolean** | Indicates that a mandatory note required for saving and publishing. | [optional] | -|**keyGenerationMode** | [**KeyGenerationModeEnum**](#KeyGenerationModeEnum) | Determines the Feature Flag key generation mode. | [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] | -## Enum: KeyGenerationModeEnum - -| Name | Value | -|---- | -----| -| CAMEL_CASE | "camelCase" | -| LOWER_CASE | "lowerCase" | -| UPPER_CASE | "upperCase" | -| PASCAL_CASE | "pascalCase" | -| KEBAB_CASE | "kebabCase" | - - - 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 index 094725f..b4c3d45 100644 --- a/docs/PrerequisiteFlagConditionModel.md +++ b/docs/PrerequisiteFlagConditionModel.md @@ -9,17 +9,8 @@ Describes a condition that is based on a prerequisite flag. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**prerequisiteSettingId** | **Integer** | The prerequisite flag's identifier. | | -|**comparator** | [**ComparatorEnum**](#ComparatorEnum) | Prerequisite flag comparison operator used during the evaluation process. | | +|**comparator** | **PrerequisiteComparator** | | | |**prerequisiteComparisonValue** | [**ValueModel**](ValueModel.md) | | | -## Enum: ComparatorEnum - -| Name | Value | -|---- | -----| -| EQUALS | "equals" | -| DOES_NOT_EQUAL | "doesNotEqual" | - - - 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 index a85ef1a..bf136a6 100644 --- a/docs/RolloutRuleModel.md +++ b/docs/RolloutRuleModel.md @@ -8,45 +8,11 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**comparisonAttribute** | **String** | The user attribute to compare. | [optional] | -|**comparator** | [**ComparatorEnum**](#ComparatorEnum) | | [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** | [**SegmentComparatorEnum**](#SegmentComparatorEnum) | The segment comparison operator. | [optional] | +|**segmentComparator** | **SegmentComparator** | | [optional] | |**segmentId** | **UUID** | The segment to compare against. | [optional] | -## Enum: ComparatorEnum - -| Name | Value | -|---- | -----| -| 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" | - - - -## Enum: SegmentComparatorEnum - -| Name | Value | -|---- | -----| -| IS_IN | "isIn" | -| IS_NOT_IN | "isNotIn" | - - - 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 index 1d73839..4a0a1a2 100644 --- a/docs/SegmentConditionModel.md +++ b/docs/SegmentConditionModel.md @@ -9,16 +9,7 @@ Describes a condition that is based on a segment. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**segmentId** | **UUID** | The segment's identifier. | | -|**comparator** | [**ComparatorEnum**](#ComparatorEnum) | The segment comparison operator used during the evaluation process. | | - - - -## Enum: ComparatorEnum - -| Name | Value | -|---- | -----| -| IS_IN | "isIn" | -| IS_NOT_IN | "isNotIn" | +|**comparator** | **SegmentComparator** | | | diff --git a/docs/SegmentModel.md b/docs/SegmentModel.md index 9d440e5..687b561 100644 --- a/docs/SegmentModel.md +++ b/docs/SegmentModel.md @@ -18,33 +18,8 @@ |**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** | [**ComparatorEnum**](#ComparatorEnum) | The comparison operator the evaluation process must use when it compares the given user attribute's value with the comparison value. | [optional] | +|**comparator** | **RolloutRuleComparator** | | [optional] | |**comparisonValue** | **String** | The value to compare with the given user attribute's value. | [optional] | -## Enum: ComparatorEnum - -| Name | Value | -|---- | -----| -| 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" | - - - diff --git a/docs/SettingDataModel.md b/docs/SettingDataModel.md index a28a695..5fd9050 100644 --- a/docs/SettingDataModel.md +++ b/docs/SettingDataModel.md @@ -12,7 +12,7 @@ Metadata of a Feature Flag or Setting. |**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** | [**SettingTypeEnum**](#SettingTypeEnum) | The type 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] | @@ -21,14 +21,3 @@ Metadata of a Feature Flag or Setting. -## Enum: SettingTypeEnum - -| Name | Value | -|---- | -----| -| BOOLEAN | "boolean" | -| STRING | "string" | -| INT | "int" | -| DOUBLE | "double" | - - - diff --git a/docs/SettingModel.md b/docs/SettingModel.md index 573ce54..4cfff67 100644 --- a/docs/SettingModel.md +++ b/docs/SettingModel.md @@ -13,21 +13,10 @@ Metadata of a Feature Flag or Setting. |**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** | [**SettingTypeEnum**](#SettingTypeEnum) | The type of the Feature Flag or Setting. | [optional] | +|**settingType** | **SettingType** | | [optional] | |**configId** | **UUID** | Identifier of the Feature Flag's Config. | [optional] | |**configName** | **String** | Name of the Feature Flag's Config. | [optional] | |**tags** | [**List<TagModel>**](TagModel.md) | The tags attached to the Feature Flag or Setting. | [optional] | -## Enum: SettingTypeEnum - -| Name | Value | -|---- | -----| -| BOOLEAN | "boolean" | -| STRING | "string" | -| INT | "int" | -| DOUBLE | "double" | - - - 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/UpdatePermissionGroupRequest.md b/docs/UpdatePermissionGroupRequest.md index a27d6b6..2d40ebf 100644 --- a/docs/UpdatePermissionGroupRequest.md +++ b/docs/UpdatePermissionGroupRequest.md @@ -28,29 +28,10 @@ |**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** | [**AccessTypeEnum**](#AccessTypeEnum) | | [optional] | -|**newEnvironmentAccessType** | [**NewEnvironmentAccessTypeEnum**](#NewEnvironmentAccessTypeEnum) | | [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] | -## Enum: AccessTypeEnum - -| Name | Value | -|---- | -----| -| READ_ONLY | "readOnly" | -| FULL | "full" | -| CUSTOM | "custom" | - - - -## Enum: NewEnvironmentAccessTypeEnum - -| Name | Value | -|---- | -----| -| FULL | "full" | -| READ_ONLY | "readOnly" | -| NONE | "none" | - - - diff --git a/docs/UpdatePreferencesRequest.md b/docs/UpdatePreferencesRequest.md index 791195e..60ca221 100644 --- a/docs/UpdatePreferencesRequest.md +++ b/docs/UpdatePreferencesRequest.md @@ -8,22 +8,10 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**reasonRequired** | **Boolean** | Indicates that a mandatory note is required for saving and publishing. | [optional] | -|**keyGenerationMode** | [**KeyGenerationModeEnum**](#KeyGenerationModeEnum) | Determines the Feature Flag key generation mode. | [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] | -## Enum: KeyGenerationModeEnum - -| Name | Value | -|---- | -----| -| CAMEL_CASE | "camelCase" | -| LOWER_CASE | "lowerCase" | -| UPPER_CASE | "upperCase" | -| PASCAL_CASE | "pascalCase" | -| KEBAB_CASE | "kebabCase" | - - - diff --git a/docs/UpdateSegmentModel.md b/docs/UpdateSegmentModel.md index fc0473d..a5e0f9c 100644 --- a/docs/UpdateSegmentModel.md +++ b/docs/UpdateSegmentModel.md @@ -10,33 +10,8 @@ |**name** | **String** | | [optional] | |**description** | **String** | | [optional] | |**comparisonAttribute** | **String** | | [optional] | -|**comparator** | [**ComparatorEnum**](#ComparatorEnum) | | [optional] | +|**comparator** | **RolloutRuleComparator** | | [optional] | |**comparisonValue** | **String** | | [optional] | -## Enum: ComparatorEnum - -| Name | Value | -|---- | -----| -| 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" | - - - 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 index bb167f6..4ae7a53 100644 --- a/docs/UserConditionModel.md +++ b/docs/UserConditionModel.md @@ -9,51 +9,8 @@ Describes a condition that is based on user attributes. | 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** | [**ComparatorEnum**](#ComparatorEnum) | The comparison operator which defines the relation between the comparison attribute and the comparison value. | | +|**comparator** | **UserComparator** | | | |**comparisonValue** | [**ComparisonValueModel**](ComparisonValueModel.md) | | | -## Enum: ComparatorEnum - -| Name | Value | -|---- | -----| -| 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" | - - - 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/WebHookRequest.md b/docs/WebHookRequest.md index 19219f9..7591a3c 100644 --- a/docs/WebHookRequest.md +++ b/docs/WebHookRequest.md @@ -9,17 +9,8 @@ |------------ | ------------- | ------------- | -------------| |**url** | **String** | The URL of the Webhook. | | |**content** | **String** | The HTTP body content. | [optional] | -|**httpMethod** | [**HttpMethodEnum**](#HttpMethodEnum) | The HTTP method of the remote endpoint. | [optional] | +|**httpMethod** | **WebHookHttpMethod** | | [optional] | |**webHookHeaders** | [**List<WebhookHeaderModel>**](WebhookHeaderModel.md) | List of HTTP headers. | [optional] | -## Enum: HttpMethodEnum - -| Name | Value | -|---- | -----| -| GET | "get" | -| POST | "post" | - - - diff --git a/docs/WebhookModel.md b/docs/WebhookModel.md index 5573199..8a83ee0 100644 --- a/docs/WebhookModel.md +++ b/docs/WebhookModel.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**webhookId** | **Integer** | The identifier of the Webhook. | [optional] | |**url** | **String** | The URL of the Webhook. | [optional] | -|**httpMethod** | [**HttpMethodEnum**](#HttpMethodEnum) | The HTTP method. | [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] | @@ -17,12 +17,3 @@ -## Enum: HttpMethodEnum - -| Name | Value | -|---- | -----| -| GET | "get" | -| POST | "post" | - - - diff --git a/src/main/java/com/configcat/publicapi/java/client/ApiCallback.java b/src/main/java/com/configcat/publicapi/java/client/ApiCallback.java index 244fd5b..626200d 100644 --- a/src/main/java/com/configcat/publicapi/java/client/ApiCallback.java +++ b/src/main/java/com/configcat/publicapi/java/client/ApiCallback.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,13 +10,11 @@ * Do not edit the class manually. */ - package com.configcat.publicapi.java.client; -import java.io.IOException; -import java.util.Map; import java.util.List; +import java.util.Map; /** * Callback for asynchronous API call. diff --git a/src/main/java/com/configcat/publicapi/java/client/ApiClient.java b/src/main/java/com/configcat/publicapi/java/client/ApiClient.java index d5fee4b..dd412c0 100644 --- a/src/main/java/com/configcat/publicapi/java/client/ApiClient.java +++ b/src/main/java/com/configcat/publicapi/java/client/ApiClient.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,19 +10,12 @@ * 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 com.configcat.publicapi.java.client.auth.ApiKeyAuth; +import com.configcat.publicapi.java.client.auth.Authentication; +import com.configcat.publicapi.java.client.auth.HttpBasicAuth; import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -39,7 +32,6 @@ 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; @@ -47,28 +39,29 @@ 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 javax.net.ssl.*; +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 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.

- */ +/** 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 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; @@ -92,9 +85,7 @@ public class ApiClient { private HttpLoggingInterceptor loggingInterceptor; - /** - * Basic constructor for ApiClient - */ + /** Basic constructor for ApiClient */ public ApiClient() { init(); initHttpClient(); @@ -128,7 +119,7 @@ private void initHttpClient() { private void initHttpClient(List interceptors) { OkHttpClient.Builder builder = new OkHttpClient.Builder(); builder.addNetworkInterceptor(getProgressInterceptor()); - for (Interceptor interceptor: interceptors) { + for (Interceptor interceptor : interceptors) { builder.addInterceptor(interceptor); } @@ -245,9 +236,9 @@ public boolean isVerifyingSsl() { } /** - * 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. + * 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 @@ -268,8 +259,8 @@ public InputStream getSslCaCert() { } /** - * Configure the CA certificate to be trusted when making https requests. - * Use null to reset to default. + * 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 @@ -281,7 +272,7 @@ public ApiClient setSslCaCert(InputStream sslCaCert) { } /** - *

Getter for the field keyManagers.

+ * Getter for the field keyManagers. * * @return an array of {@link javax.net.ssl.KeyManager} objects */ @@ -290,8 +281,8 @@ public KeyManager[] getKeyManagers() { } /** - * Configure client keys to use for authorization in an SSL session. - * Use null to reset to default. + * 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 @@ -303,7 +294,7 @@ public ApiClient setKeyManagers(KeyManager[] managers) { } /** - *

Getter for the field dateFormat.

+ * Getter for the field dateFormat. * * @return a {@link java.text.DateFormat} object */ @@ -312,7 +303,7 @@ public DateFormat getDateFormat() { } /** - *

Setter for the field dateFormat.

+ * Setter for the field dateFormat. * * @param dateFormat a {@link java.text.DateFormat} object * @return a {@link com.configcat.publicapi.java.client.ApiClient} object @@ -323,7 +314,7 @@ public ApiClient setDateFormat(DateFormat dateFormat) { } /** - *

Set SqlDateFormat.

+ * Set SqlDateFormat. * * @param dateFormat a {@link java.text.DateFormat} object * @return a {@link com.configcat.publicapi.java.client.ApiClient} object @@ -334,7 +325,7 @@ public ApiClient setSqlDateFormat(DateFormat dateFormat) { } /** - *

Set OffsetDateTimeFormat.

+ * Set OffsetDateTimeFormat. * * @param dateFormat a {@link java.time.format.DateTimeFormatter} object * @return a {@link com.configcat.publicapi.java.client.ApiClient} object @@ -345,7 +336,7 @@ public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { } /** - *

Set LocalDateFormat.

+ * Set LocalDateFormat. * * @param dateFormat a {@link java.time.format.DateTimeFormatter} object * @return a {@link com.configcat.publicapi.java.client.ApiClient} object @@ -356,7 +347,7 @@ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { } /** - *

Set LenientOnJson.

+ * Set LenientOnJson. * * @param lenientOnJson a boolean * @return a {@link com.configcat.publicapi.java.client.ApiClient} object @@ -385,7 +376,6 @@ public Authentication getAuthentication(String authName) { return authentications.get(authName); } - /** * Helper method to set username for the first HTTP basic authentication. * @@ -463,7 +453,8 @@ public void setAccessToken(String accessToken) { * @param region Region * @param service Service to access to */ - public void setAWS4Configuration(String accessKey, String secretKey, String region, String service) { + public void setAWS4Configuration( + String accessKey, String secretKey, String region, String service) { throw new RuntimeException("No AWS4 authentication configured!"); } @@ -476,7 +467,12 @@ public void setAWS4Configuration(String accessKey, String secretKey, String regi * @param region Region * @param service Service to access to */ - public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) { + public void setAWS4Configuration( + String accessKey, + String secretKey, + String sessionToken, + String region, + String service) { throw new RuntimeException("No AWS4 authentication configured!"); } @@ -548,11 +544,12 @@ public ApiClient setDebugging(boolean debugging) { } /** - * 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. + * 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 + * @see createTempFile * @return Temporary folder path */ public String getTempFolderPath() { @@ -580,15 +577,18 @@ public int getConnectTimeout() { } /** - * 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}. + * 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(); + httpClient = + httpClient + .newBuilder() + .connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS) + .build(); return this; } @@ -602,15 +602,15 @@ public int getReadTimeout() { } /** - * 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}. + * 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(); + httpClient = + httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); return this; } @@ -624,19 +624,18 @@ public int getWriteTimeout() { } /** - * 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}. + * 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(); + httpClient = + httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); return this; } - /** * Format the given parameter object into string. * @@ -646,8 +645,10 @@ public ApiClient setWriteTimeout(int writeTimeout) { 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 + } 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) { @@ -667,7 +668,7 @@ public String parameterToString(Object param) { /** * Formats the specified query parameter to a list containing a single {@code Pair} object. * - * Note that {@code value} must not be a collection. + *

Note that {@code value} must not be a collection. * * @param name The name of the parameter. * @param value The value of the parameter. @@ -688,7 +689,7 @@ public List parameterToPair(String name, Object value) { /** * 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. + *

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. @@ -760,7 +761,7 @@ public String collectionPathParameterToString(String collectionFormat, Collectio delimiter = "|"; } - StringBuilder sb = new StringBuilder() ; + StringBuilder sb = new StringBuilder(); for (Object item : value) { sb.append(delimiter); sb.append(parameterToString(item)); @@ -770,8 +771,7 @@ public String collectionPathParameterToString(String collectionFormat, Collectio } /** - * Sanitize filename by removing path. - * e.g. ../../sun.gif becomes sun.gif + * Sanitize filename by removing path. e.g. ../../sun.gif becomes sun.gif * * @param filename The filename to be sanitized * @return The sanitized filename @@ -781,13 +781,10 @@ public String sanitizeFilename(String filename) { } /** - * 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 + * 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. */ @@ -797,13 +794,12 @@ public boolean isJsonMime(String mime) { } /** - * 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) + * 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). + * @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) { @@ -818,13 +814,12 @@ public String selectHeaderAccept(String[] 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. + * 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. + * @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) { @@ -859,15 +854,16 @@ public String escapeString(String str) { } /** - * Deserialize response body to Java object, according to the return type and - * the Content-Type response header. + * 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. + * @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 { @@ -889,10 +885,8 @@ public T deserialize(Response response, Type returnType) throws ApiException String respBody; try { - if (response.body() != null) - respBody = response.body().string(); - else - respBody = null; + if (response.body() != null) respBody = response.body().string(); + else respBody = null; } catch (IOException e) { throw new ApiException(e); } @@ -921,13 +915,14 @@ public T deserialize(Response response, Type returnType) throws ApiException } /** - * Serialize the given Java object into request body according to the object's - * class and the request Content-Type. + * 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 + * @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[]) { @@ -957,7 +952,8 @@ public RequestBody serialize(Object obj, String contentType) throws ApiException * 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 + * @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 { @@ -1005,14 +1001,11 @@ public File prepareDownloadFile(Response response) throws IOException { suffix = filename.substring(pos); } // Files.createTempFile requires the prefix to be at least three characters long - if (prefix.length() < 3) - prefix = "download-"; + 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(); + if (tempFolderPath == null) return Files.createTempFile(prefix, suffix).toFile(); + else return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); } /** @@ -1033,9 +1026,8 @@ public ApiResponse execute(Call call) throws ApiException { * @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. + * @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 { @@ -1070,27 +1062,32 @@ public void executeAsync(Call call, ApiCallback callback) { */ @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); - } + 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()); - } - }); + @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()); + } + }); } /** @@ -1100,8 +1097,8 @@ public void onResponse(Call call, Response response) throws IOException { * @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 + * @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()) { @@ -1112,7 +1109,11 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept try { response.body().close(); } catch (Exception e) { - throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + throw new ApiException( + response.message(), + e, + response.code(), + response.headers().toMultimap()); } } return null; @@ -1125,10 +1126,15 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept try { respBody = response.body().string(); } catch (IOException e) { - throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + throw new ApiException( + response.message(), + e, + response.code(), + response.headers().toMultimap()); } } - throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); + throw new ApiException( + response.message(), response.code(), response.headers().toMultimap(), respBody); } } @@ -1137,7 +1143,8 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept * * @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 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 @@ -1147,10 +1154,35 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept * @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); + * @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); } @@ -1160,7 +1192,8 @@ public Call buildCall(String baseUrl, String path, String method, List que * * @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 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 @@ -1170,9 +1203,22 @@ public Call buildCall(String baseUrl, String path, String method, List que * @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 { + * @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); @@ -1198,14 +1244,23 @@ public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams) { + public String buildUrl( + String baseUrl, String path, List queryParams, List collectionQueryParams) { final StringBuilder url = new StringBuilder(); if (baseUrl != null) { url.append(baseUrl).append(path); @@ -1244,9 +1300,11 @@ public String buildUrl(String baseUrl, String path, List queryParams, List 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() - )); + 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 { @@ -1267,7 +1325,9 @@ public String buildUrl(String baseUrl, String path, List queryParams, List url.append("&"); } String value = parameterToString(param.getValue()); - url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + url.append(escapeString(param.getName())) + .append("=") + .append(escapeString(value)); } } } @@ -1317,11 +1377,13 @@ public void processHeaderParams(Map headerParams, Request.Builde */ public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { for (Entry param : cookieParams.entrySet()) { - reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + 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())); + reqBuilder.addHeader( + "Cookie", String.format("%s=%s", param.getKey(), param.getValue())); } } } @@ -1338,8 +1400,15 @@ public void processCookieParams(Map cookieParams, Request.Builde * @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 { + 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) { @@ -1364,8 +1433,8 @@ public RequestBody buildRequestBodyFormEncoding(Map formParams) } /** - * Build a multipart (file uploading) request body with the given form parameters, - * which could contain text fields and file fields. + * 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 @@ -1378,7 +1447,7 @@ public RequestBody buildRequestBodyMultipart(Map formParams) { addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); } else if (param.getValue() instanceof List) { List list = (List) param.getValue(); - for (Object item: list) { + for (Object item : list) { if (item instanceof File) { addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); } else { @@ -1410,24 +1479,29 @@ public String guessContentTypeFromFile(File file) { /** * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. * - * @param mpBuilder 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() + "\""); + 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. + * 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) { + 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")); @@ -1446,8 +1520,8 @@ private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String k } /** - * Get network interceptor to add it to the httpClient to track download progress for - * async requests. + * Get network interceptor to add it to the httpClient to track download progress for async + * requests. */ private Interceptor getProgressInterceptor() { return new Interceptor() { @@ -1457,9 +1531,10 @@ public Response intercept(Interceptor.Chain chain) throws IOException { 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 + .newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); } return originalResponse; } @@ -1467,47 +1542,54 @@ public Response intercept(Interceptor.Chain chain) throws IOException { } /** - * Apply SSL related settings to httpClient according to the current values of - * verifyingSsl and sslCaCert. + * 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 { + 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[] {}; + } } - - @Override - public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } - + }; + hostnameVerifier = + new HostnameVerifier() { @Override - public java.security.cert.X509Certificate[] getAcceptedIssuers() { - return new java.security.cert.X509Certificate[]{}; + public boolean verify(String hostname, SSLSession session) { + return true; } - } - }; - hostnameVerifier = new HostnameVerifier() { - @Override - public boolean verify(String hostname, SSLSession session) { - return true; - } - }; + }; } else { - TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + 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); + Collection certificates = + certificateFactory.generateCertificates(sslCaCert); if (certificates.isEmpty()) { - throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + throw new IllegalArgumentException( + "expected non-empty set of trusted certificates"); } KeyStore caKeyStore = newEmptyKeyStore(password); int index = 0; @@ -1523,8 +1605,12 @@ public boolean verify(String hostname, SSLSession session) { SSLContext sslContext = SSLContext.getInstance("TLS"); sslContext.init(keyManagers, trustManagers, new SecureRandom()); - httpClient = httpClient.newBuilder() - .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + httpClient = + httpClient + .newBuilder() + .sslSocketFactory( + sslContext.getSocketFactory(), + (X509TrustManager) trustManagers[0]) .hostnameVerifier(hostnameVerifier) .build(); } catch (GeneralSecurityException e) { @@ -1547,7 +1633,8 @@ private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityExcepti * * @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 + * @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) { diff --git a/src/main/java/com/configcat/publicapi/java/client/ApiException.java b/src/main/java/com/configcat/publicapi/java/client/ApiException.java index 190caea..4b7b478 100644 --- a/src/main/java/com/configcat/publicapi/java/client/ApiException.java +++ b/src/main/java/com/configcat/publicapi/java/client/ApiException.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,18 +10,18 @@ * Do not edit the class manually. */ - package com.configcat.publicapi.java.client; -import java.util.Map; -import java.util.List; +import java.util.List; +import java.util.Map; -/** - *

ApiException class.

- */ +/** ApiException class. */ @SuppressWarnings("serial") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[Etc/UTC]", + comments = "Generator version: 7.7.0") public class ApiException extends RuntimeException { private static final long serialVersionUID = 1L; @@ -29,13 +29,11 @@ public class ApiException extends RuntimeException { private Map> responseHeaders = null; private String responseBody = null; - /** - *

Constructor for ApiException.

- */ + /** Constructor for ApiException. */ public ApiException() {} /** - *

Constructor for ApiException.

+ * Constructor for ApiException. * * @param throwable a {@link java.lang.Throwable} object */ @@ -44,7 +42,7 @@ public ApiException(Throwable throwable) { } /** - *

Constructor for ApiException.

+ * Constructor for ApiException. * * @param message the error message */ @@ -53,7 +51,7 @@ public ApiException(String message) { } /** - *

Constructor for ApiException.

+ * Constructor for ApiException. * * @param message the error message * @param throwable a {@link java.lang.Throwable} object @@ -61,7 +59,12 @@ public ApiException(String message) { * @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) { + public ApiException( + String message, + Throwable throwable, + int code, + Map> responseHeaders, + String responseBody) { super(message, throwable); this.code = code; this.responseHeaders = responseHeaders; @@ -69,42 +72,55 @@ public ApiException(String message, Throwable throwable, int code, MapConstructor for ApiException.

+ * 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) { + public ApiException( + String message, + int code, + Map> responseHeaders, + String responseBody) { this(message, (Throwable) null, code, responseHeaders, responseBody); } /** - *

Constructor for ApiException.

+ * 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) { + public ApiException( + String message, + Throwable throwable, + int code, + Map> responseHeaders) { this(message, throwable, code, responseHeaders, null); } /** - *

Constructor for ApiException.

+ * 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); + this( + "Response Code: " + code + " Response Body: " + responseBody, + (Throwable) null, + code, + responseHeaders, + responseBody); } /** - *

Constructor for ApiException.

+ * Constructor for ApiException. * * @param code HTTP status code * @param message a {@link java.lang.String} object @@ -115,14 +131,18 @@ public ApiException(int code, String message) { } /** - *

Constructor for ApiException.

+ * 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) { + public ApiException( + int code, + String message, + Map> responseHeaders, + String responseBody) { this(code, message); this.responseHeaders = responseHeaders; this.responseBody = responseBody; @@ -161,7 +181,12 @@ public String getResponseBody() { * @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()); + 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 index 47d753e..3044d2e 100644 --- a/src/main/java/com/configcat/publicapi/java/client/ApiResponse.java +++ b/src/main/java/com/configcat/publicapi/java/client/ApiResponse.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,22 +10,20 @@ * 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. - */ +/** API response returned by API call. */ public class ApiResponse { - final private int statusCode; - final private Map> headers; - final private T data; + private final int statusCode; + private final Map> headers; + private final T data; /** - *

Constructor for ApiResponse.

+ * Constructor for ApiResponse. * * @param statusCode The status code of HTTP response * @param headers The headers of HTTP response @@ -35,7 +33,7 @@ public ApiResponse(int statusCode, Map> headers) { } /** - *

Constructor for ApiResponse.

+ * Constructor for ApiResponse. * * @param statusCode The status code of HTTP response * @param headers The headers of HTTP response @@ -48,7 +46,7 @@ public ApiResponse(int statusCode, Map> headers, T data) { } /** - *

Get the status code.

+ * Get the status code. * * @return the status code */ @@ -57,16 +55,16 @@ public int getStatusCode() { } /** - *

Get the headers.

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

Get the data.

+ * Get the data. * * @return the 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 index 6b27312..aacf3a5 100644 --- a/src/main/java/com/configcat/publicapi/java/client/Configuration.java +++ b/src/main/java/com/configcat/publicapi/java/client/Configuration.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,18 +10,20 @@ * Do not edit the class manually. */ - package com.configcat.publicapi.java.client; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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. + * Get the default API client, which would be used when creating API instances without providing + * an API client. * * @return Default API client */ @@ -30,8 +32,8 @@ public static ApiClient getDefaultApiClient() { } /** - * Set the default API client, which would be used when creating API - * instances without providing an API client. + * Set the default API client, which would be used when creating API instances without providing + * an API client. * * @param apiClient API client */ diff --git a/src/main/java/com/configcat/publicapi/java/client/GzipRequestInterceptor.java b/src/main/java/com/configcat/publicapi/java/client/GzipRequestInterceptor.java index 1d17be4..8364f64 100644 --- a/src/main/java/com/configcat/publicapi/java/client/GzipRequestInterceptor.java +++ b/src/main/java/com/configcat/publicapi/java/client/GzipRequestInterceptor.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,21 +10,20 @@ * Do not edit the class manually. */ - package com.configcat.publicapi.java.client; + +import java.io.IOException; 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 + *

Taken from https://github.com/square/okhttp/issues/350 */ class GzipRequestInterceptor implements Interceptor { @Override @@ -34,10 +33,14 @@ public Response intercept(Chain chain) throws IOException { return chain.proceed(originalRequest); } - Request compressedRequest = originalRequest.newBuilder() - .header("Content-Encoding", "gzip") - .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) - .build(); + Request compressedRequest = + originalRequest + .newBuilder() + .header("Content-Encoding", "gzip") + .method( + originalRequest.method(), + forceContentLength(gzip(originalRequest.body()))) + .build(); return chain.proceed(compressedRequest); } diff --git a/src/main/java/com/configcat/publicapi/java/client/JSON.java b/src/main/java/com/configcat/publicapi/java/client/JSON.java index 3892933..f16bf59 100644 --- a/src/main/java/com/configcat/publicapi/java/client/JSON.java +++ b/src/main/java/com/configcat/publicapi/java/client/JSON.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,22 +10,18 @@ * 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.JsonElement; 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; @@ -36,9 +32,8 @@ 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; +import okio.ByteString; /* * A JSON utility class @@ -51,37 +46,42 @@ public class JSON { 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 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() - ; + GsonFireBuilder fireBuilder = new GsonFireBuilder(); GsonBuilder builder = fireBuilder.createGsonBuilder(); return builder; } - private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + private static String getDiscriminatorValue( + JsonElement readElement, String discriminatorField) { JsonElement element = readElement.getAsJsonObject().get(discriminatorField); if (null == element) { - throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + throw new IllegalArgumentException( + "missing discriminator field: <" + discriminatorField + ">"); } return element.getAsString(); } /** - * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * 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) { + 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 + ">"); + throw new IllegalArgumentException( + "cannot determine model class of name: <" + discriminatorValue + ">"); } return clazz; } @@ -93,101 +93,288 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri 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()); + 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(); } @@ -226,8 +413,8 @@ public static String serialize(Object obj) { /** * Deserialize the given JSON string to Java object. * - * @param Type - * @param body The JSON string + * @param Type + * @param body The JSON string * @param returnType The type to deserialize into * @return The deserialized Java object */ @@ -236,7 +423,8 @@ 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) + // 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 { @@ -253,9 +441,7 @@ public static T deserialize(String body, Type returnType) { } } - /** - * Gson TypeAdapter for Byte Array type - */ + /** Gson TypeAdapter for Byte Array type */ public static class ByteArrayAdapter extends TypeAdapter { @Override @@ -281,9 +467,7 @@ public byte[] read(JsonReader in) throws IOException { } } - /** - * Gson TypeAdapter for JSR310 OffsetDateTime type - */ + /** Gson TypeAdapter for JSR310 OffsetDateTime type */ public static class OffsetDateTimeTypeAdapter extends TypeAdapter { private DateTimeFormatter formatter; @@ -318,16 +502,14 @@ public OffsetDateTime read(JsonReader in) throws IOException { default: String date = in.nextString(); if (date.endsWith("+0000")) { - date = date.substring(0, date.length()-5) + "Z"; + date = date.substring(0, date.length() - 5) + "Z"; } return OffsetDateTime.parse(date, formatter); } } } - /** - * Gson TypeAdapter for JSR310 LocalDate type - */ + /** Gson TypeAdapter for JSR310 LocalDate type */ public static class LocalDateTypeAdapter extends TypeAdapter { private DateTimeFormatter formatter; @@ -375,9 +557,8 @@ public static void setLocalDateFormat(DateTimeFormatter 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). + * 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 { @@ -420,7 +601,8 @@ public java.sql.Date read(JsonReader in) throws IOException { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } - return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + return new java.sql.Date( + ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); } catch (ParseException e) { throw new JsonParseException(e); } @@ -429,8 +611,8 @@ public java.sql.Date read(JsonReader in) throws IOException { } /** - * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, ISO8601Utils will be used. + * Gson TypeAdapter for java.util.Date type If the dateFormat is null, ISO8601Utils will be + * used. */ public static class DateTypeAdapter extends TypeAdapter { diff --git a/src/main/java/com/configcat/publicapi/java/client/Pair.java b/src/main/java/com/configcat/publicapi/java/client/Pair.java index 88336a3..fda1580 100644 --- a/src/main/java/com/configcat/publicapi/java/client/Pair.java +++ b/src/main/java/com/configcat/publicapi/java/client/Pair.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,15 +10,17 @@ * Do not edit the class manually. */ - package com.configcat.publicapi.java.client; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[Etc/UTC]", + comments = "Generator version: 7.7.0") public class Pair { private String name = ""; private String value = ""; - public Pair (String name, String value) { + public Pair(String name, String value) { setName(name); setValue(value); } diff --git a/src/main/java/com/configcat/publicapi/java/client/ProgressRequestBody.java b/src/main/java/com/configcat/publicapi/java/client/ProgressRequestBody.java index fa0316d..13d182d 100644 --- a/src/main/java/com/configcat/publicapi/java/client/ProgressRequestBody.java +++ b/src/main/java/com/configcat/publicapi/java/client/ProgressRequestBody.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,14 +10,12 @@ * Do not edit the class manually. */ - package com.configcat.publicapi.java.client; -import okhttp3.MediaType; -import okhttp3.RequestBody; import java.io.IOException; - +import okhttp3.MediaType; +import okhttp3.RequestBody; import okio.Buffer; import okio.BufferedSink; import okio.ForwardingSink; @@ -66,7 +64,8 @@ public void write(Buffer source, long byteCount) throws IOException { } bytesWritten += byteCount; - callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + 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 index 6fb85b3..8a45337 100644 --- a/src/main/java/com/configcat/publicapi/java/client/ProgressResponseBody.java +++ b/src/main/java/com/configcat/publicapi/java/client/ProgressResponseBody.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,14 +10,12 @@ * Do not edit the class manually. */ - package com.configcat.publicapi.java.client; -import okhttp3.MediaType; -import okhttp3.ResponseBody; import java.io.IOException; - +import okhttp3.MediaType; +import okhttp3.ResponseBody; import okio.Buffer; import okio.BufferedSource; import okio.ForwardingSource; @@ -62,7 +60,8 @@ 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); + 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 index baf57c4..a039961 100644 --- a/src/main/java/com/configcat/publicapi/java/client/ServerConfiguration.java +++ b/src/main/java/com/configcat/publicapi/java/client/ServerConfiguration.java @@ -1,11 +1,13 @@ package com.configcat.publicapi.java.client; + import java.util.Map; -/** - * Representing a Server configuration. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** Representing a Server configuration. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[Etc/UTC]", + comments = "Generator version: 7.7.0") public class ServerConfiguration { public String URL; public String description; @@ -14,9 +16,11 @@ public class ServerConfiguration { /** * @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. + * @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) { + public ServerConfiguration( + String URL, String description, Map variables) { this.URL = URL; this.description = description; this.variables = variables; @@ -32,15 +36,21 @@ public String URL(Map variables) { String url = this.URL; // go through variables and replace placeholders - for (Map.Entry variable: this.variables.entrySet()) { + 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 + "."); + 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); diff --git a/src/main/java/com/configcat/publicapi/java/client/ServerVariable.java b/src/main/java/com/configcat/publicapi/java/client/ServerVariable.java index 1b21a4c..a878bf2 100644 --- a/src/main/java/com/configcat/publicapi/java/client/ServerVariable.java +++ b/src/main/java/com/configcat/publicapi/java/client/ServerVariable.java @@ -1,11 +1,13 @@ 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 = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** Representing a Server Variable for server URL template substitution. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[Etc/UTC]", + comments = "Generator version: 7.7.0") public class ServerVariable { public String description; public String defaultValue; @@ -14,7 +16,8 @@ public class ServerVariable { /** * @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. + * @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; diff --git a/src/main/java/com/configcat/publicapi/java/client/StringUtil.java b/src/main/java/com/configcat/publicapi/java/client/StringUtil.java index fdf17dc..e2e7861 100644 --- a/src/main/java/com/configcat/publicapi/java/client/StringUtil.java +++ b/src/main/java/com/configcat/publicapi/java/client/StringUtil.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,74 +10,76 @@ * 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 = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } + /** + * 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; } - 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 ""; - } + /** + * 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]); + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); } - 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()); + /** + * 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(); } - 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 index a87ce22..8cfb707 100644 --- a/src/main/java/com/configcat/publicapi/java/client/api/AuditLogsApi.java +++ b/src/main/java/com/configcat/publicapi/java/client/api/AuditLogsApi.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,33 +10,26 @@ * 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 java.time.OffsetDateTime; +import com.configcat.publicapi.java.client.model.AuditLogType; import com.configcat.publicapi.java.client.model.SettingModel; -import java.util.UUID; - +import com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; public class AuditLogsApi { private ApiClient localVarApiClient; @@ -77,6 +70,7 @@ public void setCustomBaseUrl(String 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) @@ -87,23 +81,31 @@ public void setCustomBaseUrl(String customBaseUrl) { * @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. -
+ * + * + * + * + * + * + *
Status Code 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, String auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime, final ApiCallback _callback) throws ApiException { + 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[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -112,8 +114,11 @@ public okhttp3.Call getAuditlogsCall(UUID productId, UUID configId, UUID environ Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/products/{productId}/auditlogs" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + String localVarPath = + "/v1/products/{productId}/auditlogs" + .replace( + "{" + "productId" + "}", + localVarApiClient.escapeString(productId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -126,54 +131,83 @@ public okhttp3.Call getAuditlogsCall(UUID productId, UUID configId, UUID environ } if (environmentId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("environmentId", environmentId)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("environmentId", environmentId)); } if (auditLogType != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("auditLogType", auditLogType)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("auditLogType", auditLogType)); } if (fromUtcDateTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fromUtcDateTime", fromUtcDateTime)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("fromUtcDateTime", fromUtcDateTime)); } if (toUtcDateTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("toUtcDateTime", toUtcDateTime)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("toUtcDateTime", toUtcDateTime)); } - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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, String auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime, final ApiCallback _callback) throws ApiException { + 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)"); + throw new ApiException( + "Missing the required parameter 'productId' when calling getAuditlogs(Async)"); } - return getAuditlogsCall(productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime, _callback); - + 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. + * 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) @@ -181,24 +215,40 @@ private okhttp3.Call getAuditlogsValidateBeforeCall(UUID productId, UUID configI * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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, String auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime) throws ApiException { - ApiResponse> localVarResp = getAuditlogsWithHttpInfo(productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime); + 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. + * 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) @@ -206,25 +256,43 @@ public List getAuditlogs(UUID productId, UUID configId, UUID * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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, String auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime) throws ApiException { - okhttp3.Call localVarCall = getAuditlogsValidateBeforeCall(productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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. + * 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) @@ -233,47 +301,66 @@ public ApiResponse> getAuditlogsWithHttpInfo(UUID produc * @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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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, String 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(); + 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getDeletedSettingsCall(UUID configId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -282,8 +369,11 @@ public okhttp3.Call getDeletedSettingsCall(UUID configId, final ApiCallback _cal Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/configs/{configId}/deleted-settings" - .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())); + String localVarPath = + "/v1/configs/{configId}/deleted-settings" + .replace( + "{" + "configId" + "}", + localVarApiClient.escapeString(configId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -291,50 +381,63 @@ public okhttp3.Call getDeletedSettingsCall(UUID configId, final ApiCallback _cal Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); @@ -342,51 +445,58 @@ public List getDeletedSettings(UUID configId) throws ApiException } /** - * List Deleted Settings - * This endpoint returns the list of Feature Flags and Settings that were deleted from the given Config. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public ApiResponse> getDeletedSettingsWithHttpInfo(UUID configId) + throws ApiException { okhttp3.Call localVarCall = getDeletedSettingsValidateBeforeCall(configId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getDeletedSettingsAsync( + UUID configId, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = getDeletedSettingsValidateBeforeCall(configId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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) @@ -398,23 +508,32 @@ public okhttp3.Call getDeletedSettingsAsync(UUID configId, final ApiCallback - Status Code Description Response Headers - 200 - - 400 Bad request. - - 404 Not found. - - 429 Too many requests. In case of the request rate exceeds the rate limits. - - + * + * + * + * + * + * + *
Status Code 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, String auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime, final ApiCallback _callback) throws ApiException { + 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[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -423,8 +542,11 @@ public okhttp3.Call getOrganizationAuditlogsCall(UUID organizationId, UUID produ Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/organizations/{organizationId}/auditlogs" - .replace("{" + "organizationId" + "}", localVarApiClient.escapeString(organizationId.toString())); + String localVarPath = + "/v1/organizations/{organizationId}/auditlogs" + .replace( + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -441,54 +563,87 @@ public okhttp3.Call getOrganizationAuditlogsCall(UUID organizationId, UUID produ } if (environmentId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("environmentId", environmentId)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("environmentId", environmentId)); } if (auditLogType != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("auditLogType", auditLogType)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("auditLogType", auditLogType)); } if (fromUtcDateTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fromUtcDateTime", fromUtcDateTime)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("fromUtcDateTime", fromUtcDateTime)); } if (toUtcDateTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("toUtcDateTime", toUtcDateTime)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("toUtcDateTime", toUtcDateTime)); } - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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, String auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime, final ApiCallback _callback) throws ApiException { + 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)"); + throw new ApiException( + "Missing the required parameter 'organizationId' when calling" + + " getOrganizationAuditlogs(Async)"); } - return getOrganizationAuditlogsCall(organizationId, productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime, _callback); - + 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. + * 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) @@ -497,24 +652,43 @@ private okhttp3.Call getOrganizationAuditlogsValidateBeforeCall(UUID organizatio * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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, String auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime) throws ApiException { - ApiResponse> localVarResp = getOrganizationAuditlogsWithHttpInfo(organizationId, productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime); + 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. + * 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) @@ -523,25 +697,45 @@ public List getOrganizationAuditlogs(UUID organizationId, UUI * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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, String auditLogType, OffsetDateTime fromUtcDateTime, OffsetDateTime toUtcDateTime) throws ApiException { - okhttp3.Call localVarCall = getOrganizationAuditlogsValidateBeforeCall(organizationId, productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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. + * 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) @@ -551,20 +745,39 @@ public ApiResponse> getOrganizationAuditlogsWithHttpInfo * @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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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, String 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(); + 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 index 22e4524..b477637 100644 --- a/src/main/java/com/configcat/publicapi/java/client/api/CodeReferencesApi.java +++ b/src/main/java/com/configcat/publicapi/java/client/api/CodeReferencesApi.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,27 +10,19 @@ * 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 com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; @@ -76,28 +68,32 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for v1CodeReferencesDeleteReportsPost - * @param deleteRepositoryReportsRequest (required) + * + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call v1CodeReferencesDeleteReportsPostCall( + DeleteRepositoryReportsRequest deleteRepositoryReportsRequest, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -114,122 +110,150 @@ public okhttp3.Call v1CodeReferencesDeleteReportsPostCall(DeleteRepositoryReport Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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 + * + * @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. -
+ * + * + * + * + * + * + *
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 { + public void v1CodeReferencesDeleteReportsPost( + DeleteRepositoryReportsRequest deleteRepositoryReportsRequest) throws ApiException { v1CodeReferencesDeleteReportsPostWithHttpInfo(deleteRepositoryReportsRequest); } /** * Delete Reference reports - * - * @param deleteRepositoryReportsRequest (required) + * + * @param deleteRepositoryReportsRequest (required) * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); + 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 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 + * @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. -
+ * + * + * + * + * + * + *
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); + 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 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call v1CodeReferencesPostCall( + CodeReferenceRequest codeReferenceRequest, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -246,122 +270,145 @@ public okhttp3.Call v1CodeReferencesPostCall(CodeReferenceRequest codeReferenceR Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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 + * + * @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. -
+ * + * + * + * + * + * + *
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 { + public void v1CodeReferencesPost(CodeReferenceRequest codeReferenceRequest) + throws ApiException { v1CodeReferencesPostWithHttpInfo(codeReferenceRequest); } /** * Upload References - * - * @param codeReferenceRequest (required) + * + * @param codeReferenceRequest (required) * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); + public ApiResponse v1CodeReferencesPostWithHttpInfo( + CodeReferenceRequest codeReferenceRequest) throws ApiException { + okhttp3.Call localVarCall = + v1CodeReferencesPostValidateBeforeCall(codeReferenceRequest, null); return localVarApiClient.execute(localVarCall); } /** * Upload References (asynchronously) - * - * @param codeReferenceRequest (required) + * + * @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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call v1CodeReferencesPostAsync( + CodeReferenceRequest codeReferenceRequest, final ApiCallback _callback) + throws ApiException { - okhttp3.Call localVarCall = v1CodeReferencesPostValidateBeforeCall(codeReferenceRequest, _callback); + 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call v1SettingsSettingIdCodeReferencesGetCall( + Integer settingId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -370,8 +417,11 @@ public okhttp3.Call v1SettingsSettingIdCodeReferencesGetCall(Integer settingId, Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/settings/{settingId}/code-references" - .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); + String localVarPath = + "/v1/settings/{settingId}/code-references" + .replace( + "{" + "settingId" + "}", + localVarApiClient.escapeString(settingId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -379,97 +429,118 @@ public okhttp3.Call v1SettingsSettingIdCodeReferencesGetCall(Integer settingId, Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); + 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call v1SettingsSettingIdCodeReferencesGetAsync( + Integer settingId, final ApiCallback> _callback) + throws ApiException { - okhttp3.Call localVarCall = v1SettingsSettingIdCodeReferencesGetValidateBeforeCall(settingId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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 index d664bcb..64a1e4a 100644 --- a/src/main/java/com/configcat/publicapi/java/client/api/ConfigsApi.java +++ b/src/main/java/com/configcat/publicapi/java/client/api/ConfigsApi.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,33 +10,25 @@ * 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 com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; public class ConfigsApi { private ApiClient localVarApiClient; @@ -77,29 +69,32 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for createConfig + * * @param productId The identifier of the Product. (required) - * @param createConfigRequest (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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call createConfigCall( + UUID productId, CreateConfigRequest createConfigRequest, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -108,8 +103,11 @@ public okhttp3.Call createConfigCall(UUID productId, CreateConfigRequest createC Object localVarPostBody = createConfigRequest; // create path and map variables - String localVarPath = "/v1/products/{productId}/configs" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + String localVarPath = + "/v1/products/{productId}/configs" + .replace( + "{" + "productId" + "}", + localVarApiClient.escapeString(productId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -117,135 +115,167 @@ public okhttp3.Call createConfigCall(UUID productId, CreateConfigRequest createC Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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. + * 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) + * @param createConfigRequest (required) * @return ConfigModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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); + 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. + * 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) + * @param createConfigRequest (required) * @return ApiResponse<ConfigModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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(); + 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. + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
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(); + 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call deleteConfigCall(UUID configId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -254,8 +284,11 @@ public okhttp3.Call deleteConfigCall(UUID configId, final ApiCallback _callback) Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/configs/{configId}" - .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())); + String localVarPath = + "/v1/configs/{configId}" + .replace( + "{" + "configId" + "}", + localVarApiClient.escapeString(configId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -263,67 +296,82 @@ public okhttp3.Call deleteConfigCall(UUID configId, final ApiCallback _callback) Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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. + * 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 + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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); @@ -331,22 +379,25 @@ public ApiResponse deleteConfigWithHttpInfo(UUID configId) throws ApiExcep } /** - * Delete Config (asynchronously) - * This endpoint removes a Config identified by the `configId` parameter. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call deleteConfigAsync(UUID configId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = deleteConfigValidateBeforeCall(configId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); @@ -354,28 +405,30 @@ public okhttp3.Call deleteConfigAsync(UUID configId, final ApiCallback _ca } /** * 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getConfigCall(UUID configId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -384,8 +437,11 @@ public okhttp3.Call getConfigCall(UUID configId, final ApiCallback _callback) th Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/configs/{configId}" - .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())); + String localVarPath = + "/v1/configs/{configId}" + .replace( + "{" + "configId" + "}", + localVarApiClient.escapeString(configId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -393,50 +449,62 @@ public okhttp3.Call getConfigCall(UUID configId, final ApiCallback _callback) th Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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`. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); @@ -444,73 +512,80 @@ public ConfigModel getConfig(UUID configId) throws ApiException { } /** - * Get Config - * This endpoint returns the metadata of a Config identified by the `configId`. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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(); + 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`. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getConfigAsync(UUID configId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = getConfigValidateBeforeCall(configId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getConfigsCall(UUID productId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -519,8 +594,11 @@ public okhttp3.Call getConfigsCall(UUID productId, final ApiCallback _callback) Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/products/{productId}/configs" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + String localVarPath = + "/v1/products/{productId}/configs" + .replace( + "{" + "productId" + "}", + localVarApiClient.escapeString(productId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -528,50 +606,63 @@ public okhttp3.Call getConfigsCall(UUID productId, final ApiCallback _callback) Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); @@ -579,74 +670,85 @@ public List getConfigs(UUID productId) throws ApiException { } /** - * 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public ApiResponse> getConfigsWithHttpInfo(UUID productId) + throws ApiException { okhttp3.Call localVarCall = getConfigsValidateBeforeCall(productId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getConfigsAsync( + UUID productId, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = getConfigsValidateBeforeCall(productId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call updateConfigCall( + UUID configId, UpdateConfigRequest updateConfigRequest, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -655,8 +757,11 @@ public okhttp3.Call updateConfigCall(UUID configId, UpdateConfigRequest updateCo Object localVarPostBody = updateConfigRequest; // create path and map variables - String localVarPath = "/v1/configs/{configId}" - .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())); + String localVarPath = + "/v1/configs/{configId}" + .replace( + "{" + "configId" + "}", + localVarApiClient.escapeString(configId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -664,108 +769,135 @@ public okhttp3.Call updateConfigCall(UUID configId, UpdateConfigRequest updateCo Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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. + * Update Config This endpoint updates a Config identified by the `configId` + * parameter. + * * @param configId The identifier of the Config. (required) - * @param updateConfigRequest (required) + * @param updateConfigRequest (required) * @return ConfigModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); + 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. + * Update Config This endpoint updates a Config identified by the `configId` + * parameter. + * * @param configId The identifier of the Config. (required) - * @param updateConfigRequest (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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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. + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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 index 0ef5b52..184ddc1 100644 --- a/src/main/java/com/configcat/publicapi/java/client/api/EnvironmentsApi.java +++ b/src/main/java/com/configcat/publicapi/java/client/api/EnvironmentsApi.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,33 +10,25 @@ * 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 com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; public class EnvironmentsApi { private ApiClient localVarApiClient; @@ -77,29 +69,34 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for createEnvironment + * * @param productId The identifier of the Product. (required) - * @param createEnvironmentModel (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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call createEnvironmentCall( + UUID productId, + CreateEnvironmentModel createEnvironmentModel, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -108,8 +105,11 @@ public okhttp3.Call createEnvironmentCall(UUID productId, CreateEnvironmentModel Object localVarPostBody = createEnvironmentModel; // create path and map variables - String localVarPath = "/v1/products/{productId}/environments" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + String localVarPath = + "/v1/products/{productId}/environments" + .replace( + "{" + "productId" + "}", + localVarApiClient.escapeString(productId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -117,136 +117,173 @@ public okhttp3.Call createEnvironmentCall(UUID productId, CreateEnvironmentModel Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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. + * 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) + * @param createEnvironmentModel (required) * @return EnvironmentModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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); + 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. + * 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) + * @param createEnvironmentModel (required) * @return ApiResponse<EnvironmentModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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(); + 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. + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
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(); + 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 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call deleteEnvironmentCall( + UUID environmentId, Boolean cleanupAuditLogs, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -255,8 +292,11 @@ public okhttp3.Call deleteEnvironmentCall(UUID environmentId, Boolean cleanupAud Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/environments/{environmentId}" - .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())); + String localVarPath = + "/v1/environments/{environmentId}" + .replace( + "{" + "environmentId" + "}", + localVarApiClient.escapeString(environmentId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -265,125 +305,162 @@ public okhttp3.Call deleteEnvironmentCall(UUID environmentId, Boolean cleanupAud Map localVarFormParams = new HashMap(); if (cleanupAuditLogs != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("cleanupAuditLogs", cleanupAuditLogs)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("cleanupAuditLogs", cleanupAuditLogs)); } - final String[] localVarAccepts = { - }; + 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); + 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); + 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 { + 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)"); + 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). + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + 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). + * 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) + * @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 + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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); + 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). + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call deleteEnvironmentAsync( + UUID environmentId, Boolean cleanupAuditLogs, final ApiCallback _callback) + throws ApiException { - okhttp3.Call localVarCall = deleteEnvironmentValidateBeforeCall(environmentId, cleanupAuditLogs, _callback); + 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getEnvironmentCall(UUID environmentId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -392,8 +469,11 @@ public okhttp3.Call getEnvironmentCall(UUID environmentId, final ApiCallback _ca Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/environments/{environmentId}" - .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())); + String localVarPath = + "/v1/environments/{environmentId}" + .replace( + "{" + "environmentId" + "}", + localVarApiClient.escapeString(environmentId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -401,50 +481,63 @@ public okhttp3.Call getEnvironmentCall(UUID environmentId, final ApiCallback _ca Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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`. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); @@ -452,73 +545,81 @@ public EnvironmentModel getEnvironment(UUID environmentId) throws ApiException { } /** - * Get Environment - * This endpoint returns the metadata of an Environment identified by the `environmentId`. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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 { + public ApiResponse getEnvironmentWithHttpInfo(UUID environmentId) + throws ApiException { okhttp3.Call localVarCall = getEnvironmentValidateBeforeCall(environmentId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + 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`. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getEnvironmentAsync( + UUID environmentId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getEnvironmentValidateBeforeCall(environmentId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getEnvironmentsCall(UUID productId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -527,8 +628,11 @@ public okhttp3.Call getEnvironmentsCall(UUID productId, final ApiCallback _callb Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/products/{productId}/environments" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + String localVarPath = + "/v1/products/{productId}/environments" + .replace( + "{" + "productId" + "}", + localVarApiClient.escapeString(productId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -536,50 +640,64 @@ public okhttp3.Call getEnvironmentsCall(UUID productId, final ApiCallback _callb Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); @@ -587,74 +705,88 @@ public List getEnvironments(UUID productId) throws ApiExceptio } /** - * 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public ApiResponse> getEnvironmentsWithHttpInfo(UUID productId) + throws ApiException { okhttp3.Call localVarCall = getEnvironmentsValidateBeforeCall(productId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getEnvironmentsAsync( + UUID productId, final ApiCallback> _callback) + throws ApiException { okhttp3.Call localVarCall = getEnvironmentsValidateBeforeCall(productId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call updateEnvironmentCall( + UUID environmentId, + UpdateEnvironmentModel updateEnvironmentModel, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -663,8 +795,11 @@ public okhttp3.Call updateEnvironmentCall(UUID environmentId, UpdateEnvironmentM Object localVarPostBody = updateEnvironmentModel; // create path and map variables - String localVarPath = "/v1/environments/{environmentId}" - .replace("{" + "environmentId" + "}", localVarApiClient.escapeString(environmentId.toString())); + String localVarPath = + "/v1/environments/{environmentId}" + .replace( + "{" + "environmentId" + "}", + localVarApiClient.escapeString(environmentId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -672,108 +807,139 @@ public okhttp3.Call updateEnvironmentCall(UUID environmentId, UpdateEnvironmentM Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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. + * Update Environment This endpoint updates an Environment identified by the + * `environmentId` parameter. + * * @param environmentId The identifier of the Environment. (required) - * @param updateEnvironmentModel (required) + * @param updateEnvironmentModel (required) * @return EnvironmentModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); + 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. + * Update Environment This endpoint updates an Environment identified by the + * `environmentId` parameter. + * * @param environmentId The identifier of the Environment. (required) - * @param updateEnvironmentModel (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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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. + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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 index d44dd5a..18ff10a 100644 --- a/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesApi.java +++ b/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesApi.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,35 +10,27 @@ * 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 com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; public class FeatureFlagSettingValuesApi { private ApiClient localVarApiClient; @@ -79,29 +71,32 @@ public void setCustomBaseUrl(String 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getSettingValueCall( + UUID environmentId, Integer settingId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -110,9 +105,14 @@ public okhttp3.Call getSettingValueCall(UUID environmentId, Integer settingId, f 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())); + 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(); @@ -120,133 +120,189 @@ public okhttp3.Call getSettingValueCall(UUID environmentId, Integer settingId, f Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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)"); + 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). + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); + 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). + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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(); + 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). + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + 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(); + 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getSettingValuesCall( + UUID configId, UUID environmentId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -255,9 +311,14 @@ public okhttp3.Call getSettingValuesCall(UUID configId, UUID environmentId, fina 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())); + 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(); @@ -265,135 +326,199 @@ public okhttp3.Call getSettingValuesCall(UUID configId, UUID environmentId, fina Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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)"); + 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/). + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); + 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/). + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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(); + 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/). + * 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 + * @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. -
+ * + * + * + * + * + * + *
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(); + 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 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. -
+ * + * + * + * + * + * + *
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 { + 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[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -402,9 +527,14 @@ public okhttp3.Call postSettingValuesCall(UUID configId, UUID environmentId, Upd 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())); + 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(); @@ -416,149 +546,271 @@ public okhttp3.Call postSettingValuesCall(UUID configId, UUID environmentId, Upd localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); } - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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)"); + throw new ApiException( + "Missing the required parameter 'updateSettingValuesWithIdModel' when calling" + + " postSettingValues(Async)"); } - return postSettingValuesCall(configId, environmentId, updateSettingValuesWithIdModel, reason, _callback); - + 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. + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); + 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. + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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(); + 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. + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
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(); + 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 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + 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[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -567,9 +819,14 @@ public okhttp3.Call replaceSettingValueCall(UUID environmentId, Integer settingI 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())); + 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(); @@ -581,150 +838,260 @@ public okhttp3.Call replaceSettingValueCall(UUID environmentId, Integer settingI localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); } - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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)"); + throw new ApiException( + "Missing the required parameter 'updateSettingValueModel' when calling" + + " replaceSettingValue(Async)"); } - return replaceSettingValueCall(environmentId, settingId, updateSettingValueModel, reason, _callback); - + 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. + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); + 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. + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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. + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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 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. -
+ * + * + * + * + * + * + * + *
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 { + 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[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -733,9 +1100,14 @@ public okhttp3.Call updateSettingValueCall(UUID environmentId, Integer settingId 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())); + 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(); @@ -747,122 +1119,237 @@ public okhttp3.Call updateSettingValueCall(UUID environmentId, Integer settingId localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); } - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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)"); + throw new ApiException( + "Missing the required parameter 'jsonPatchOperation' when calling" + + " updateSettingValue(Async)"); } - return updateSettingValueCall(environmentId, settingId, jsonPatchOperation, reason, _callback); - + 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. + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + * + *
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); + 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. + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + * + *
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(); + 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. + * 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 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 + * @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. -
+ * + * + * + * + * + * + * + *
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(); + 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 index d77443d..a111aa8 100644 --- a/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyApi.java +++ b/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyApi.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,27 +10,19 @@ * 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 com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; @@ -76,29 +68,33 @@ public void setCustomBaseUrl(String 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 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getSettingValueBySdkkeyCall( + String settingKeyOrId, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -107,8 +103,11 @@ public okhttp3.Call getSettingValueBySdkkeyCall(String settingKeyOrId, String X_ Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/settings/{settingKeyOrId}/value" - .replace("{" + "settingKeyOrId" + "}", localVarApiClient.escapeString(settingKeyOrId.toString())); + String localVarPath = + "/v1/settings/{settingKeyOrId}/value" + .replace( + "{" + "settingKeyOrId" + "}", + localVarApiClient.escapeString(settingKeyOrId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -117,133 +116,207 @@ public okhttp3.Call getSettingValueBySdkkeyCall(String settingKeyOrId, String X_ Map localVarFormParams = new HashMap(); if (X_CONFIGCAT_SDKKEY != null) { - localVarHeaderParams.put("X-CONFIGCAT-SDKKEY", localVarApiClient.parameterToString(X_CONFIGCAT_SDKKEY)); + localVarHeaderParams.put( + "X-CONFIGCAT-SDKKEY", localVarApiClient.parameterToString(X_CONFIGCAT_SDKKEY)); } - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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/). + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); + 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/). + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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/). + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + 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[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -252,8 +325,11 @@ public okhttp3.Call replaceSettingValueBySdkkeyCall(String settingKeyOrId, Updat Object localVarPostBody = updateSettingValueModel; // create path and map variables - String localVarPath = "/v1/settings/{settingKeyOrId}/value" - .replace("{" + "settingKeyOrId" + "}", localVarApiClient.escapeString(settingKeyOrId.toString())); + String localVarPath = + "/v1/settings/{settingKeyOrId}/value" + .replace( + "{" + "settingKeyOrId" + "}", + localVarApiClient.escapeString(settingKeyOrId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -266,148 +342,257 @@ public okhttp3.Call replaceSettingValueBySdkkeyCall(String settingKeyOrId, Updat } if (X_CONFIGCAT_SDKKEY != null) { - localVarHeaderParams.put("X-CONFIGCAT-SDKKEY", localVarApiClient.parameterToString(X_CONFIGCAT_SDKKEY)); + localVarHeaderParams.put( + "X-CONFIGCAT-SDKKEY", localVarApiClient.parameterToString(X_CONFIGCAT_SDKKEY)); } - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + throw new ApiException( + "Missing the required parameter 'updateSettingValueModel' when calling" + + " replaceSettingValueBySdkkey(Async)"); } - return replaceSettingValueBySdkkeyCall(settingKeyOrId, updateSettingValueModel, reason, X_CONFIGCAT_SDKKEY, _callback); - + 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 } ``` + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); + 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 } ``` + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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 } ``` + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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 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. -
+ * + * + * + * + * + * + * + *
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 { + 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[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -416,8 +601,11 @@ public okhttp3.Call updateSettingValueBySdkkeyCall(String settingKeyOrId, List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -430,120 +618,227 @@ public okhttp3.Call updateSettingValueBySdkkeyCall(String settingKeyOrId, List jsonPatchOperation, String reason, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) throws ApiException { + 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)"); + 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)"); + throw new ApiException( + "Missing the required parameter 'jsonPatchOperation' when calling" + + " updateSettingValueBySdkkey(Async)"); } - return updateSettingValueBySdkkeyCall(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY, _callback); - + 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 } ``` + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + * + *
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); + 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 } ``` + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + * + *
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(); + 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 } ``` + * 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 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 + * @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. -
+ * + * + * + * + * + * + * + *
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(); + 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 index 85149f8..93c0ed5 100644 --- a/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyV2Api.java +++ b/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyV2Api.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,27 +10,19 @@ * 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 com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; @@ -76,29 +68,33 @@ public void setCustomBaseUrl(String 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 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getSettingValueBySdkkeyV2Call( + String settingKeyOrId, String X_CONFIGCAT_SDKKEY, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -107,8 +103,11 @@ public okhttp3.Call getSettingValueBySdkkeyV2Call(String settingKeyOrId, String Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v2/settings/{settingKeyOrId}/value" - .replace("{" + "settingKeyOrId" + "}", localVarApiClient.escapeString(settingKeyOrId.toString())); + String localVarPath = + "/v2/settings/{settingKeyOrId}/value" + .replace( + "{" + "settingKeyOrId" + "}", + localVarApiClient.escapeString(settingKeyOrId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -117,133 +116,218 @@ public okhttp3.Call getSettingValueBySdkkeyV2Call(String settingKeyOrId, String Map localVarFormParams = new HashMap(); if (X_CONFIGCAT_SDKKEY != null) { - localVarHeaderParams.put("X-CONFIGCAT-SDKKEY", localVarApiClient.parameterToString(X_CONFIGCAT_SDKKEY)); + localVarHeaderParams.put( + "X-CONFIGCAT-SDKKEY", localVarApiClient.parameterToString(X_CONFIGCAT_SDKKEY)); } - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); + 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. + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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. + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + 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[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -252,8 +336,11 @@ public okhttp3.Call replaceSettingValueBySdkkeyV2Call(String settingKeyOrId, Upd Object localVarPostBody = updateEvaluationFormulaModel; // create path and map variables - String localVarPath = "/v2/settings/{settingKeyOrId}/value" - .replace("{" + "settingKeyOrId" + "}", localVarApiClient.escapeString(settingKeyOrId.toString())); + String localVarPath = + "/v2/settings/{settingKeyOrId}/value" + .replace( + "{" + "settingKeyOrId" + "}", + localVarApiClient.escapeString(settingKeyOrId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -266,148 +353,276 @@ public okhttp3.Call replaceSettingValueBySdkkeyV2Call(String settingKeyOrId, Upd } if (X_CONFIGCAT_SDKKEY != null) { - localVarHeaderParams.put("X-CONFIGCAT-SDKKEY", localVarApiClient.parameterToString(X_CONFIGCAT_SDKKEY)); + localVarHeaderParams.put( + "X-CONFIGCAT-SDKKEY", localVarApiClient.parameterToString(X_CONFIGCAT_SDKKEY)); } - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + throw new ApiException( + "Missing the required parameter 'updateEvaluationFormulaModel' when calling" + + " replaceSettingValueBySdkkeyV2(Async)"); } - return replaceSettingValueBySdkkeyV2Call(settingKeyOrId, updateEvaluationFormulaModel, reason, X_CONFIGCAT_SDKKEY, _callback); - + 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\": [] } ``` + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); + 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\": [] } ``` + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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\": [] } ``` + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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 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. -
+ * + * + * + * + * + * + * + *
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 { + 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[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -416,8 +631,11 @@ public okhttp3.Call updateSettingValueBySdkkeyV2Call(String settingKeyOrId, List Object localVarPostBody = jsonPatchOperation; // create path and map variables - String localVarPath = "/v2/settings/{settingKeyOrId}/value" - .replace("{" + "settingKeyOrId" + "}", localVarApiClient.escapeString(settingKeyOrId.toString())); + String localVarPath = + "/v2/settings/{settingKeyOrId}/value" + .replace( + "{" + "settingKeyOrId" + "}", + localVarApiClient.escapeString(settingKeyOrId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -430,120 +648,245 @@ public okhttp3.Call updateSettingValueBySdkkeyV2Call(String settingKeyOrId, List } if (X_CONFIGCAT_SDKKEY != null) { - localVarHeaderParams.put("X-CONFIGCAT-SDKKEY", localVarApiClient.parameterToString(X_CONFIGCAT_SDKKEY)); + localVarHeaderParams.put( + "X-CONFIGCAT-SDKKEY", localVarApiClient.parameterToString(X_CONFIGCAT_SDKKEY)); } - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + throw new ApiException( + "Missing the required parameter 'jsonPatchOperation' when calling" + + " updateSettingValueBySdkkeyV2(Async)"); } - return updateSettingValueBySdkkeyV2Call(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY, _callback); - + 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 } } ] } ``` + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + * + *
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); + 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 } } ] } ``` + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + * + *
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(); + 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 } } ] } ``` + * 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 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 + * @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. -
+ * + * + * + * + * + * + * + *
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(); + 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 index 9009b3d..1a50ab9 100644 --- a/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesV2Api.java +++ b/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesV2Api.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,35 +10,27 @@ * 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 com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; public class FeatureFlagSettingValuesV2Api { private ApiClient localVarApiClient; @@ -79,29 +71,32 @@ public void setCustomBaseUrl(String 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getSettingValueV2Call( + UUID environmentId, Integer settingId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -110,9 +105,14 @@ public okhttp3.Call getSettingValueV2Call(UUID environmentId, Integer settingId, 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())); + 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(); @@ -120,133 +120,198 @@ public okhttp3.Call getSettingValueV2Call(UUID environmentId, Integer settingId, Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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)"); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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(); + 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + 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(); + 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getSettingValuesV2Call( + UUID configId, UUID environmentId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -255,9 +320,14 @@ public okhttp3.Call getSettingValuesV2Call(UUID configId, UUID environmentId, fi 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())); + 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(); @@ -265,135 +335,207 @@ public okhttp3.Call getSettingValuesV2Call(UUID configId, UUID environmentId, fi Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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)"); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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(); + 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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(); + 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 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. -
+ * + * + * + * + * + * + *
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 { + 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[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -402,9 +544,14 @@ public okhttp3.Call postSettingValuesV2Call(UUID configId, UUID environmentId, U 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())); + 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(); @@ -416,149 +563,268 @@ public okhttp3.Call postSettingValuesV2Call(UUID configId, UUID environmentId, U localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); } - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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)"); + throw new ApiException( + "Missing the required parameter 'updateEvaluationFormulasModel' when calling" + + " postSettingValuesV2(Async)"); } - return postSettingValuesV2Call(configId, environmentId, updateEvaluationFormulasModel, reason, _callback); - + 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 } } ] } ``` + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); + 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 } } ] } ``` + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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(); + 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 } } ] } ``` + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
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(); + 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 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + 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[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -567,9 +833,14 @@ public okhttp3.Call replaceSettingValueV2Call(UUID environmentId, Integer settin 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())); + 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(); @@ -581,150 +852,263 @@ public okhttp3.Call replaceSettingValueV2Call(UUID environmentId, Integer settin localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); } - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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)"); + throw new ApiException( + "Missing the required parameter 'updateEvaluationFormulaModel' when calling" + + " replaceSettingValueV2(Async)"); } - return replaceSettingValueV2Call(environmentId, settingId, updateEvaluationFormulaModel, reason, _callback); - + 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\": [] } ``` + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); + 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\": [] } ``` + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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\": [] } ``` + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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 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. -
+ * + * + * + * + * + * + * + *
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 { + 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[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -733,9 +1117,14 @@ public okhttp3.Call updateSettingValueV2Call(UUID environmentId, Integer setting 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())); + 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(); @@ -747,122 +1136,245 @@ public okhttp3.Call updateSettingValueV2Call(UUID environmentId, Integer setting localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason)); } - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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)"); + throw new ApiException( + "Missing the required parameter 'jsonPatchOperation' when calling" + + " updateSettingValueV2(Async)"); } - return updateSettingValueV2Call(environmentId, settingId, jsonPatchOperation, reason, _callback); - + 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 } } ] } ``` + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + * + *
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); + 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 } } ] } ``` + * 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) + * @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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + * + *
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(); + 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 } } ] } ``` + * 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 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 + * @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. -
+ * + * + * + * + * + * + * + *
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(); + 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 index 1618212..37d4490 100644 --- a/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagsSettingsApi.java +++ b/src/main/java/com/configcat/publicapi/java/client/api/FeatureFlagsSettingsApi.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,34 +10,26 @@ * 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 com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; public class FeatureFlagsSettingsApi { private ApiClient localVarApiClient; @@ -78,29 +70,34 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for createSetting + * * @param configId The identifier of the Config. (required) - * @param createSettingInitialValues (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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call createSettingCall( + UUID configId, + CreateSettingInitialValues createSettingInitialValues, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -109,8 +106,11 @@ public okhttp3.Call createSettingCall(UUID configId, CreateSettingInitialValues Object localVarPostBody = createSettingInitialValues; // create path and map variables - String localVarPath = "/v1/configs/{configId}/settings" - .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())); + String localVarPath = + "/v1/configs/{configId}/settings" + .replace( + "{" + "configId" + "}", + localVarApiClient.escapeString(configId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -118,135 +118,171 @@ public okhttp3.Call createSettingCall(UUID configId, CreateSettingInitialValues Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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. + * 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) + * @param createSettingInitialValues (required) * @return SettingModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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); + 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. + * 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) + * @param createSettingInitialValues (required) * @return ApiResponse<SettingModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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(); + 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. + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
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(); + 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call deleteSettingCall(Integer settingId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -255,8 +291,11 @@ public okhttp3.Call deleteSettingCall(Integer settingId, final ApiCallback _call Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/settings/{settingId}" - .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); + String localVarPath = + "/v1/settings/{settingId}" + .replace( + "{" + "settingId" + "}", + localVarApiClient.escapeString(settingId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -264,67 +303,82 @@ public okhttp3.Call deleteSettingCall(Integer settingId, final ApiCallback _call Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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. + * 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 + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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); @@ -332,22 +386,25 @@ public ApiResponse deleteSettingWithHttpInfo(Integer settingId) throws Api } /** - * Delete Flag (asynchronously) - * This endpoint removes a Feature Flag or Setting from a specified Config, identified by the `configId` parameter. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call deleteSettingAsync(Integer settingId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = deleteSettingValidateBeforeCall(settingId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); @@ -355,28 +412,30 @@ public okhttp3.Call deleteSettingAsync(Integer settingId, final ApiCallback - 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. - - + * + * + * + * + * + * + *
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 { + public okhttp3.Call getSettingCall(Integer settingId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -385,8 +444,11 @@ public okhttp3.Call getSettingCall(Integer settingId, final ApiCallback _callbac Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/settings/{settingId}" - .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); + String localVarPath = + "/v1/settings/{settingId}" + .replace( + "{" + "settingId" + "}", + localVarApiClient.escapeString(settingId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -394,50 +456,62 @@ public okhttp3.Call getSettingCall(Integer settingId, final ApiCallback _callbac Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); @@ -445,73 +519,80 @@ public SettingModel getSetting(Integer settingId) throws ApiException { } /** - * Get Flag - * This endpoint returns the metadata attributes of a Feature Flag or Setting identified by the `settingId` parameter. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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(); + 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getSettingAsync( + Integer settingId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getSettingValidateBeforeCall(settingId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getSettingsCall(UUID configId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -520,8 +601,11 @@ public okhttp3.Call getSettingsCall(UUID configId, final ApiCallback _callback) Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/configs/{configId}/settings" - .replace("{" + "configId" + "}", localVarApiClient.escapeString(configId.toString())); + String localVarPath = + "/v1/configs/{configId}/settings" + .replace( + "{" + "configId" + "}", + localVarApiClient.escapeString(configId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -529,50 +613,62 @@ public okhttp3.Call getSettingsCall(UUID configId, final ApiCallback _callback) Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); @@ -580,74 +676,83 @@ public List getSettings(UUID configId) throws ApiException { } /** - * List Flags - * This endpoint returns the list of the Feature Flags and Settings defined in a specified Config, identified by the `configId` parameter. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public ApiResponse> getSettingsWithHttpInfo(UUID configId) + throws ApiException { okhttp3.Call localVarCall = getSettingsValidateBeforeCall(configId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getSettingsAsync( + UUID configId, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = getSettingsValidateBeforeCall(configId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call replaceSettingCall( + Integer settingId, ReplaceSettingModel replaceSettingModel, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -656,8 +761,11 @@ public okhttp3.Call replaceSettingCall(Integer settingId, ReplaceSettingModel re Object localVarPostBody = replaceSettingModel; // create path and map variables - String localVarPath = "/v1/settings/{settingId}" - .replace("{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); + String localVarPath = + "/v1/settings/{settingId}" + .replace( + "{" + "settingId" + "}", + localVarApiClient.escapeString(settingId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -665,136 +773,175 @@ public okhttp3.Call replaceSettingCall(Integer settingId, ReplaceSettingModel re Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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. + * 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) + * @param replaceSettingModel (required) * @return SettingModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); + 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. + * 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) + * @param replaceSettingModel (required) * @return ApiResponse<SettingModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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(); + 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. + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
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(); + 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 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call updateSettingCall( + Integer settingId, + List jsonPatchOperation, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -803,8 +950,11 @@ public okhttp3.Call updateSettingCall(Integer settingId, List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -812,108 +962,209 @@ public okhttp3.Call updateSettingCall(Integer settingId, List localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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\" } ] } ``` + * 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) + * @param jsonPatchOperation (required) * @return SettingModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); + 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\" } ] } ``` + * 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) + * @param jsonPatchOperation (required) * @return ApiResponse<SettingModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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(); + 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\" } ] } ``` + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
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(); + 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 index 3cdda10..a777f32 100644 --- a/src/main/java/com/configcat/publicapi/java/client/api/IntegrationLinksApi.java +++ b/src/main/java/com/configcat/publicapi/java/client/api/IntegrationLinksApi.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,36 +10,29 @@ * 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 java.util.UUID; - +import com.configcat.publicapi.java.client.model.IntegrationLinkType; +import com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; public class IntegrationLinksApi { private ApiClient localVarApiClient; @@ -80,32 +73,40 @@ public void setCustomBaseUrl(String 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 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. -
+ * + * + * + * + * + * + *
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, String integrationLinkType, String key, AddOrUpdateIntegrationLinkModel addOrUpdateIntegrationLinkModel, final ApiCallback _callback) throws ApiException { + 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[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -114,11 +115,18 @@ public okhttp3.Call addOrUpdateIntegrationLinkCall(UUID environmentId, Integer s 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())); + 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(); @@ -126,132 +134,203 @@ public okhttp3.Call addOrUpdateIntegrationLinkCall(UUID environmentId, Integer s Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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, String integrationLinkType, String key, AddOrUpdateIntegrationLinkModel addOrUpdateIntegrationLinkModel, final ApiCallback _callback) throws ApiException { + 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)"); + 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)"); + 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)"); + 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)"); + throw new ApiException( + "Missing the required parameter 'key' when calling" + + " addOrUpdateIntegrationLink(Async)"); } - return addOrUpdateIntegrationLinkCall(environmentId, settingId, integrationLinkType, key, addOrUpdateIntegrationLinkModel, _callback); - + 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) + * @param addOrUpdateIntegrationLinkModel (optional) * @return IntegrationLinkModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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, String integrationLinkType, String key, AddOrUpdateIntegrationLinkModel addOrUpdateIntegrationLinkModel) throws ApiException { - ApiResponse localVarResp = addOrUpdateIntegrationLinkWithHttpInfo(environmentId, settingId, integrationLinkType, key, addOrUpdateIntegrationLinkModel); + 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) + * @param addOrUpdateIntegrationLinkModel (optional) * @return ApiResponse<IntegrationLinkModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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, String integrationLinkType, String key, AddOrUpdateIntegrationLinkModel addOrUpdateIntegrationLinkModel) throws ApiException { - okhttp3.Call localVarCall = addOrUpdateIntegrationLinkValidateBeforeCall(environmentId, settingId, integrationLinkType, key, addOrUpdateIntegrationLinkModel, null); - Type localVarReturnType = new TypeToken(){}.getType(); + 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 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 + * @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. -
+ * + * + * + * + * + * + *
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, String 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(); + 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) @@ -260,23 +339,29 @@ public okhttp3.Call addOrUpdateIntegrationLinkAsync(UUID environmentId, Integer * @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. -
+ * + * + * + * + * + * + *
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, String integrationLinkType, String key, final ApiCallback _callback) throws ApiException { + 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[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -285,11 +370,18 @@ public okhttp3.Call deleteIntegrationLinkCall(UUID environmentId, Integer settin 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())); + 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(); @@ -297,149 +389,200 @@ public okhttp3.Call deleteIntegrationLinkCall(UUID environmentId, Integer settin Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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, String integrationLinkType, String key, final ApiCallback _callback) throws ApiException { + 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)"); + 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)"); + 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)"); + 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)"); + throw new ApiException( + "Missing the required parameter 'key' when calling" + + " deleteIntegrationLink(Async)"); } - return deleteIntegrationLinkCall(environmentId, settingId, integrationLinkType, key, _callback); - + 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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, String integrationLinkType, String key) throws ApiException { - ApiResponse localVarResp = deleteIntegrationLinkWithHttpInfo(environmentId, settingId, integrationLinkType, key); + 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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, String integrationLinkType, String key) throws ApiException { - okhttp3.Call localVarCall = deleteIntegrationLinkValidateBeforeCall(environmentId, settingId, integrationLinkType, key, null); - Type localVarReturnType = new TypeToken(){}.getType(); + 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 + * @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. -
+ * + * + * + * + * + * + *
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, String integrationLinkType, String key, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deleteIntegrationLinkValidateBeforeCall(environmentId, settingId, integrationLinkType, key, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + 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. -
+ * + * + * + * + * + * + *
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(String integrationLinkType, String key, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getIntegrationLinkDetailsCall( + IntegrationLinkType integrationLinkType, String key, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -448,9 +591,12 @@ public okhttp3.Call getIntegrationLinkDetailsCall(String integrationLinkType, St 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())); + 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(); @@ -458,135 +604,168 @@ public okhttp3.Call getIntegrationLinkDetailsCall(String integrationLinkType, St Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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(String integrationLinkType, String key, final ApiCallback _callback) throws ApiException { + 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)"); + 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)"); + 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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(String integrationLinkType, String key) throws ApiException { - ApiResponse localVarResp = getIntegrationLinkDetailsWithHttpInfo(integrationLinkType, key); + 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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(String integrationLinkType, String key) throws ApiException { - okhttp3.Call localVarCall = getIntegrationLinkDetailsValidateBeforeCall(integrationLinkType, key, null); - Type localVarReturnType = new TypeToken(){}.getType(); + 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 + * @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. -
+ * + * + * + * + * + * + *
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(String integrationLinkType, String key, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getIntegrationLinkDetailsValidateBeforeCall(integrationLinkType, key, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + 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 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. -
+ * + * + * + * + * + * + *
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 { + 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[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -595,10 +774,15 @@ public okhttp3.Call jiraAddOrUpdateIntegrationLinkCall(UUID environmentId, Integ 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())); + 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(); @@ -606,144 +790,191 @@ public okhttp3.Call jiraAddOrUpdateIntegrationLinkCall(UUID environmentId, Integ Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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)"); + throw new ApiException( + "Missing the required parameter 'key' when calling" + + " jiraAddOrUpdateIntegrationLink(Async)"); } - return jiraAddOrUpdateIntegrationLinkCall(environmentId, settingId, key, addOrUpdateJiraIntegrationLinkModel, _callback); - + 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) + * @param addOrUpdateJiraIntegrationLinkModel (optional) * @return IntegrationLinkModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); + 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) + * @param addOrUpdateJiraIntegrationLinkModel (optional) * @return ApiResponse<IntegrationLinkModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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(); + 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) - * + * (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 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 + * @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. -
+ * + * + * + * + * + * + *
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(); + 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 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. -
+ * + * + * + * + *
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 { + public okhttp3.Call jiraConnectCall(ConnectRequest connectRequest, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -760,82 +991,92 @@ public okhttp3.Call jiraConnectCall(ConnectRequest connectRequest, final ApiCall Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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 + * @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. -
+ * + * + * + * + *
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) + * @param connectRequest (optional) * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + *
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 { + public ApiResponse jiraConnectWithHttpInfo(ConnectRequest connectRequest) + throws ApiException { okhttp3.Call localVarCall = jiraConnectValidateBeforeCall(connectRequest, null); return localVarApiClient.execute(localVarCall); } /** - * (asynchronously) - * - * @param connectRequest (optional) + * (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 + * @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. -
+ * + * + * + * + *
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 { + public okhttp3.Call jiraConnectAsync( + ConnectRequest connectRequest, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = jiraConnectValidateBeforeCall(connectRequest, _callback); localVarApiClient.executeAsync(localVarCall, _callback); 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 index 718c57b..c62f3b0 100644 --- a/src/main/java/com/configcat/publicapi/java/client/api/IntegrationsApi.java +++ b/src/main/java/com/configcat/publicapi/java/client/api/IntegrationsApi.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,34 +10,26 @@ * 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 com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; public class IntegrationsApi { private ApiClient localVarApiClient; @@ -78,29 +70,34 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for createIntegration + * * @param productId The identifier of the Product. (required) - * @param createIntegrationModel (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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call createIntegrationCall( + UUID productId, + CreateIntegrationModel createIntegrationModel, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -109,8 +106,11 @@ public okhttp3.Call createIntegrationCall(UUID productId, CreateIntegrationModel Object localVarPostBody = createIntegrationModel; // create path and map variables - String localVarPath = "/v1/products/{productId}/integrations" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + String localVarPath = + "/v1/products/{productId}/integrations" + .replace( + "{" + "productId" + "}", + localVarApiClient.escapeString(productId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -118,135 +118,218 @@ public okhttp3.Call createIntegrationCall(UUID productId, CreateIntegrationModel Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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) + * 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) + * @param createIntegrationModel (required) * @return IntegrationModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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); + 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) + * 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) + * @param createIntegrationModel (required) * @return ApiResponse<IntegrationModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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(); + 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) + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
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(); + 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call deleteIntegrationCall(UUID integrationId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -255,8 +338,11 @@ public okhttp3.Call deleteIntegrationCall(UUID integrationId, final ApiCallback Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/integrations/{integrationId}" - .replace("{" + "integrationId" + "}", localVarApiClient.escapeString(integrationId.toString())); + String localVarPath = + "/v1/integrations/{integrationId}" + .replace( + "{" + "integrationId" + "}", + localVarApiClient.escapeString(integrationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -264,67 +350,83 @@ public okhttp3.Call deleteIntegrationCall(UUID integrationId, final ApiCallback Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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. + * 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 + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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); @@ -332,22 +434,25 @@ public ApiResponse deleteIntegrationWithHttpInfo(UUID integrationId) throw } /** - * Delete Integration (asynchronously) - * This endpoint removes a Integration identified by the `integrationId` parameter. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call deleteIntegrationAsync( + UUID integrationId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = deleteIntegrationValidateBeforeCall(integrationId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); @@ -355,28 +460,30 @@ public okhttp3.Call deleteIntegrationAsync(UUID integrationId, final ApiCallback } /** * 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getIntegrationCall(UUID integrationId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -385,8 +492,11 @@ public okhttp3.Call getIntegrationCall(UUID integrationId, final ApiCallback _ca Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/integrations/{integrationId}" - .replace("{" + "integrationId" + "}", localVarApiClient.escapeString(integrationId.toString())); + String localVarPath = + "/v1/integrations/{integrationId}" + .replace( + "{" + "integrationId" + "}", + localVarApiClient.escapeString(integrationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -394,50 +504,63 @@ public okhttp3.Call getIntegrationCall(UUID integrationId, final ApiCallback _ca Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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`. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); @@ -445,73 +568,81 @@ public IntegrationModel getIntegration(UUID integrationId) throws ApiException { } /** - * Get Integration - * This endpoint returns the metadata of an Integration identified by the `integrationId`. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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 { + public ApiResponse getIntegrationWithHttpInfo(UUID integrationId) + throws ApiException { okhttp3.Call localVarCall = getIntegrationValidateBeforeCall(integrationId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + 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`. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getIntegrationAsync( + UUID integrationId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getIntegrationValidateBeforeCall(integrationId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getIntegrationsCall(UUID productId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -520,8 +651,11 @@ public okhttp3.Call getIntegrationsCall(UUID productId, final ApiCallback _callb Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/products/{productId}/integrations" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + String localVarPath = + "/v1/products/{productId}/integrations" + .replace( + "{" + "productId" + "}", + localVarApiClient.escapeString(productId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -529,50 +663,64 @@ public okhttp3.Call getIntegrationsCall(UUID productId, final ApiCallback _callb Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); @@ -580,74 +728,87 @@ public IntegrationsModel getIntegrations(UUID productId) throws ApiException { } /** - * 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public ApiResponse getIntegrationsWithHttpInfo(UUID productId) + throws ApiException { okhttp3.Call localVarCall = getIntegrationsValidateBeforeCall(productId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getIntegrationsAsync( + UUID productId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getIntegrationsValidateBeforeCall(productId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + 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 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call updateIntegrationCall( + UUID integrationId, + ModifyIntegrationRequest modifyIntegrationRequest, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -656,8 +817,11 @@ public okhttp3.Call updateIntegrationCall(UUID integrationId, ModifyIntegrationR Object localVarPostBody = modifyIntegrationRequest; // create path and map variables - String localVarPath = "/v1/integrations/{integrationId}" - .replace("{" + "integrationId" + "}", localVarApiClient.escapeString(integrationId.toString())); + String localVarPath = + "/v1/integrations/{integrationId}" + .replace( + "{" + "integrationId" + "}", + localVarApiClient.escapeString(integrationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -665,108 +829,187 @@ public okhttp3.Call updateIntegrationCall(UUID integrationId, ModifyIntegrationR Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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) + * 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) + * @param modifyIntegrationRequest (required) * @return IntegrationModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); + 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) + * 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) + * @param modifyIntegrationRequest (required) * @return ApiResponse<IntegrationModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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) + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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 index 5868484..1bba549 100644 --- a/src/main/java/com/configcat/publicapi/java/client/api/MeApi.java +++ b/src/main/java/com/configcat/publicapi/java/client/api/MeApi.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,25 +10,17 @@ * 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 com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; @@ -74,25 +66,26 @@ public void setCustomBaseUrl(String 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. -
+ * + * + * + * + *
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[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -109,42 +102,51 @@ public okhttp3.Call getMeCall(final ApiCallback _callback) throws ApiException { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 + * @throws ApiException If 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. -
+ * + * + * + * + *
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(); @@ -153,39 +155,41 @@ public MeModel getMe() throws ApiException { /** * 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 + * @throws ApiException If 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. -
+ * + * + * + * + *
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(); + 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 + * @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. -
+ * + * + * + * + *
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(); + 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 index 6121b7c..231b52d 100644 --- a/src/main/java/com/configcat/publicapi/java/client/api/MembersApi.java +++ b/src/main/java/com/configcat/publicapi/java/client/api/MembersApi.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,37 +10,29 @@ * 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 com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; public class MembersApi { private ApiClient localVarApiClient; @@ -81,30 +73,36 @@ public void setCustomBaseUrl(String 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 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call addMemberToGroupCall( + UUID organizationId, + String userId, + UpdateMemberPermissionsRequest updateMemberPermissionsRequest, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -113,9 +111,14 @@ public okhttp3.Call addMemberToGroupCall(UUID organizationId, String userId, Upd 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())); + 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(); @@ -123,138 +126,185 @@ public okhttp3.Call addMemberToGroupCall(UUID organizationId, String userId, Upd Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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)"); + throw new ApiException( + "Missing the required parameter 'updateMemberPermissionsRequest' when calling" + + " addMemberToGroup(Async)"); } - return addMemberToGroupCall(organizationId, userId, updateMemberPermissionsRequest, _callback); - + 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + 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. + * 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) + * @param updateMemberPermissionsRequest (required) * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); + 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. + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
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); + 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call deleteInvitationCall(UUID invitationId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -263,8 +313,11 @@ public okhttp3.Call deleteInvitationCall(UUID invitationId, final ApiCallback _c Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/invitations/{invitationId}" - .replace("{" + "invitationId" + "}", localVarApiClient.escapeString(invitationId.toString())); + String localVarPath = + "/v1/invitations/{invitationId}" + .replace( + "{" + "invitationId" + "}", + localVarApiClient.escapeString(invitationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -272,67 +325,83 @@ public okhttp3.Call deleteInvitationCall(UUID invitationId, final ApiCallback _c Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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. + * 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 + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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); @@ -340,22 +409,25 @@ public ApiResponse deleteInvitationWithHttpInfo(UUID invitationId) throws } /** - * Delete Invitation (asynchronously) - * This endpoint removes an Invitation identified by the `invitationId` parameter. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call deleteInvitationAsync(UUID invitationId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = deleteInvitationValidateBeforeCall(invitationId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); @@ -363,29 +435,31 @@ public okhttp3.Call deleteInvitationAsync(UUID invitationId, final ApiCallback - 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. - - + * + * + * + * + * + * + *
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 { + public okhttp3.Call deleteOrganizationMemberCall( + UUID organizationId, String userId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -394,9 +468,14 @@ public okhttp3.Call deleteOrganizationMemberCall(UUID organizationId, String use 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())); + 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(); @@ -404,128 +483,158 @@ public okhttp3.Call deleteOrganizationMemberCall(UUID organizationId, String use Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - }; + 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); + 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); + 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 { + 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)"); + 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)"); + 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. + * 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 + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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. + * 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 + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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); + 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call deleteOrganizationMemberAsync( + UUID organizationId, String userId, final ApiCallback _callback) + throws ApiException { - okhttp3.Call localVarCall = deleteOrganizationMemberValidateBeforeCall(organizationId, userId, _callback); + 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call deleteProductMemberCall( + UUID productId, String userId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -534,9 +643,14 @@ public okhttp3.Call deleteProductMemberCall(UUID productId, String userId, final 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())); + 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(); @@ -544,129 +658,155 @@ public okhttp3.Call deleteProductMemberCall(UUID productId, String userId, final Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - }; + 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); + 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); + 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 { + 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)"); + 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)"); + 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. + * 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 + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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. + * 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 + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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 { + 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call deleteProductMemberAsync( + UUID productId, String userId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteProductMemberValidateBeforeCall(productId, userId, _callback); + 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getOrganizationMembersCall(UUID organizationId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -675,8 +815,11 @@ public okhttp3.Call getOrganizationMembersCall(UUID organizationId, final ApiCal Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/organizations/{organizationId}/members" - .replace("{" + "organizationId" + "}", localVarApiClient.escapeString(organizationId.toString())); + String localVarPath = + "/v1/organizations/{organizationId}/members" + .replace( + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -684,131 +827,172 @@ public okhttp3.Call getOrganizationMembersCall(UUID organizationId, final ApiCal Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public ApiResponse> getOrganizationMembersWithHttpInfo(UUID organizationId) + throws ApiException { okhttp3.Call localVarCall = getOrganizationMembersValidateBeforeCall(organizationId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getOrganizationMembersAsync( + UUID organizationId, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = getOrganizationMembersValidateBeforeCall(organizationId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getOrganizationMembersV2Call( + UUID organizationId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -817,8 +1001,11 @@ public okhttp3.Call getOrganizationMembersV2Call(UUID organizationId, final ApiC Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v2/organizations/{organizationId}/members" - .replace("{" + "organizationId" + "}", localVarApiClient.escapeString(organizationId.toString())); + String localVarPath = + "/v2/organizations/{organizationId}/members" + .replace( + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -826,124 +1013,165 @@ public okhttp3.Call getOrganizationMembersV2Call(UUID organizationId, final ApiC Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getOrganizationMembersV2Async( + UUID organizationId, final ApiCallback _callback) + throws ApiException { - okhttp3.Call localVarCall = getOrganizationMembersV2ValidateBeforeCall(organizationId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getPendingInvitationsCall(UUID productId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -952,8 +1180,11 @@ public okhttp3.Call getPendingInvitationsCall(UUID productId, final ApiCallback Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/products/{productId}/invitations" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + String localVarPath = + "/v1/products/{productId}/invitations" + .replace( + "{" + "productId" + "}", + localVarApiClient.escapeString(productId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -961,124 +1192,148 @@ public okhttp3.Call getPendingInvitationsCall(UUID productId, final ApiCallback Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public ApiResponse> getPendingInvitationsWithHttpInfo(UUID productId) + throws ApiException { okhttp3.Call localVarCall = getPendingInvitationsValidateBeforeCall(productId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getPendingInvitationsAsync( + UUID productId, final ApiCallback> _callback) + throws ApiException { okhttp3.Call localVarCall = getPendingInvitationsValidateBeforeCall(productId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getPendingInvitationsOrgCall( + UUID organizationId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1087,8 +1342,11 @@ public okhttp3.Call getPendingInvitationsOrgCall(UUID organizationId, final ApiC Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/organizations/{organizationId}/invitations" - .replace("{" + "organizationId" + "}", localVarApiClient.escapeString(organizationId.toString())); + String localVarPath = + "/v1/organizations/{organizationId}/invitations" + .replace( + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1096,124 +1354,153 @@ public okhttp3.Call getPendingInvitationsOrgCall(UUID organizationId, final ApiC Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getPendingInvitationsOrgAsync( + UUID organizationId, final ApiCallback> _callback) + throws ApiException { - okhttp3.Call localVarCall = getPendingInvitationsOrgValidateBeforeCall(organizationId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getProductMembersCall(UUID productId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1222,8 +1509,11 @@ public okhttp3.Call getProductMembersCall(UUID productId, final ApiCallback _cal Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/products/{productId}/members" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + String localVarPath = + "/v1/products/{productId}/members" + .replace( + "{" + "productId" + "}", + localVarApiClient.escapeString(productId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1231,50 +1521,63 @@ public okhttp3.Call getProductMembersCall(UUID productId, final ApiCallback _cal Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); @@ -1282,74 +1585,83 @@ public List getProductMembers(UUID productId) throws ApiException { } /** - * List Product Members - * This endpoint returns the list of Members that belongs to the given Product, identified by the `productId` parameter. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public ApiResponse> getProductMembersWithHttpInfo(UUID productId) + throws ApiException { okhttp3.Call localVarCall = getProductMembersValidateBeforeCall(productId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getProductMembersAsync( + UUID productId, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = getProductMembersValidateBeforeCall(productId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call inviteMemberCall( + UUID productId, InviteMembersRequest inviteMembersRequest, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1358,8 +1670,11 @@ public okhttp3.Call inviteMemberCall(UUID productId, InviteMembersRequest invite Object localVarPostBody = inviteMembersRequest; // create path and map variables - String localVarPath = "/v1/products/{productId}/members/invite" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + String localVarPath = + "/v1/products/{productId}/members/invite" + .replace( + "{" + "productId" + "}", + localVarApiClient.escapeString(productId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1367,103 +1682,130 @@ public okhttp3.Call inviteMemberCall(UUID productId, InviteMembersRequest invite Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + 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. + * 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) + * @param inviteMembersRequest (required) * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); + 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. + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
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); + 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 index 2db33b1..0f8b8de 100644 --- a/src/main/java/com/configcat/publicapi/java/client/api/OrganizationsApi.java +++ b/src/main/java/com/configcat/publicapi/java/client/api/OrganizationsApi.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,25 +10,17 @@ * 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 com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; @@ -74,25 +66,26 @@ public void setCustomBaseUrl(String 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. -
+ * + * + * + * + *
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[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -109,42 +102,53 @@ public okhttp3.Call getOrganizationsCall(final ApiCallback _callback) throws Api Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + *
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(); @@ -152,40 +156,45 @@ public List getOrganizations() throws ApiException { } /** - * List Organizations - * This endpoint returns the list of the Organizations that belongs to the user. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + *
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(); + 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. + * 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 + * @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. -
+ * + * + * + * + *
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 { + public okhttp3.Call getOrganizationsAsync(final ApiCallback> _callback) + throws ApiException { okhttp3.Call localVarCall = getOrganizationsValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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 index ac65669..1e12a03 100644 --- a/src/main/java/com/configcat/publicapi/java/client/api/PermissionGroupsApi.java +++ b/src/main/java/com/configcat/publicapi/java/client/api/PermissionGroupsApi.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,33 +10,25 @@ * 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 com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; public class PermissionGroupsApi { private ApiClient localVarApiClient; @@ -77,29 +69,34 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for createPermissionGroup + * * @param productId The identifier of the Product. (required) - * @param createPermissionGroupRequest (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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call createPermissionGroupCall( + UUID productId, + CreatePermissionGroupRequest createPermissionGroupRequest, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -108,8 +105,11 @@ public okhttp3.Call createPermissionGroupCall(UUID productId, CreatePermissionGr Object localVarPostBody = createPermissionGroupRequest; // create path and map variables - String localVarPath = "/v1/products/{productId}/permissions" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + String localVarPath = + "/v1/products/{productId}/permissions" + .replace( + "{" + "productId" + "}", + localVarApiClient.escapeString(productId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -117,135 +117,174 @@ public okhttp3.Call createPermissionGroupCall(UUID productId, CreatePermissionGr Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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. + * 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) + * @param createPermissionGroupRequest (required) * @return PermissionGroupModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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); + 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. + * 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) + * @param createPermissionGroupRequest (required) * @return ApiResponse<PermissionGroupModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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(); + 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. + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
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(); + 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call deletePermissionGroupCall( + Long permissionGroupId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -254,8 +293,11 @@ public okhttp3.Call deletePermissionGroupCall(Long permissionGroupId, final ApiC Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/permissions/{permissionGroupId}" - .replace("{" + "permissionGroupId" + "}", localVarApiClient.escapeString(permissionGroupId.toString())); + String localVarPath = + "/v1/permissions/{permissionGroupId}" + .replace( + "{" + "permissionGroupId" + "}", + localVarApiClient.escapeString(permissionGroupId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -263,119 +305,143 @@ public okhttp3.Call deletePermissionGroupCall(Long permissionGroupId, final ApiC Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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. + * 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 + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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); + 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call deletePermissionGroupAsync( + Long permissionGroupId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deletePermissionGroupValidateBeforeCall(permissionGroupId, _callback); + 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getPermissionGroupCall(Long permissionGroupId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -384,8 +450,11 @@ public okhttp3.Call getPermissionGroupCall(Long permissionGroupId, final ApiCall Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/permissions/{permissionGroupId}" - .replace("{" + "permissionGroupId" + "}", localVarApiClient.escapeString(permissionGroupId.toString())); + String localVarPath = + "/v1/permissions/{permissionGroupId}" + .replace( + "{" + "permissionGroupId" + "}", + localVarApiClient.escapeString(permissionGroupId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -393,124 +462,148 @@ public okhttp3.Call getPermissionGroupCall(Long permissionGroupId, final ApiCall Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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`. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); + ApiResponse localVarResp = + getPermissionGroupWithHttpInfo(permissionGroupId); return localVarResp.getData(); } /** - * Get Permission Group - * This endpoint returns the metadata of a Permission Group identified by the `permissionGroupId`. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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 { + public ApiResponse getPermissionGroupWithHttpInfo(Long permissionGroupId) + throws ApiException { okhttp3.Call localVarCall = getPermissionGroupValidateBeforeCall(permissionGroupId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + 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`. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getPermissionGroupAsync( + Long permissionGroupId, final ApiCallback _callback) + throws ApiException { - okhttp3.Call localVarCall = getPermissionGroupValidateBeforeCall(permissionGroupId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getPermissionGroupsCall(UUID productId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -519,8 +612,11 @@ public okhttp3.Call getPermissionGroupsCall(UUID productId, final ApiCallback _c Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/products/{productId}/permissions" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + String localVarPath = + "/v1/products/{productId}/permissions" + .replace( + "{" + "productId" + "}", + localVarApiClient.escapeString(productId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -528,125 +624,154 @@ public okhttp3.Call getPermissionGroupsCall(UUID productId, final ApiCallback _c Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public ApiResponse> getPermissionGroupsWithHttpInfo(UUID productId) + throws ApiException { okhttp3.Call localVarCall = getPermissionGroupsValidateBeforeCall(productId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getPermissionGroupsAsync( + UUID productId, final ApiCallback> _callback) + throws ApiException { okhttp3.Call localVarCall = getPermissionGroupsValidateBeforeCall(productId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call updatePermissionGroupCall( + Long permissionGroupId, + UpdatePermissionGroupRequest updatePermissionGroupRequest, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -655,8 +780,11 @@ public okhttp3.Call updatePermissionGroupCall(Long permissionGroupId, UpdatePerm Object localVarPostBody = updatePermissionGroupRequest; // create path and map variables - String localVarPath = "/v1/permissions/{permissionGroupId}" - .replace("{" + "permissionGroupId" + "}", localVarApiClient.escapeString(permissionGroupId.toString())); + String localVarPath = + "/v1/permissions/{permissionGroupId}" + .replace( + "{" + "permissionGroupId" + "}", + localVarApiClient.escapeString(permissionGroupId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -664,108 +792,143 @@ public okhttp3.Call updatePermissionGroupCall(Long permissionGroupId, UpdatePerm Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + throw new ApiException( + "Missing the required parameter 'updatePermissionGroupRequest' when calling" + + " updatePermissionGroup(Async)"); } - return updatePermissionGroupCall(permissionGroupId, updatePermissionGroupRequest, _callback); - + return updatePermissionGroupCall( + permissionGroupId, updatePermissionGroupRequest, _callback); } /** - * Update Permission Group - * This endpoint updates a Permission Group identified by the `permissionGroupId` parameter. + * 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) + * @param updatePermissionGroupRequest (required) * @return PermissionGroupModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); + 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. + * 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) + * @param updatePermissionGroupRequest (required) * @return ApiResponse<PermissionGroupModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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. + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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 index d48b4a6..f47d04e 100644 --- a/src/main/java/com/configcat/publicapi/java/client/api/ProductsApi.java +++ b/src/main/java/com/configcat/publicapi/java/client/api/ProductsApi.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,35 +10,27 @@ * 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 com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; public class ProductsApi { private ApiClient localVarApiClient; @@ -79,29 +71,34 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for createProduct + * * @param organizationId The identifier of the Organization. (required) - * @param createProductRequest (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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call createProductCall( + UUID organizationId, + CreateProductRequest createProductRequest, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -110,8 +107,11 @@ public okhttp3.Call createProductCall(UUID organizationId, CreateProductRequest Object localVarPostBody = createProductRequest; // create path and map variables - String localVarPath = "/v1/organizations/{organizationId}/products" - .replace("{" + "organizationId" + "}", localVarApiClient.escapeString(organizationId.toString())); + String localVarPath = + "/v1/organizations/{organizationId}/products" + .replace( + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -119,135 +119,170 @@ public okhttp3.Call createProductCall(UUID organizationId, CreateProductRequest Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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. + * 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) + * @param createProductRequest (required) * @return ProductModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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); + 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. + * 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) + * @param createProductRequest (required) * @return ApiResponse<ProductModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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(); + 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. + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
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(); + 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call deleteProductCall(UUID productId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -256,8 +291,11 @@ public okhttp3.Call deleteProductCall(UUID productId, final ApiCallback _callbac Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/products/{productId}" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + String localVarPath = + "/v1/products/{productId}" + .replace( + "{" + "productId" + "}", + localVarApiClient.escapeString(productId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -265,67 +303,82 @@ public okhttp3.Call deleteProductCall(UUID productId, final ApiCallback _callbac Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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. + * 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 + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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); @@ -333,22 +386,25 @@ public ApiResponse deleteProductWithHttpInfo(UUID productId) throws ApiExc } /** - * Delete Product (asynchronously) - * This endpoint removes a Product identified by the `productId` parameter. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call deleteProductAsync(UUID productId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = deleteProductValidateBeforeCall(productId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); @@ -356,28 +412,30 @@ public okhttp3.Call deleteProductAsync(UUID productId, final ApiCallback _ } /** * 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getProductCall(UUID productId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -386,8 +444,11 @@ public okhttp3.Call getProductCall(UUID productId, final ApiCallback _callback) Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/products/{productId}" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + String localVarPath = + "/v1/products/{productId}" + .replace( + "{" + "productId" + "}", + localVarApiClient.escapeString(productId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -395,50 +456,62 @@ public okhttp3.Call getProductCall(UUID productId, final ApiCallback _callback) Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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`. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); @@ -446,73 +519,80 @@ public ProductModel getProduct(UUID productId) throws ApiException { } /** - * Get Product - * This endpoint returns the metadata of a Product identified by the `productId`. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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(); + 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`. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getProductAsync(UUID productId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = getProductValidateBeforeCall(productId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getProductPreferencesCall(UUID productId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -521,8 +601,11 @@ public okhttp3.Call getProductPreferencesCall(UUID productId, final ApiCallback Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/products/{productId}/preferences" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + String localVarPath = + "/v1/products/{productId}/preferences" + .replace( + "{" + "productId" + "}", + localVarApiClient.escapeString(productId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -530,50 +613,63 @@ public okhttp3.Call getProductPreferencesCall(UUID productId, final ApiCallback Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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`. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); @@ -581,70 +677,77 @@ public PreferencesModel getProductPreferences(UUID productId) throws ApiExceptio } /** - * Get Product Preferences - * This endpoint returns the preferences of a Product identified by the `productId`. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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 { + public ApiResponse getProductPreferencesWithHttpInfo(UUID productId) + throws ApiException { okhttp3.Call localVarCall = getProductPreferencesValidateBeforeCall(productId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + 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`. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getProductPreferencesAsync( + UUID productId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getProductPreferencesValidateBeforeCall(productId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + 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. -
+ * + * + * + * + *
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[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -661,42 +764,52 @@ public okhttp3.Call getProductsCall(final ApiCallback _callback) throws ApiExcep Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + *
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(); @@ -704,68 +817,75 @@ public List getProducts() throws ApiException { } /** - * List Products - * This endpoint returns the list of the Products that belongs to the user. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + *
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(); + 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. + * 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 + * @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. -
+ * + * + * + * + *
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 { + public okhttp3.Call getProductsAsync(final ApiCallback> _callback) + throws ApiException { okhttp3.Call localVarCall = getProductsValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call updateProductCall( + UUID productId, UpdateProductRequest updateProductRequest, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -774,8 +894,11 @@ public okhttp3.Call updateProductCall(UUID productId, UpdateProductRequest updat Object localVarPostBody = updateProductRequest; // create path and map variables - String localVarPath = "/v1/products/{productId}" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + String localVarPath = + "/v1/products/{productId}" + .replace( + "{" + "productId" + "}", + localVarApiClient.escapeString(productId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -783,136 +906,168 @@ public okhttp3.Call updateProductCall(UUID productId, UpdateProductRequest updat Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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. + * Update Product This endpoint updates a Product identified by the `productId` + * parameter. + * * @param productId The identifier of the Product. (required) - * @param updateProductRequest (required) + * @param updateProductRequest (required) * @return ProductModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); + 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. + * Update Product This endpoint updates a Product identified by the `productId` + * parameter. + * * @param productId The identifier of the Product. (required) - * @param updateProductRequest (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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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. + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call updateProductPreferencesCall( + UUID productId, + UpdatePreferencesRequest updatePreferencesRequest, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -921,8 +1076,11 @@ public okhttp3.Call updateProductPreferencesCall(UUID productId, UpdatePreferenc Object localVarPostBody = updatePreferencesRequest; // create path and map variables - String localVarPath = "/v1/products/{productId}/preferences" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + String localVarPath = + "/v1/products/{productId}/preferences" + .replace( + "{" + "productId" + "}", + localVarApiClient.escapeString(productId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -930,108 +1088,140 @@ public okhttp3.Call updateProductPreferencesCall(UUID productId, UpdatePreferenc Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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. + * 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) + * @param updatePreferencesRequest (required) * @return PreferencesModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); + 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. + * 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) + * @param updatePreferencesRequest (required) * @return ApiResponse<PreferencesModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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(); + 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. + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
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(); + 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 index 7de5cac..4a892b6 100644 --- a/src/main/java/com/configcat/publicapi/java/client/api/SdkKeysApi.java +++ b/src/main/java/com/configcat/publicapi/java/client/api/SdkKeysApi.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,31 +10,23 @@ * 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 com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; public class SdkKeysApi { private ApiClient localVarApiClient; @@ -75,29 +67,31 @@ public void setCustomBaseUrl(String 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getSdkKeysCall( + UUID configId, UUID environmentId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -106,9 +100,14 @@ public okhttp3.Call getSdkKeysCall(UUID configId, UUID environmentId, final ApiC 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())); + 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(); @@ -116,56 +115,69 @@ public okhttp3.Call getSdkKeysCall(UUID configId, UUID environmentId, final ApiC Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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)"); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); @@ -173,48 +185,55 @@ public SdkKeysModel getSdkKeys(UUID configId, UUID environmentId) throws ApiExce } /** - * Get SDK Key - * This endpoint returns the SDK Key for your Config in a specified Environment. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public ApiResponse getSdkKeysWithHttpInfo(UUID configId, UUID environmentId) + throws ApiException { okhttp3.Call localVarCall = getSdkKeysValidateBeforeCall(configId, environmentId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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 { + 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(); + 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 index 5057acc..7281802 100644 --- a/src/main/java/com/configcat/publicapi/java/client/api/SegmentsApi.java +++ b/src/main/java/com/configcat/publicapi/java/client/api/SegmentsApi.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,34 +10,26 @@ * 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 com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; public class SegmentsApi { private ApiClient localVarApiClient; @@ -78,29 +70,32 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for createSegment + * * @param productId The identifier of the Product. (required) - * @param createSegmentModel (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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call createSegmentCall( + UUID productId, CreateSegmentModel createSegmentModel, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -109,8 +104,11 @@ public okhttp3.Call createSegmentCall(UUID productId, CreateSegmentModel createS Object localVarPostBody = createSegmentModel; // create path and map variables - String localVarPath = "/v1/products/{productId}/segments" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + String localVarPath = + "/v1/products/{productId}/segments" + .replace( + "{" + "productId" + "}", + localVarApiClient.escapeString(productId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -118,135 +116,167 @@ public okhttp3.Call createSegmentCall(UUID productId, CreateSegmentModel createS Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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. + * 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) + * @param createSegmentModel (required) * @return SegmentModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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); + 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. + * 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) + * @param createSegmentModel (required) * @return ApiResponse<SegmentModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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(); + 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. + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
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(); + 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call deleteSegmentCall(UUID segmentId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -255,8 +285,11 @@ public okhttp3.Call deleteSegmentCall(UUID segmentId, final ApiCallback _callbac Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/segments/{segmentId}" - .replace("{" + "segmentId" + "}", localVarApiClient.escapeString(segmentId.toString())); + String localVarPath = + "/v1/segments/{segmentId}" + .replace( + "{" + "segmentId" + "}", + localVarApiClient.escapeString(segmentId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -264,67 +297,82 @@ public okhttp3.Call deleteSegmentCall(UUID segmentId, final ApiCallback _callbac Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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. + * 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 + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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); @@ -332,22 +380,25 @@ public ApiResponse deleteSegmentWithHttpInfo(UUID segmentId) throws ApiExc } /** - * Delete Segment (asynchronously) - * This endpoint removes a Segment identified by the `segmentId` parameter. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call deleteSegmentAsync(UUID segmentId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = deleteSegmentValidateBeforeCall(segmentId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); @@ -355,28 +406,30 @@ public okhttp3.Call deleteSegmentAsync(UUID segmentId, final ApiCallback _ } /** * 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getSegmentCall(UUID segmentId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -385,8 +438,11 @@ public okhttp3.Call getSegmentCall(UUID segmentId, final ApiCallback _callback) Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/segments/{segmentId}" - .replace("{" + "segmentId" + "}", localVarApiClient.escapeString(segmentId.toString())); + String localVarPath = + "/v1/segments/{segmentId}" + .replace( + "{" + "segmentId" + "}", + localVarApiClient.escapeString(segmentId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -394,50 +450,62 @@ public okhttp3.Call getSegmentCall(UUID segmentId, final ApiCallback _callback) Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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`. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); @@ -445,73 +513,80 @@ public SegmentModel getSegment(UUID segmentId) throws ApiException { } /** - * Get Segment - * This endpoint returns the metadata of a Segment identified by the `segmentId`. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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(); + 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`. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getSegmentAsync(UUID segmentId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = getSegmentValidateBeforeCall(segmentId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getSegmentsCall(UUID productId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -520,8 +595,11 @@ public okhttp3.Call getSegmentsCall(UUID productId, final ApiCallback _callback) Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/products/{productId}/segments" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + String localVarPath = + "/v1/products/{productId}/segments" + .replace( + "{" + "productId" + "}", + localVarApiClient.escapeString(productId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -529,50 +607,63 @@ public okhttp3.Call getSegmentsCall(UUID productId, final ApiCallback _callback) Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); @@ -580,74 +671,86 @@ public List getSegments(UUID productId) throws ApiException { } /** - * 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public ApiResponse> getSegmentsWithHttpInfo(UUID productId) + throws ApiException { okhttp3.Call localVarCall = getSegmentsValidateBeforeCall(productId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call getSegmentsAsync( + UUID productId, final ApiCallback> _callback) + throws ApiException { okhttp3.Call localVarCall = getSegmentsValidateBeforeCall(productId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call updateSegmentCall( + UUID segmentId, UpdateSegmentModel updateSegmentModel, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -656,8 +759,11 @@ public okhttp3.Call updateSegmentCall(UUID segmentId, UpdateSegmentModel updateS Object localVarPostBody = updateSegmentModel; // create path and map variables - String localVarPath = "/v1/segments/{segmentId}" - .replace("{" + "segmentId" + "}", localVarApiClient.escapeString(segmentId.toString())); + String localVarPath = + "/v1/segments/{segmentId}" + .replace( + "{" + "segmentId" + "}", + localVarApiClient.escapeString(segmentId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -665,108 +771,135 @@ public okhttp3.Call updateSegmentCall(UUID segmentId, UpdateSegmentModel updateS Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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. + * Update Segment This endpoint updates a Segment identified by the `segmentId` + * parameter. + * * @param segmentId The identifier of the Segment. (required) - * @param updateSegmentModel (required) + * @param updateSegmentModel (required) * @return SegmentModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); + 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. + * Update Segment This endpoint updates a Segment identified by the `segmentId` + * parameter. + * * @param segmentId The identifier of the Segment. (required) - * @param updateSegmentModel (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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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. + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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(); + 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 index 6f7b523..23b1b80 100644 --- a/src/main/java/com/configcat/publicapi/java/client/api/TagsApi.java +++ b/src/main/java/com/configcat/publicapi/java/client/api/TagsApi.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,34 +10,26 @@ * 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 com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; public class TagsApi { private ApiClient localVarApiClient; @@ -78,29 +70,32 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for createTag + * * @param productId The identifier of the Organization. (required) - * @param createTagModel (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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call createTagCall( + UUID productId, CreateTagModel createTagModel, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -109,8 +104,11 @@ public okhttp3.Call createTagCall(UUID productId, CreateTagModel createTagModel, Object localVarPostBody = createTagModel; // create path and map variables - String localVarPath = "/v1/products/{productId}/tags" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + String localVarPath = + "/v1/products/{productId}/tags" + .replace( + "{" + "productId" + "}", + localVarApiClient.escapeString(productId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -118,59 +116,74 @@ public okhttp3.Call createTagCall(UUID productId, CreateTagModel createTagModel, Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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. + * 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) + * @param createTagModel (required) * @return TagModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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); @@ -178,75 +191,86 @@ public TagModel createTag(UUID productId, CreateTagModel createTagModel) throws } /** - * 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. + * 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) + * @param createTagModel (required) * @return ApiResponse<TagModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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 { + public ApiResponse createTagWithHttpInfo( + UUID productId, CreateTagModel createTagModel) throws ApiException { okhttp3.Call localVarCall = createTagValidateBeforeCall(productId, createTagModel, null); - Type localVarReturnType = new TypeToken(){}.getType(); + 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. + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + 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(); + 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. -
+ * + * + * + * + * + * + *
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[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -255,8 +279,11 @@ public okhttp3.Call deleteTagCall(Long tagId, final ApiCallback _callback) throw Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/tags/{tagId}" - .replace("{" + "tagId" + "}", localVarApiClient.escapeString(tagId.toString())); + String localVarPath = + "/v1/tags/{tagId}" + .replace( + "{" + "tagId" + "}", + localVarApiClient.escapeString(tagId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -264,67 +291,84 @@ public okhttp3.Call deleteTagCall(Long tagId, final ApiCallback _callback) throw Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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. + * 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 + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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); @@ -332,22 +376,26 @@ public ApiResponse deleteTagWithHttpInfo(Long tagId) throws ApiException { } /** - * 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call deleteTagAsync(Long tagId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = deleteTagValidateBeforeCall(tagId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); @@ -355,28 +403,30 @@ public okhttp3.Call deleteTagAsync(Long tagId, final ApiCallback _callback } /** * 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getSettingsByTagCall(Long tagId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -385,8 +435,11 @@ public okhttp3.Call getSettingsByTagCall(Long tagId, final ApiCallback _callback Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/tags/{tagId}/settings" - .replace("{" + "tagId" + "}", localVarApiClient.escapeString(tagId.toString())); + String localVarPath = + "/v1/tags/{tagId}/settings" + .replace( + "{" + "tagId" + "}", + localVarApiClient.escapeString(tagId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -394,50 +447,62 @@ public okhttp3.Call getSettingsByTagCall(Long tagId, final ApiCallback _callback Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); @@ -445,73 +510,80 @@ public List getSettingsByTag(Long tagId) throws ApiException { } /** - * List Settings by Tag - * This endpoint returns the list of the Settings that has the specified Tag, identified by the `tagId` parameter. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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 { + public ApiResponse> getSettingsByTagWithHttpInfo(Long tagId) + throws ApiException { okhttp3.Call localVarCall = getSettingsByTagValidateBeforeCall(tagId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getSettingsByTagAsync( + Long tagId, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = getSettingsByTagValidateBeforeCall(tagId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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. -
+ * + * + * + * + * + * + *
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[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -520,8 +592,11 @@ public okhttp3.Call getTagCall(Long tagId, final ApiCallback _callback) throws A Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/tags/{tagId}" - .replace("{" + "tagId" + "}", localVarApiClient.escapeString(tagId.toString())); + String localVarPath = + "/v1/tags/{tagId}" + .replace( + "{" + "tagId" + "}", + localVarApiClient.escapeString(tagId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -529,50 +604,61 @@ public okhttp3.Call getTagCall(Long tagId, final ApiCallback _callback) throws A Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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`. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); @@ -580,71 +666,77 @@ public TagModel getTag(Long tagId) throws ApiException { } /** - * Get Tag - * This endpoint returns the metadata of a Tag identified by the `tagId`. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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(); + 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`. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getTagAsync(Long tagId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = getTagValidateBeforeCall(tagId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + 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. -
+ * + * + * + * + *
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 { + public okhttp3.Call getTagsCall(UUID productId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -653,8 +745,11 @@ public okhttp3.Call getTagsCall(UUID productId, final ApiCallback _callback) thr Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/products/{productId}/tags" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + String localVarPath = + "/v1/products/{productId}/tags" + .replace( + "{" + "productId" + "}", + localVarApiClient.escapeString(productId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -662,48 +757,60 @@ public okhttp3.Call getTagsCall(UUID productId, final ApiCallback _callback) thr Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + *
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); @@ -711,70 +818,78 @@ public List getTags(UUID productId) throws ApiException { } /** - * List Tags - * This endpoint returns the list of the Tags in a specified Product, identified by the `productId` parameter. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + *
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(); + 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. + * 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 + * @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. -
+ * + * + * + * + *
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 { + public okhttp3.Call getTagsAsync(UUID productId, final ApiCallback> _callback) + throws ApiException { okhttp3.Call localVarCall = getTagsValidateBeforeCall(productId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public okhttp3.Call updateTagCall( + Long tagId, UpdateTagModel updateTagModel, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -783,8 +898,11 @@ public okhttp3.Call updateTagCall(Long tagId, UpdateTagModel updateTagModel, fin Object localVarPostBody = updateTagModel; // create path and map variables - String localVarPath = "/v1/tags/{tagId}" - .replace("{" + "tagId" + "}", localVarApiClient.escapeString(tagId.toString())); + String localVarPath = + "/v1/tags/{tagId}" + .replace( + "{" + "tagId" + "}", + localVarApiClient.escapeString(tagId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -792,59 +910,72 @@ public okhttp3.Call updateTagCall(Long tagId, UpdateTagModel updateTagModel, fin Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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. + * Update Tag This endpoint updates a Tag identified by the `tagId` parameter. + * * @param tagId The identifier of the Tag. (required) - * @param updateTagModel (required) + * @param updateTagModel (required) * @return TagModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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); @@ -852,48 +983,54 @@ public TagModel updateTag(Long tagId, UpdateTagModel updateTagModel) throws ApiE } /** - * Update Tag - * This endpoint updates a Tag identified by the `tagId` parameter. + * Update Tag This endpoint updates a Tag identified by the `tagId` parameter. + * * @param tagId The identifier of the Tag. (required) - * @param updateTagModel (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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
Status Code 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 { + public ApiResponse updateTagWithHttpInfo(Long tagId, UpdateTagModel updateTagModel) + throws ApiException { okhttp3.Call localVarCall = updateTagValidateBeforeCall(tagId, updateTagModel, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update Tag (asynchronously) - * This endpoint updates a Tag identified by the `tagId` parameter. + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
Status Code 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 { + 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(); + 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 index e0e4189..f09ce72 100644 --- a/src/main/java/com/configcat/publicapi/java/client/api/WebhooksApi.java +++ b/src/main/java/com/configcat/publicapi/java/client/api/WebhooksApi.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,34 +10,26 @@ * 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 com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; public class WebhooksApi { private ApiClient localVarApiClient; @@ -78,30 +70,36 @@ public void setCustomBaseUrl(String 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 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call createWebhookCall( + UUID configId, + UUID environmentId, + WebHookRequest webHookRequest, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -110,9 +108,14 @@ public okhttp3.Call createWebhookCall(UUID configId, UUID environmentId, WebHook 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())); + 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(); @@ -120,143 +123,181 @@ public okhttp3.Call createWebhookCall(UUID configId, UUID environmentId, WebHook Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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)"); + 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. + * 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) + * @param webHookRequest (required) * @return WebhookModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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); + 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. + * 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) + * @param webHookRequest (required) * @return ApiResponse<WebhookModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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(); + 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. + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
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(); + 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call deleteWebhookCall(Integer webhookId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -265,8 +306,11 @@ public okhttp3.Call deleteWebhookCall(Integer webhookId, final ApiCallback _call Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/webhooks/{webhookId}" - .replace("{" + "webhookId" + "}", localVarApiClient.escapeString(webhookId.toString())); + String localVarPath = + "/v1/webhooks/{webhookId}" + .replace( + "{" + "webhookId" + "}", + localVarApiClient.escapeString(webhookId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -274,67 +318,82 @@ public okhttp3.Call deleteWebhookCall(Integer webhookId, final ApiCallback _call Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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. + * 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 + * @throws ApiException 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. -
+ * + * + * + * + * + * + *
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); @@ -342,22 +401,25 @@ public ApiResponse deleteWebhookWithHttpInfo(Integer webhookId) throws Api } /** - * Delete Webhook (asynchronously) - * This endpoint removes a Webhook identified by the `webhookId` parameter. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call deleteWebhookAsync(Integer webhookId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = deleteWebhookValidateBeforeCall(webhookId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); @@ -365,28 +427,30 @@ public okhttp3.Call deleteWebhookAsync(Integer webhookId, final ApiCallback - 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. - - + * + * + * + * + * + * + *
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 { + public okhttp3.Call getWebhookCall(Integer webhookId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -395,8 +459,11 @@ public okhttp3.Call getWebhookCall(Integer webhookId, final ApiCallback _callbac Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/webhooks/{webhookId}" - .replace("{" + "webhookId" + "}", localVarApiClient.escapeString(webhookId.toString())); + String localVarPath = + "/v1/webhooks/{webhookId}" + .replace( + "{" + "webhookId" + "}", + localVarApiClient.escapeString(webhookId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -404,50 +471,62 @@ public okhttp3.Call getWebhookCall(Integer webhookId, final ApiCallback _callbac Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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`. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); @@ -455,73 +534,80 @@ public WebhookModel getWebhook(Integer webhookId) throws ApiException { } /** - * Get Webhook - * This endpoint returns the metadata of a Webhook identified by the `webhookId`. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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(); + 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`. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getWebhookAsync( + Integer webhookId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getWebhookValidateBeforeCall(webhookId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getWebhookSigningKeysCall(Integer webhookId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -530,8 +616,11 @@ public okhttp3.Call getWebhookSigningKeysCall(Integer webhookId, final ApiCallba Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/webhooks/{webhookId}/keys" - .replace("{" + "webhookId" + "}", localVarApiClient.escapeString(webhookId.toString())); + String localVarPath = + "/v1/webhooks/{webhookId}/keys" + .replace( + "{" + "webhookId" + "}", + localVarApiClient.escapeString(webhookId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -539,122 +628,157 @@ public okhttp3.Call getWebhookSigningKeysCall(Integer webhookId, final ApiCallba Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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 { + public ApiResponse getWebhookSigningKeysWithHttpInfo(Integer webhookId) + throws ApiException { okhttp3.Call localVarCall = getWebhookSigningKeysValidateBeforeCall(webhookId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + 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. + * 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 + * @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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call getWebhookSigningKeysAsync( + Integer webhookId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = getWebhookSigningKeysValidateBeforeCall(webhookId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + 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. -
+ * + * + * + * + *
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 { + public okhttp3.Call getWebhooksCall(UUID productId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -663,8 +787,11 @@ public okhttp3.Call getWebhooksCall(UUID productId, final ApiCallback _callback) Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/products/{productId}/webhooks" - .replace("{" + "productId" + "}", localVarApiClient.escapeString(productId.toString())); + String localVarPath = + "/v1/products/{productId}/webhooks" + .replace( + "{" + "productId" + "}", + localVarApiClient.escapeString(productId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -672,48 +799,61 @@ public okhttp3.Call getWebhooksCall(UUID productId, final ApiCallback _callback) Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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); + 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); + 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 { + 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)"); + 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + *
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); @@ -721,70 +861,81 @@ public List getWebhooks(UUID productId) throws ApiException { } /** - * 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. + * 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 + * @throws ApiException If 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. -
+ * + * + * + * + *
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 { + public ApiResponse> getWebhooksWithHttpInfo(UUID productId) + throws ApiException { okhttp3.Call localVarCall = getWebhooksValidateBeforeCall(productId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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. + * 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 + * @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. -
+ * + * + * + * + *
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 { + public okhttp3.Call getWebhooksAsync( + UUID productId, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = getWebhooksValidateBeforeCall(productId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call replaceWebhookCall( + Integer webhookId, WebHookRequest webHookRequest, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -793,8 +944,11 @@ public okhttp3.Call replaceWebhookCall(Integer webhookId, WebHookRequest webHook Object localVarPostBody = webHookRequest; // create path and map variables - String localVarPath = "/v1/webhooks/{webhookId}" - .replace("{" + "webhookId" + "}", localVarApiClient.escapeString(webhookId.toString())); + String localVarPath = + "/v1/webhooks/{webhookId}" + .replace( + "{" + "webhookId" + "}", + localVarApiClient.escapeString(webhookId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -802,136 +956,175 @@ public okhttp3.Call replaceWebhookCall(Integer webhookId, WebHookRequest webHook Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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. + * 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) + * @param webHookRequest (required) * @return WebhookModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); + 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. + * 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) + * @param webHookRequest (required) * @return ApiResponse<WebhookModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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(); + 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. + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
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(); + 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 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. -
+ * + * + * + * + * + * + *
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 { + public okhttp3.Call updateWebhookCall( + Integer webhookId, + List jsonPatchOperation, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -940,8 +1133,11 @@ public okhttp3.Call updateWebhookCall(Integer webhookId, List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -949,108 +1145,194 @@ public okhttp3.Call updateWebhookCall(Integer webhookId, List localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; + 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" + "application/json", "text/json", "application/*+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(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, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 { + 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)"); + 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)"); + 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 } ] } ``` + * 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) + * @param jsonPatchOperation (required) * @return WebhookModel - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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); + 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 } ] } ``` + * 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) + * @param jsonPatchOperation (required) * @return ApiResponse<WebhookModel> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If 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. -
+ * + * + * + * + * + * + *
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(); + 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 } ] } ``` + * 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 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 + * @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. -
+ * + * + * + * + * + * + *
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(); + 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 index 27b3b77..8780d31 100644 --- a/src/main/java/com/configcat/publicapi/java/client/auth/ApiKeyAuth.java +++ b/src/main/java/com/configcat/publicapi/java/client/auth/ApiKeyAuth.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,71 +10,79 @@ * 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; +import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } + private final String location; + private final String paramName; - public String getLocation() { - return location; - } + private String apiKey; + private String apiKeyPrefix; - public String getParamName() { - return paramName; - } + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } - public String getApiKey() { - return apiKey; - } + public String getLocation() { + return location; + } - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } + public String getParamName() { + return paramName; + } - public String getApiKeyPrefix() { - return apiKeyPrefix; - } + public String getApiKey() { + return apiKey; + } - public void setApiKeyPrefix(String apiKeyPrefix) { - this.apiKeyPrefix = apiKeyPrefix; - } + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (apiKey == null) { - return; + public String getApiKeyPrefix() { + return apiKeyPrefix; } - String value; - if (apiKeyPrefix != null) { - value = apiKeyPrefix + " " + apiKey; - } else { - value = apiKey; + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; } - 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); + + @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 index 9e0c12f..30b8a0b 100644 --- a/src/main/java/com/configcat/publicapi/java/client/auth/Authentication.java +++ b/src/main/java/com/configcat/publicapi/java/client/auth/Authentication.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,15 +10,14 @@ * 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 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; +import java.util.Map; public interface Authentication { /** @@ -32,5 +31,12 @@ public interface Authentication { * @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; + 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 index f5abe41..72db39e 100644 --- a/src/main/java/com/configcat/publicapi/java/client/auth/HttpBasicAuth.java +++ b/src/main/java/com/configcat/publicapi/java/client/auth/HttpBasicAuth.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,17 +10,15 @@ * 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 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; +import java.util.Map; +import okhttp3.Credentials; public class HttpBasicAuth implements Authentication { private String username; @@ -43,13 +41,20 @@ public void setPassword(String password) { } @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { + 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)); + 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 index 44db86e..8937ced 100644 --- a/src/main/java/com/configcat/publicapi/java/client/auth/HttpBearerAuth.java +++ b/src/main/java/com/configcat/publicapi/java/client/auth/HttpBearerAuth.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,66 +10,79 @@ * 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 = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[Etc/UTC]", + comments = "Generator version: 7.7.0") public class HttpBearerAuth implements Authentication { - private final String scheme; - private Supplier tokenSupplier; + 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(); - } + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } - /** - * 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; - } + /** + * 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 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; - } + /** + * 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; + } - @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; + /** + * 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; } - headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); - } + @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; + } - private static String upperCaseBearer(String scheme) { - return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; - } + 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 index 7ff4287..a3b9fa6 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/AbstractOpenApiSchema.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/AbstractOpenApiSchema.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,18 +10,17 @@ * 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; +import java.util.Objects; -/** - * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[Etc/UTC]", + comments = "Generator version: 7.7.0") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object @@ -50,18 +49,23 @@ public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { * * @return an instance of the actual schema/object */ - //@JsonValue - public Object getActualInstance() {return instance;} + // @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;} + 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 + * 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 */ @@ -73,7 +77,7 @@ private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { if (object.getActualInstance() == null) { return null; } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { - return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + return getActualInstanceRecursively((AbstractOpenApiSchema) object.getActualInstance()); } else { return object.getActualInstance(); } @@ -100,8 +104,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * 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) { @@ -118,9 +122,9 @@ public boolean equals(Object o) { 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); + return Objects.equals(this.instance, a.instance) + && Objects.equals(this.isNullable, a.isNullable) + && Objects.equals(this.schemaType, a.schemaType); } @Override @@ -140,7 +144,4 @@ public Boolean isNullable() { 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..9437e4b --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/AccessType.java @@ -0,0 +1,74 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** 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 index 686a705..d3ed7ee 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/AddOrUpdateIntegrationLinkModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/AddOrUpdateIntegrationLinkModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,238 +10,252 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * AddOrUpdateIntegrationLinkModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** AddOrUpdateIntegrationLinkModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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; + } + + @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); + } + + 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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AddOrUpdateIntegrationLinkModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddOrUpdateIntegrationLinkModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public AddOrUpdateIntegrationLinkModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AddOrUpdateIntegrationLinkModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddOrUpdateIntegrationLinkModel` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public AddOrUpdateIntegrationLinkModel read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 13cd45f..120b5f9 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/AddOrUpdateJiraIntegrationLinkModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/AddOrUpdateJiraIntegrationLinkModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,305 +10,335 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * AddOrUpdateJiraIntegrationLinkModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** AddOrUpdateJiraIntegrationLinkModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Get jiraJwtToken + * + * @return jiraJwtToken + */ + @javax.annotation.Nonnull + public String getJiraJwtToken() { + return jiraJwtToken; } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + public void setJiraJwtToken(String jiraJwtToken) { + this.jiraJwtToken = jiraJwtToken; } - 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("}"); - 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"; + + 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; } - 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())); + + 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; + } + + @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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AddOrUpdateJiraIntegrationLinkModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddOrUpdateJiraIntegrationLinkModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + 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); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } - // 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())); + @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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AddOrUpdateJiraIntegrationLinkModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddOrUpdateJiraIntegrationLinkModel` properties. JSON:" + + " %s", + entry.getKey(), jsonElement.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(); - elementAdapter.write(out, obj); - } - - @Override - public AddOrUpdateJiraIntegrationLinkModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public AddOrUpdateJiraIntegrationLinkModel read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); } - } - - /** - * 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); - } -} + /** + * 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 index 2491edc..be009b5 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/AuditLogItemModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/AuditLogItemModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,727 +10,583 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.time.OffsetDateTime; +import java.util.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * AuditLogItemModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** AuditLogItemModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - - /** - * Gets or Sets auditLogTypeEnum - */ - @JsonAdapter(AuditLogTypeEnumEnum.Adapter.class) - public enum AuditLogTypeEnumEnum { - 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"), - - ORGANIZATION_ADMIN_DISABLED2_FA("organizationAdminDisabled2FA"), - - 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"), - - ORGANIZATION_MEMBER_JOINED("organizationMemberJoined"), - - ORGANIZATION_MEMBER_PRODUCT_JOIN_REQUESTED("organizationMemberProductJoinRequested"), - - ORGANIZATION_MEMBER_PRODUCT_JOIN_REQUEST_REJECTED("organizationMemberProductJoinRequestRejected"), - - ORGANIZATION_MEMBER_PRODUCT_JOIN_REQUEST_APPROVED("organizationMemberProductJoinRequestApproved"), - - 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"); - - private String value; - - AuditLogTypeEnumEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; + 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; } @Override - public String toString() { - return String.valueOf(value); + 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); + } + + 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())); } - public static AuditLogTypeEnumEnum fromValue(String value) { - for (AuditLogTypeEnumEnum b : AuditLogTypeEnumEnum.values()) { - if (b.value.equals(value)) { - return b; + @Override + public int hashCode() { + return Objects.hash( + auditLogId, + auditLogDateTime, + auditLogTypeEnum, + changeSetId, + truncated, + auditLogType, + userEmail, + userName, + where, + why, + actionTarget, + details); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AuditLogTypeEnumEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } + @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("}"); + 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 "); + } - @Override - public AuditLogTypeEnumEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AuditLogTypeEnumEnum.fromValue(value); - } + 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 { - String value = jsonElement.getAsString(); - AuditLogTypeEnumEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_AUDIT_LOG_TYPE_ENUM = "auditLogTypeEnum"; - @SerializedName(SERIALIZED_NAME_AUDIT_LOG_TYPE_ENUM) - private AuditLogTypeEnumEnum 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(AuditLogTypeEnumEnum auditLogTypeEnum) { - this.auditLogTypeEnum = auditLogTypeEnum; - return this; - } - - /** - * Get auditLogTypeEnum - * @return auditLogTypeEnum - */ - @javax.annotation.Nullable - public AuditLogTypeEnumEnum getAuditLogTypeEnum() { - return auditLogTypeEnum; - } - - public void setAuditLogTypeEnum(AuditLogTypeEnumEnum 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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AuditLogItemModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AuditLogItemModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AuditLogItemModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AuditLogItemModel` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("auditLogTypeEnum") != null && !jsonObj.get("auditLogTypeEnum").isJsonNull()) && !jsonObj.get("auditLogTypeEnum").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `auditLogTypeEnum` to be a primitive type in the JSON string but got `%s`", jsonObj.get("auditLogTypeEnum").toString())); - } - // validate the optional field `auditLogTypeEnum` - if (jsonObj.get("auditLogTypeEnum") != null && !jsonObj.get("auditLogTypeEnum").isJsonNull()) { - AuditLogTypeEnumEnum.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(); - elementAdapter.write(out, obj); - } - - @Override - public AuditLogItemModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + // 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(); + elementAdapter.write(out, obj); + } + + @Override + public AuditLogItemModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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..70ce8bc --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/AuditLogType.java @@ -0,0 +1,226 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** 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"), + + 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"); + + 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 index 4ba96ba..cec7d62 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/CodeReferenceModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/CodeReferenceModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,433 +10,481 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * CodeReferenceModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** CodeReferenceModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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; + } + + @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); + } + + 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); + } + + 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("}"); + 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CodeReferenceModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CodeReferenceModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CodeReferenceModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CodeReferenceModel` properties. JSON: %s", + entry.getKey(), 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())); - } - 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("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("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(); - elementAdapter.write(out, obj); - } - - @Override - public CodeReferenceModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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(); + elementAdapter.write(out, obj); + } + + @Override + public CodeReferenceModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 4dc7256..1f7b1ef 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/CodeReferenceRequest.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/CodeReferenceRequest.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,454 +10,510 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * CodeReferenceRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** CodeReferenceRequest */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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; + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CodeReferenceRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CodeReferenceRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + 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; + } - // 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())); + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - } - 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)); - }; + 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); + } + + 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())); + } - 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(); - elementAdapter.write(out, obj); - } - - @Override - public CodeReferenceRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + public int hashCode() { + return Objects.hash( + configId, + repository, + branch, + commitUrl, + commitHash, + uploader, + activeBranches, + flagReferences); + } + + 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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CodeReferenceRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CodeReferenceRequest` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public CodeReferenceRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index bdfcc8c..e19c261 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/ComparisonValueListModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/ComparisonValueListModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,246 +10,257 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * ComparisonValueListModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** ComparisonValueListModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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; + } + + @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); + } + + 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); + } + + 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("}"); + 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ComparisonValueListModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ComparisonValueListModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ComparisonValueListModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ComparisonValueListModel` properties. JSON: %s", + entry.getKey(), jsonElement.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())); + // 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(); - elementAdapter.write(out, obj); - } - - @Override - public ComparisonValueListModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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(); + elementAdapter.write(out, obj); + } + + @Override + public ComparisonValueListModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 2c4c933..1527aa3 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/ComparisonValueModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/ComparisonValueModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,286 +10,295 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -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 = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** The value that the user object's attribute is compared to. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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<>(); + 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; } - this.listValue.add(listValueItem); - return this; - } - /** - * The list representation of the comparison value. - * @return listValue - */ - @javax.annotation.Nullable - public List getListValue() { - return listValue; - } + /** + * The string representation of the comparison value. + * + * @return stringValue + */ + @javax.annotation.Nullable + public String getStringValue() { + return stringValue; + } - public void setListValue(List listValue) { - this.listValue = listValue; - } + 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; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public void setDoubleValue(Double doubleValue) { + this.doubleValue = doubleValue; } - if (o == null || getClass() != o.getClass()) { - return false; + + public ComparisonValueModel listValue(List listValue) { + this.listValue = listValue; + return this; } - ComparisonValueModel comparisonValueModel = (ComparisonValueModel) o; - return Objects.equals(this.stringValue, comparisonValueModel.stringValue) && - Objects.equals(this.doubleValue, comparisonValueModel.doubleValue) && - Objects.equals(this.listValue, comparisonValueModel.listValue); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + public ComparisonValueModel addListValueItem(ComparisonValueListModel listValueItem) { + if (this.listValue == null) { + this.listValue = new ArrayList<>(); + } + this.listValue.add(listValueItem); + return this; } - 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("}"); - 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"; + + /** + * 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; + } + + @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); + } + + 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); + } + + 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("}"); + return sb.toString(); } - 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())); + + /** + * 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ComparisonValueModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ComparisonValueModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ComparisonValueModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ComparisonValueModel` properties. JSON: %s", + entry.getKey(), 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())); - } - 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)); - }; + 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(); - elementAdapter.write(out, obj); - } - - @Override - public ComparisonValueModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public ComparisonValueModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); - } -} + /** + * 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 index b1390d5..336fa6a 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/ConditionModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/ConditionModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,261 +10,259 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Objects; import java.util.Set; -import com.configcat.publicapi.java.client.JSON; - -/** - * ConditionModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** ConditionModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; } - if (o == null || getClass() != o.getClass()) { - return false; + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(userCondition, segmentCondition, prerequisiteFlagCondition); + } + + @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("}"); + 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 "); } - ConditionModel conditionModel = (ConditionModel) o; - return Objects.equals(this.userCondition, conditionModel.userCondition) && - Objects.equals(this.segmentCondition, conditionModel.segmentCondition) && - Objects.equals(this.prerequisiteFlagCondition, conditionModel.prerequisiteFlagCondition); - } - - @Override - public int hashCode() { - return Objects.hash(userCondition, segmentCondition, prerequisiteFlagCondition); - } - - @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("}"); - 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"; + + 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(); } - 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())); + + /** + * 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ConditionModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConditionModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ConditionModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ConditionModel` properties. JSON: %s", + entry.getKey(), jsonElement.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(); - elementAdapter.write(out, obj); - } - - @Override - public ConditionModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + // 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(); + elementAdapter.write(out, obj); + } + + @Override + public ConditionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); - } -} + /** + * 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 index 9bc4200..c50c588 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/ConfigModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/ConfigModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,439 +10,410 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * Details of the Config. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** Details of the Config. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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_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_CONFIG_ID = "configId"; - @SerializedName(SERIALIZED_NAME_CONFIG_ID) - private UUID configId; + public static final String SERIALIZED_NAME_NAME = "name"; - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String 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_DESCRIPTION = "description"; - public static final String SERIALIZED_NAME_ORDER = "order"; - @SerializedName(SERIALIZED_NAME_ORDER) - private Integer order; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; - 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_ORDER = "order"; - /** - * Determines the evaluation version of a Config. Using `v2` enables the new features of Config V2 (https://configcat.com/docs/advanced/config-v2). - */ - @JsonAdapter(EvaluationVersionEnum.Adapter.class) - public enum EvaluationVersionEnum { - V1("v1"), - - V2("v2"); + @SerializedName(SERIALIZED_NAME_ORDER) + private Integer order; - private String value; + 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; + } - EvaluationVersionEnum(String value) { - this.value = value; + /** + * Description of the Config. + * + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; } - public String getValue() { - return value; + 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; } @Override - public String toString() { - return String.valueOf(value); + 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); + } + + 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); } - public static EvaluationVersionEnum fromValue(String value) { - for (EvaluationVersionEnum b : EvaluationVersionEnum.values()) { - if (b.value.equals(value)) { - return b; + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + 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("}"); + return sb.toString(); } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final EvaluationVersionEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } + /** + * 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 "); + } - @Override - public EvaluationVersionEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return EvaluationVersionEnum.fromValue(value); - } + 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 { - String value = jsonElement.getAsString(); - EvaluationVersionEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_EVALUATION_VERSION = "evaluationVersion"; - @SerializedName(SERIALIZED_NAME_EVALUATION_VERSION) - private EvaluationVersionEnum 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(EvaluationVersionEnum evaluationVersion) { - this.evaluationVersion = evaluationVersion; - return this; - } - - /** - * Determines the evaluation version of a Config. Using `v2` enables the new features of Config V2 (https://configcat.com/docs/advanced/config-v2). - * @return evaluationVersion - */ - @javax.annotation.Nullable - public EvaluationVersionEnum getEvaluationVersion() { - return evaluationVersion; - } - - public void setEvaluationVersion(EvaluationVersionEnum evaluationVersion) { - this.evaluationVersion = evaluationVersion; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ConfigModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConfigModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ConfigModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ConfigModel` properties. JSON: %s", + entry.getKey(), jsonElement.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())); - } - if ((jsonObj.get("evaluationVersion") != null && !jsonObj.get("evaluationVersion").isJsonNull()) && !jsonObj.get("evaluationVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `evaluationVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("evaluationVersion").toString())); - } - // validate the optional field `evaluationVersion` - if (jsonObj.get("evaluationVersion") != null && !jsonObj.get("evaluationVersion").isJsonNull()) { - EvaluationVersionEnum.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(); - elementAdapter.write(out, obj); - } - - @Override - public ConfigModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + // 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(); + elementAdapter.write(out, obj); + } + + @Override + public ConfigModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 7e68d00..08c38d4 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulaModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulaModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,573 +10,657 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * ConfigSettingFormulaModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** ConfigSettingFormulaModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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; + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ConfigSettingFormulaModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConfigSettingFormulaModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + /** + * 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<>(); } - } - 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)); - }; + 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<>(); } - } - // 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)); - }; + 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - } - 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)); - }; + if (o == null || getClass() != o.getClass()) { + return false; } - } - // 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") + 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); + } + + 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 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(); - elementAdapter.write(out, obj); - } - - @Override - public ConfigSettingFormulaModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + public int hashCode() { + return Objects.hash( + lastVersionId, + defaultValue, + targetingRules, + setting, + updatedAt, + percentageEvaluationAttribute, + lastUpdaterUserEmail, + lastUpdaterUserFullName, + integrationLinks, + settingTags, + settingIdsWherePrerequisite); + } + 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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ConfigSettingFormulaModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ConfigSettingFormulaModel` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public ConfigSettingFormulaModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index e09bd99..cfc7417 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulasModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulasModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,350 +10,363 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * ConfigSettingFormulasModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** ConfigSettingFormulasModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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<>(); + 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; } - 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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + public ConfigSettingFormulasModel readOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Get readOnly + * + * @return readOnly + */ + @javax.annotation.Nullable + public Boolean getReadOnly() { + return readOnly; } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; } - 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("}"); - 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"; + + public ConfigSettingFormulasModel settingFormulas( + List settingFormulas) { + this.settingFormulas = settingFormulas; + return this; } - 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())); + + 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; + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ConfigSettingFormulasModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConfigSettingFormulasModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + public void setFeatureFlagLimitations(FeatureFlagLimitations featureFlagLimitations) { + this.featureFlagLimitations = featureFlagLimitations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - } - 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)); - }; + if (o == null || getClass() != o.getClass()) { + return false; } - } - // 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") + 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); + } + + 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 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(); - elementAdapter.write(out, obj); - } - - @Override - public ConfigSettingFormulasModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + public int hashCode() { + return Objects.hash(config, environment, readOnly, settingFormulas, featureFlagLimitations); + } + + 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("}"); + return sb.toString(); } - } - - /** - * 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); - } -} + /** + * 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ConfigSettingFormulasModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ConfigSettingFormulasModel` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public ConfigSettingFormulasModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 0b2f9c7..8047333 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingValueModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingValueModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,520 +10,581 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * ConfigSettingValueModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** ConfigSettingValueModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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; + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ConfigSettingValueModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConfigSettingValueModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + /** + * 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<>(); } - } - 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)); - }; + 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<>(); } - } - 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)); - }; + 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<>(); } - } - // 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)); - }; + 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - } - 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)); - }; + 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); + } + + 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())); + } - 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(); - elementAdapter.write(out, obj); - } - - @Override - public ConfigSettingValueModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + public int hashCode() { + return Objects.hash( + rolloutRules, + rolloutPercentageItems, + value, + setting, + updatedAt, + lastUpdaterUserEmail, + lastUpdaterUserFullName, + integrationLinks, + settingTags); + } + + 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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ConfigSettingValueModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ConfigSettingValueModel` properties. JSON: %s", + entry.getKey(), 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++) { + 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(); + elementAdapter.write(out, obj); + } + + @Override + public ConfigSettingValueModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 584d4e7..6dd92da 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingValuesModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/ConfigSettingValuesModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,350 +10,361 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * ConfigSettingValuesModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** ConfigSettingValuesModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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<>(); + 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; } - 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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + public ConfigSettingValuesModel readOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Get readOnly + * + * @return readOnly + */ + @javax.annotation.Nullable + public Boolean getReadOnly() { + return readOnly; } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; } - 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("}"); - 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"; + + public ConfigSettingValuesModel settingValues(List settingValues) { + this.settingValues = settingValues; + return this; } - 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())); + + 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; + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ConfigSettingValuesModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConfigSettingValuesModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + public void setFeatureFlagLimitations(FeatureFlagLimitations featureFlagLimitations) { + this.featureFlagLimitations = featureFlagLimitations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - } - 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)); - }; + if (o == null || getClass() != o.getClass()) { + return false; } - } - // 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") + 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); + } + + 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 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(); - elementAdapter.write(out, obj); - } - - @Override - public ConfigSettingValuesModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + public int hashCode() { + return Objects.hash(config, environment, readOnly, settingValues, featureFlagLimitations); + } + + 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("}"); + return sb.toString(); } - } - - /** - * 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); - } -} + /** + * 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ConfigSettingValuesModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ConfigSettingValuesModel` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public ConfigSettingValuesModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index f54f80c..11eef69 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/ConnectRequest.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/ConnectRequest.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,235 +10,237 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Objects; import java.util.Set; -import com.configcat.publicapi.java.client.JSON; - -/** - * ConnectRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** ConnectRequest */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Get clientKey + * + * @return clientKey + */ + @javax.annotation.Nonnull + public String getClientKey() { + return clientKey; } - ConnectRequest connectRequest = (ConnectRequest) o; - return Objects.equals(this.clientKey, connectRequest.clientKey) && - Objects.equals(this.jiraJwtToken, connectRequest.jiraJwtToken); - } - - @Override - public int hashCode() { - return Objects.hash(clientKey, jiraJwtToken); - } - - @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("}"); - 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"; + + public void setClientKey(String clientKey) { + this.clientKey = clientKey; } - 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())); + + 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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(clientKey, jiraJwtToken); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ConnectRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConnectRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + @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("}"); + 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"); - // 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())); + // 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ConnectRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ConnectRequest` properties. JSON: %s", + entry.getKey(), jsonElement.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(); - elementAdapter.write(out, obj); - } - - @Override - public ConnectRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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())); + } } - } - - /** - * 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); - } -} + 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(); + elementAdapter.write(out, obj); + } + + @Override + public ConnectRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index e29da58..3bf1a4e 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/CreateConfigRequest.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/CreateConfigRequest.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,357 +10,318 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * CreateConfigRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** CreateConfigRequest */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - - /** - * Determines the evaluation version of a Config. Using `v2` enables the new features of Config V2 (https://configcat.com/docs/advanced/config-v2). - */ - @JsonAdapter(EvaluationVersionEnum.Adapter.class) - public enum EvaluationVersionEnum { - V1("v1"), - - V2("v2"); - - private String value; - - EvaluationVersionEnum(String value) { - this.value = value; + 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; } - public String getValue() { - return value; + /** + * The name of the Config. + * + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; } - @Override - public String toString() { - return String.valueOf(value); + 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; } - public static EvaluationVersionEnum fromValue(String value) { - for (EvaluationVersionEnum b : EvaluationVersionEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + 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); } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final EvaluationVersionEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public EvaluationVersionEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return EvaluationVersionEnum.fromValue(value); - } + 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())); } - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - EvaluationVersionEnum.fromValue(value); + @Override + public int hashCode() { + return Objects.hash(name, description, order, evaluationVersion); } - } - - public static final String SERIALIZED_NAME_EVALUATION_VERSION = "evaluationVersion"; - @SerializedName(SERIALIZED_NAME_EVALUATION_VERSION) - private EvaluationVersionEnum 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(EvaluationVersionEnum evaluationVersion) { - this.evaluationVersion = evaluationVersion; - return this; - } - - /** - * Determines the evaluation version of a Config. Using `v2` enables the new features of Config V2 (https://configcat.com/docs/advanced/config-v2). - * @return evaluationVersion - */ - @javax.annotation.Nullable - public EvaluationVersionEnum getEvaluationVersion() { - return evaluationVersion; - } - - public void setEvaluationVersion(EvaluationVersionEnum evaluationVersion) { - this.evaluationVersion = evaluationVersion; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; } - if (o == null || getClass() != o.getClass()) { - return false; + + @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("}"); + return sb.toString(); } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + /** + * 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 "); } - 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("}"); - 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"; + + 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"); } - 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())); + + /** + * 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateConfigRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateConfigRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateConfigRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateConfigRequest` properties. JSON: %s", + entry.getKey(), jsonElement.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())); + // 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())); - } - if ((jsonObj.get("evaluationVersion") != null && !jsonObj.get("evaluationVersion").isJsonNull()) && !jsonObj.get("evaluationVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `evaluationVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("evaluationVersion").toString())); - } - // validate the optional field `evaluationVersion` - if (jsonObj.get("evaluationVersion") != null && !jsonObj.get("evaluationVersion").isJsonNull()) { - EvaluationVersionEnum.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(); - elementAdapter.write(out, obj); - } - - @Override - public CreateConfigRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public CreateConfigRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); - } -} + /** + * 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 index dc7d8fa..94d2e16 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/CreateEnvironmentModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/CreateEnvironmentModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,301 +10,319 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * CreateEnvironmentModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** CreateEnvironmentModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; + } + + @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); + } + + 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); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; } - if (o == null || getClass() != o.getClass()) { - return false; + + @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("}"); + return sb.toString(); } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + /** + * 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 "); } - 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("}"); - 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"; + + 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"); } - 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())); + + /** + * 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateEnvironmentModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateEnvironmentModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateEnvironmentModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateEnvironmentModel` properties. JSON: %s", + entry.getKey(), jsonElement.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())); + // 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(); - elementAdapter.write(out, obj); - } - - @Override - public CreateEnvironmentModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public CreateEnvironmentModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); } - } - - /** - * 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); - } -} + /** + * 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 index 8ffee4b..24a1f8c 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/CreateIntegrationModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/CreateIntegrationModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,419 +10,371 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; -import com.configcat.publicapi.java.client.JSON; - -/** - * CreateIntegrationModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** CreateIntegrationModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[Etc/UTC]", + comments = "Generator version: 7.7.0") public class CreateIntegrationModel { - /** - * Type of the Integration. - */ - @JsonAdapter(IntegrationTypeEnum.Adapter.class) - public enum IntegrationTypeEnum { - DATA_DOG("dataDog"), - - SLACK("slack"), - - AMPLITUDE("amplitude"), - - MIX_PANEL("mixPanel"), - - SEGMENT("segment"), - - PUB_NUB("pubNub"); - - private String value; - - IntegrationTypeEnum(String value) { - this.value = value; + 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; } - public String getValue() { - return value; + /** + * Get integrationType + * + * @return integrationType + */ + @javax.annotation.Nonnull + public IntegrationType getIntegrationType() { + return integrationType; } - @Override - public String toString() { - return String.valueOf(value); + 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 static IntegrationTypeEnum fromValue(String value) { - for (IntegrationTypeEnum b : IntegrationTypeEnum.values()) { - if (b.value.equals(value)) { - return b; + 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<>(); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + this.parameters.put(key, parametersItem); + return this; } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final IntegrationTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public IntegrationTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return IntegrationTypeEnum.fromValue(value); - } + /** + * Parameters of the Integration. + * + * @return parameters + */ + @javax.annotation.Nonnull + public Map getParameters() { + return parameters; } - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - IntegrationTypeEnum.fromValue(value); + public void setParameters(Map parameters) { + this.parameters = parameters; } - } - - public static final String SERIALIZED_NAME_INTEGRATION_TYPE = "integrationType"; - @SerializedName(SERIALIZED_NAME_INTEGRATION_TYPE) - private IntegrationTypeEnum 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(IntegrationTypeEnum integrationType) { - this.integrationType = integrationType; - return this; - } - - /** - * Type of the Integration. - * @return integrationType - */ - @javax.annotation.Nonnull - public IntegrationTypeEnum getIntegrationType() { - return integrationType; - } - - public void setIntegrationType(IntegrationTypeEnum 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<>(); + + public CreateIntegrationModel environmentIds(List environmentIds) { + this.environmentIds = environmentIds; + return this; } - 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<>(); + + public CreateIntegrationModel addEnvironmentIdsItem(UUID environmentIdsItem) { + if (this.environmentIds == null) { + this.environmentIds = new ArrayList<>(); + } + this.environmentIds.add(environmentIdsItem); + return this; } - 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<>(); + + /** + * 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; } - 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 setEnvironmentIds(List environmentIds) { + this.environmentIds = environmentIds; + } - public void setConfigIds(List configIds) { - this.configIds = configIds; - } + 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; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public void setConfigIds(List configIds) { + this.configIds = configIds; } - if (o == null || getClass() != o.getClass()) { - return false; + + @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); } - 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); - } - - @Override - public int hashCode() { - return Objects.hash(integrationType, name, parameters, environmentIds, configIds); - } - - @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("}"); - 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"; + + @Override + public int hashCode() { + return Objects.hash(integrationType, name, parameters, environmentIds, configIds); } - 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())); + + @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("}"); + 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateIntegrationModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateIntegrationModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateIntegrationModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateIntegrationModel` properties. JSON: %s", + entry.getKey(), jsonElement.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())); + // 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(); - if (!jsonObj.get("integrationType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `integrationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("integrationType").toString())); - } - // validate the required field `integrationType` - IntegrationTypeEnum.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(); - elementAdapter.write(out, obj); - } - - @Override - public CreateIntegrationModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + // 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(); + elementAdapter.write(out, obj); + } + + @Override + public CreateIntegrationModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); } - } - - /** - * 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); - } -} + /** + * 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 index 9c1d765..9dfc0a8 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/CreateOrUpdateEnvironmentAccessModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/CreateOrUpdateEnvironmentAccessModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,285 +10,242 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Objects; import java.util.Set; +import java.util.UUID; -import com.configcat.publicapi.java.client.JSON; - -/** - * CreateOrUpdateEnvironmentAccessModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** CreateOrUpdateEnvironmentAccessModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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_ID = "environmentId"; - /** - * Represent the environment specific Feature Management permission. - */ - @JsonAdapter(EnvironmentAccessTypeEnum.Adapter.class) - public enum EnvironmentAccessTypeEnum { - FULL("full"), - - READ_ONLY("readOnly"), - - NONE("none"); + @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ID) + private UUID environmentId; - private String value; + public static final String SERIALIZED_NAME_ENVIRONMENT_ACCESS_TYPE = "environmentAccessType"; - EnvironmentAccessTypeEnum(String value) { - this.value = value; - } + @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ACCESS_TYPE) + private EnvironmentAccessType environmentAccessType; - public String getValue() { - return value; - } + public CreateOrUpdateEnvironmentAccessModel() {} - @Override - public String toString() { - return String.valueOf(value); + public CreateOrUpdateEnvironmentAccessModel environmentId(UUID environmentId) { + this.environmentId = environmentId; + return this; } - public static EnvironmentAccessTypeEnum fromValue(String value) { - for (EnvironmentAccessTypeEnum b : EnvironmentAccessTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + /** + * Identifier of the Environment. + * + * @return environmentId + */ + @javax.annotation.Nullable + public UUID getEnvironmentId() { + return environmentId; } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final EnvironmentAccessTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public EnvironmentAccessTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return EnvironmentAccessTypeEnum.fromValue(value); - } + public void setEnvironmentId(UUID environmentId) { + this.environmentId = environmentId; } - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - EnvironmentAccessTypeEnum.fromValue(value); + public CreateOrUpdateEnvironmentAccessModel environmentAccessType( + EnvironmentAccessType environmentAccessType) { + this.environmentAccessType = environmentAccessType; + return this; } - } - - public static final String SERIALIZED_NAME_ENVIRONMENT_ACCESS_TYPE = "environmentAccessType"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ACCESS_TYPE) - private EnvironmentAccessTypeEnum 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(EnvironmentAccessTypeEnum environmentAccessType) { - this.environmentAccessType = environmentAccessType; - return this; - } - - /** - * Represent the environment specific Feature Management permission. - * @return environmentAccessType - */ - @javax.annotation.Nullable - public EnvironmentAccessTypeEnum getEnvironmentAccessType() { - return environmentAccessType; - } - - public void setEnvironmentAccessType(EnvironmentAccessTypeEnum environmentAccessType) { - this.environmentAccessType = environmentAccessType; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + /** + * Get environmentAccessType + * + * @return environmentAccessType + */ + @javax.annotation.Nullable + public EnvironmentAccessType getEnvironmentAccessType() { + return environmentAccessType; } - if (o == null || getClass() != o.getClass()) { - return false; + + public void setEnvironmentAccessType(EnvironmentAccessType environmentAccessType) { + this.environmentAccessType = environmentAccessType; } - CreateOrUpdateEnvironmentAccessModel createOrUpdateEnvironmentAccessModel = (CreateOrUpdateEnvironmentAccessModel) o; - return Objects.equals(this.environmentId, createOrUpdateEnvironmentAccessModel.environmentId) && - Objects.equals(this.environmentAccessType, createOrUpdateEnvironmentAccessModel.environmentAccessType); - } - @Override - public int hashCode() { - return Objects.hash(environmentId, environmentAccessType); - } + @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); + } - @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("}"); - return sb.toString(); - } + @Override + public int hashCode() { + return Objects.hash(environmentId, environmentAccessType); + } - /** - * 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"; + @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("}"); + return sb.toString(); } - return o.toString().replace("\n", "\n "); - } + /** + * 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; + 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"); + 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(); - } + // 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())); + /** + * 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateOrUpdateEnvironmentAccessModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateOrUpdateEnvironmentAccessModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateOrUpdateEnvironmentAccessModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateOrUpdateEnvironmentAccessModel` properties. JSON:" + + " %s", + entry.getKey(), 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())); - } - if ((jsonObj.get("environmentAccessType") != null && !jsonObj.get("environmentAccessType").isJsonNull()) && !jsonObj.get("environmentAccessType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `environmentAccessType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentAccessType").toString())); - } - // validate the optional field `environmentAccessType` - if (jsonObj.get("environmentAccessType") != null && !jsonObj.get("environmentAccessType").isJsonNull()) { - EnvironmentAccessTypeEnum.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(); - elementAdapter.write(out, obj); - } - - @Override - public CreateOrUpdateEnvironmentAccessModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } + 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")); + } + } - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public CreateOrUpdateEnvironmentAccessModel read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); - } + /** + * 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); - } + /** + * 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 index aa25266..9b467d8 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/CreatePermissionGroupRequest.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/CreatePermissionGroupRequest.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,962 +10,1013 @@ * Do not edit the class manually. */ - package com.configcat.publicapi.java.client.model; -import java.util.Objects; -import com.configcat.publicapi.java.client.model.CreateOrUpdateEnvironmentAccessModel; -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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * CreatePermissionGroupRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** CreatePermissionGroupRequest */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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_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"; - public static final String SERIALIZED_NAME_CAN_MANAGE_MEMBERS = "canManageMembers"; - @SerializedName(SERIALIZED_NAME_CAN_MANAGE_MEMBERS) - private Boolean canManageMembers; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_CONFIG) + private Boolean canCreateOrUpdateConfig; - 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"; - public static final String SERIALIZED_NAME_CAN_DELETE_CONFIG = "canDeleteConfig"; - @SerializedName(SERIALIZED_NAME_CAN_DELETE_CONFIG) - private Boolean 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_CREATE_OR_UPDATE_ENVIRONMENT = + "canCreateOrUpdateEnvironment"; - public static final String SERIALIZED_NAME_CAN_DELETE_ENVIRONMENT = "canDeleteEnvironment"; - @SerializedName(SERIALIZED_NAME_CAN_DELETE_ENVIRONMENT) - private Boolean canDeleteEnvironment; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_ENVIRONMENT) + private Boolean canCreateOrUpdateEnvironment; - 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_DELETE_ENVIRONMENT = "canDeleteEnvironment"; - public static final String SERIALIZED_NAME_CAN_TAG_SETTING = "canTagSetting"; - @SerializedName(SERIALIZED_NAME_CAN_TAG_SETTING) - private Boolean canTagSetting; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_ENVIRONMENT) + private Boolean canDeleteEnvironment; - 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_SETTING = + "canCreateOrUpdateSetting"; - public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_TAG = "canCreateOrUpdateTag"; - @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_TAG) - private Boolean canCreateOrUpdateTag; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SETTING) + private Boolean canCreateOrUpdateSetting; - 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_TAG_SETTING = "canTagSetting"; - public static final String SERIALIZED_NAME_CAN_MANAGE_WEBHOOK = "canManageWebhook"; - @SerializedName(SERIALIZED_NAME_CAN_MANAGE_WEBHOOK) - private Boolean canManageWebhook; + @SerializedName(SERIALIZED_NAME_CAN_TAG_SETTING) + private Boolean canTagSetting; - 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_DELETE_SETTING = "canDeleteSetting"; - public static final String SERIALIZED_NAME_CAN_MANAGE_PRODUCT_PREFERENCES = "canManageProductPreferences"; - @SerializedName(SERIALIZED_NAME_CAN_MANAGE_PRODUCT_PREFERENCES) - private Boolean canManageProductPreferences; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_SETTING) + private Boolean canDeleteSetting; - 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_CREATE_OR_UPDATE_TAG = "canCreateOrUpdateTag"; - public static final String SERIALIZED_NAME_CAN_VIEW_SDK_KEY = "canViewSdkKey"; - @SerializedName(SERIALIZED_NAME_CAN_VIEW_SDK_KEY) - private Boolean canViewSdkKey; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_TAG) + private Boolean canCreateOrUpdateTag; - 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_DELETE_TAG = "canDeleteTag"; - public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SEGMENTS = "canCreateOrUpdateSegments"; - @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SEGMENTS) - private Boolean canCreateOrUpdateSegments; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_TAG) + private Boolean canDeleteTag; - 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_MANAGE_WEBHOOK = "canManageWebhook"; - public static final String SERIALIZED_NAME_CAN_VIEW_PRODUCT_AUDIT_LOG = "canViewProductAuditLog"; - @SerializedName(SERIALIZED_NAME_CAN_VIEW_PRODUCT_AUDIT_LOG) - private Boolean canViewProductAuditLog; + @SerializedName(SERIALIZED_NAME_CAN_MANAGE_WEBHOOK) + private Boolean canManageWebhook; - 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_USE_EXPORT_IMPORT = "canUseExportImport"; - /** - * Represent the Feature Management permission. - */ - @JsonAdapter(AccessTypeEnum.Adapter.class) - public enum AccessTypeEnum { - READ_ONLY("readOnly"), - - FULL("full"), - - CUSTOM("custom"); + @SerializedName(SERIALIZED_NAME_CAN_USE_EXPORT_IMPORT) + private Boolean canUseExportImport; - private String value; + public static final String SERIALIZED_NAME_CAN_MANAGE_PRODUCT_PREFERENCES = + "canManageProductPreferences"; - AccessTypeEnum(String value) { - this.value = value; + @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; } - public String getValue() { - return value; + /** + * Name of the Permission Group. + * + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; } - @Override - public String toString() { - return String.valueOf(value); + 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 static AccessTypeEnum fromValue(String value) { - for (AccessTypeEnum b : AccessTypeEnum.values()) { - if (b.value.equals(value)) { - return b; + 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<>(); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + this.environmentAccesses.add(environmentAccessesItem); + return this; } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AccessTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } + /** + * List of environment specific permissions. + * + * @return environmentAccesses + */ + @javax.annotation.Nullable + public List getEnvironmentAccesses() { + return environmentAccesses; + } - @Override - public AccessTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AccessTypeEnum.fromValue(value); - } + public void setEnvironmentAccesses( + List environmentAccesses) { + this.environmentAccesses = environmentAccesses; } - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - AccessTypeEnum.fromValue(value); + public CreatePermissionGroupRequest canDisable2FA(Boolean canDisable2FA) { + this.canDisable2FA = canDisable2FA; + return this; } - } - public static final String SERIALIZED_NAME_ACCESS_TYPE = "accessType"; - @SerializedName(SERIALIZED_NAME_ACCESS_TYPE) - private AccessTypeEnum accessType; + /** + * Group members can disable two-factor authentication for other members. + * + * @return canDisable2FA + */ + @javax.annotation.Nullable + public Boolean getCanDisable2FA() { + return canDisable2FA; + } - /** - * Represent the environment specific Feature Management permission. - */ - @JsonAdapter(NewEnvironmentAccessTypeEnum.Adapter.class) - public enum NewEnvironmentAccessTypeEnum { - FULL("full"), - - READ_ONLY("readOnly"), - - NONE("none"); + public void setCanDisable2FA(Boolean canDisable2FA) { + this.canDisable2FA = canDisable2FA; + } - private String value; + @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); + } + + 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())); + } - NewEnvironmentAccessTypeEnum(String value) { - this.value = value; + @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); } - public String getValue() { - return value; + 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() { - return String.valueOf(value); + 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("}"); + return sb.toString(); } - public static NewEnvironmentAccessTypeEnum fromValue(String value) { - for (NewEnvironmentAccessTypeEnum b : NewEnvironmentAccessTypeEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * 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"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return o.toString().replace("\n", "\n "); } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final NewEnvironmentAccessTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public NewEnvironmentAccessTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return NewEnvironmentAccessTypeEnum.fromValue(value); - } + 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 { - String value = jsonElement.getAsString(); - NewEnvironmentAccessTypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_NEW_ENVIRONMENT_ACCESS_TYPE = "newEnvironmentAccessType"; - @SerializedName(SERIALIZED_NAME_NEW_ENVIRONMENT_ACCESS_TYPE) - private NewEnvironmentAccessTypeEnum newEnvironmentAccessType; - - public static final String SERIALIZED_NAME_ENVIRONMENT_ACCESSES = "environmentAccesses"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ACCESSES) - private List environmentAccesses; - - 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(AccessTypeEnum accessType) { - this.accessType = accessType; - return this; - } - - /** - * Represent the Feature Management permission. - * @return accessType - */ - @javax.annotation.Nullable - public AccessTypeEnum getAccessType() { - return accessType; - } - - public void setAccessType(AccessTypeEnum accessType) { - this.accessType = accessType; - } - - - public CreatePermissionGroupRequest newEnvironmentAccessType(NewEnvironmentAccessTypeEnum newEnvironmentAccessType) { - this.newEnvironmentAccessType = newEnvironmentAccessType; - return this; - } - - /** - * Represent the environment specific Feature Management permission. - * @return newEnvironmentAccessType - */ - @javax.annotation.Nullable - public NewEnvironmentAccessTypeEnum getNewEnvironmentAccessType() { - return newEnvironmentAccessType; - } - - public void setNewEnvironmentAccessType(NewEnvironmentAccessTypeEnum 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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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"); - - // 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())); + 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreatePermissionGroupRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreatePermissionGroupRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreatePermissionGroupRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreatePermissionGroupRequest` properties. JSON: %s", + entry.getKey(), jsonElement.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())); + // 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())); - } - if ((jsonObj.get("accessType") != null && !jsonObj.get("accessType").isJsonNull()) && !jsonObj.get("accessType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `accessType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accessType").toString())); - } - // validate the optional field `accessType` - if (jsonObj.get("accessType") != null && !jsonObj.get("accessType").isJsonNull()) { - AccessTypeEnum.validateJsonElement(jsonObj.get("accessType")); - } - if ((jsonObj.get("newEnvironmentAccessType") != null && !jsonObj.get("newEnvironmentAccessType").isJsonNull()) && !jsonObj.get("newEnvironmentAccessType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `newEnvironmentAccessType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("newEnvironmentAccessType").toString())); - } - // validate the optional field `newEnvironmentAccessType` - if (jsonObj.get("newEnvironmentAccessType") != null && !jsonObj.get("newEnvironmentAccessType").isJsonNull()) { - NewEnvironmentAccessTypeEnum.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)); - }; + 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(); - elementAdapter.write(out, obj); - } - - @Override - public CreatePermissionGroupRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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(); + elementAdapter.write(out, obj); + } + + @Override + public CreatePermissionGroupRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index d2b5879..94d0f6a 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/CreateProductRequest.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/CreateProductRequest.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,272 +10,284 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * CreateProductRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** CreateProductRequest */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * The name of the Product. + * + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; } - CreateProductRequest createProductRequest = (CreateProductRequest) o; - return Objects.equals(this.name, createProductRequest.name) && - Objects.equals(this.description, createProductRequest.description) && - Objects.equals(this.order, createProductRequest.order); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + public void setName(String name) { + this.name = name; } - 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("}"); - 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"; + + 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; } - 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())); + + public void setOrder(Integer order) { + this.order = order; + } + + @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); + } + + 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())); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateProductRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateProductRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + @Override + public int hashCode() { + return Objects.hash(name, description, order); + } + + 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("}"); + return sb.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())); + /** + * 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateProductRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateProductRequest` properties. JSON: %s", + entry.getKey(), jsonElement.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(); - elementAdapter.write(out, obj); - } - - @Override - public CreateProductRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public CreateProductRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); - } -} + /** + * 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 index 4a24e65..2905252 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/CreateSegmentModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/CreateSegmentModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,422 +10,358 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * CreateSegmentModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** CreateSegmentModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - - /** - * Gets or Sets comparator - */ - @JsonAdapter(ComparatorEnum.Adapter.class) - public enum ComparatorEnum { - 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; - - ComparatorEnum(String value) { - this.value = value; + 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; } - public String getValue() { - return value; + /** + * Name of the Segment. + * + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; } - @Override - public String toString() { - return String.valueOf(value); + 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; } - public static ComparatorEnum fromValue(String value) { - for (ComparatorEnum b : ComparatorEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + 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); } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ComparatorEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ComparatorEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ComparatorEnum.fromValue(value); - } + 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())); } - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - ComparatorEnum.fromValue(value); + @Override + public int hashCode() { + return Objects.hash(name, description, comparisonAttribute, comparator, comparisonValue); } - } - - public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; - @SerializedName(SERIALIZED_NAME_COMPARATOR) - private ComparatorEnum 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(ComparatorEnum comparator) { - this.comparator = comparator; - return this; - } - - /** - * Get comparator - * @return comparator - */ - @javax.annotation.Nonnull - public ComparatorEnum getComparator() { - return comparator; - } - - public void setComparator(ComparatorEnum 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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; } - if (o == null || getClass() != o.getClass()) { - return false; + + @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("}"); + return sb.toString(); } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + /** + * 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 "); } - 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("}"); - 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"; + + 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"); } - 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())); + + /** + * 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateSegmentModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateSegmentModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateSegmentModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateSegmentModel` properties. JSON: %s", + entry.getKey(), jsonElement.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())); + // 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())); - } - if (!jsonObj.get("comparator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `comparator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparator").toString())); - } - // validate the required field `comparator` - ComparatorEnum.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(); - elementAdapter.write(out, obj); - } - - @Override - public CreateSegmentModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSegmentModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); } - } - - /** - * 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); - } -} + /** + * 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 index 78ba859..0bce894 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/CreateSettingInitialValues.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/CreateSettingInitialValues.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,479 +10,452 @@ * 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.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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * CreateSettingInitialValues - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** CreateSettingInitialValues */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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_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 static final String SERIALIZED_NAME_TAGS = "tags"; - @SerializedName(SERIALIZED_NAME_TAGS) - private List tags; + public CreateSettingInitialValues name(String name) { + this.name = name; + return this; + } - public static final String SERIALIZED_NAME_ORDER = "order"; - @SerializedName(SERIALIZED_NAME_ORDER) - private Integer order; + /** + * The name of the Feature Flag or Setting. + * + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; + public void setName(String name) { + this.name = name; + } - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; + public CreateSettingInitialValues settingType(SettingType settingType) { + this.settingType = settingType; + return this; + } - /** - * The type of the Feature Flag or Setting. - */ - @JsonAdapter(SettingTypeEnum.Adapter.class) - public enum SettingTypeEnum { - BOOLEAN("boolean"), - - STRING("string"), - - INT("int"), - - DOUBLE("double"); + /** + * Get settingType + * + * @return settingType + */ + @javax.annotation.Nonnull + public SettingType getSettingType() { + return settingType; + } - private String value; + public void setSettingType(SettingType settingType) { + this.settingType = settingType; + } - SettingTypeEnum(String value) { - this.value = value; + public CreateSettingInitialValues initialValues(List initialValues) { + this.initialValues = initialValues; + return this; } - public String getValue() { - return value; + 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; } @Override - public String toString() { - return String.valueOf(value); + 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); + } + + 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())); } - public static SettingTypeEnum fromValue(String value) { - for (SettingTypeEnum b : SettingTypeEnum.values()) { - if (b.value.equals(value)) { - return b; + @Override + public int hashCode() { + return Objects.hash(hint, tags, order, key, name, settingType, initialValues); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final SettingTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } + @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("}"); + 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 "); + } - @Override - public SettingTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return SettingTypeEnum.fromValue(value); - } + 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 { - String value = jsonElement.getAsString(); - SettingTypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_SETTING_TYPE = "settingType"; - @SerializedName(SERIALIZED_NAME_SETTING_TYPE) - private SettingTypeEnum 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(SettingTypeEnum settingType) { - this.settingType = settingType; - return this; - } - - /** - * The type of the Feature Flag or Setting. - * @return settingType - */ - @javax.annotation.Nonnull - public SettingTypeEnum getSettingType() { - return settingType; - } - - public void setSettingType(SettingTypeEnum 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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateSettingInitialValues.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateSettingInitialValues` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateSettingInitialValues.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateSettingInitialValues` properties. JSON: %s", + entry.getKey(), jsonElement.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())); + // 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())); - } - if (!jsonObj.get("settingType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `settingType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("settingType").toString())); - } - // validate the required field `settingType` - SettingTypeEnum.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)); - }; + 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(); - elementAdapter.write(out, obj); - } - - @Override - public CreateSettingInitialValues read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSettingInitialValues read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 625c93d..8ccc8de 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/CreateTagModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/CreateTagModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,246 +10,255 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * CreateTagModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** CreateTagModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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. - * @return color - */ - @javax.annotation.Nullable - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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. + * + * @return color + */ + @javax.annotation.Nullable + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + @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); + } + + 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); + } + + 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("}"); + 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateTagModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateTagModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateTagModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateTagModel` properties. JSON: %s", + entry.getKey(), jsonElement.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())); + // 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(); - elementAdapter.write(out, obj); - } - - @Override - public CreateTagModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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(); + elementAdapter.write(out, obj); + } + + @Override + public CreateTagModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index de7906a..25cb133 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/DeleteIntegrationLinkModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/DeleteIntegrationLinkModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,194 +10,192 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Objects; import java.util.Set; -import com.configcat.publicapi.java.client.JSON; - -/** - * DeleteIntegrationLinkModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** DeleteIntegrationLinkModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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 static final String SERIALIZED_NAME_HAS_REMAINING_INTEGRATION_LINK = + "hasRemainingIntegrationLink"; - public DeleteIntegrationLinkModel() { - } + @SerializedName(SERIALIZED_NAME_HAS_REMAINING_INTEGRATION_LINK) + private Boolean hasRemainingIntegrationLink; - public DeleteIntegrationLinkModel hasRemainingIntegrationLink(Boolean hasRemainingIntegrationLink) { - this.hasRemainingIntegrationLink = hasRemainingIntegrationLink; - return this; - } + public DeleteIntegrationLinkModel() {} - /** - * Get hasRemainingIntegrationLink - * @return hasRemainingIntegrationLink - */ - @javax.annotation.Nullable - public Boolean getHasRemainingIntegrationLink() { - return hasRemainingIntegrationLink; - } + public DeleteIntegrationLinkModel hasRemainingIntegrationLink( + Boolean hasRemainingIntegrationLink) { + this.hasRemainingIntegrationLink = hasRemainingIntegrationLink; + return this; + } - public void setHasRemainingIntegrationLink(Boolean hasRemainingIntegrationLink) { - this.hasRemainingIntegrationLink = hasRemainingIntegrationLink; - } + /** + * Get hasRemainingIntegrationLink + * + * @return hasRemainingIntegrationLink + */ + @javax.annotation.Nullable + public Boolean getHasRemainingIntegrationLink() { + return hasRemainingIntegrationLink; + } + public void setHasRemainingIntegrationLink(Boolean hasRemainingIntegrationLink) { + this.hasRemainingIntegrationLink = hasRemainingIntegrationLink; + } + @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); + } + + @Override + public int hashCode() { + return Objects.hash(hasRemainingIntegrationLink); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteIntegrationLinkModel {\n"); + sb.append(" hasRemainingIntegrationLink: ") + .append(toIndentedString(hasRemainingIntegrationLink)) + .append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * 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 "); } - DeleteIntegrationLinkModel deleteIntegrationLinkModel = (DeleteIntegrationLinkModel) o; - return Objects.equals(this.hasRemainingIntegrationLink, deleteIntegrationLinkModel.hasRemainingIntegrationLink); - } - - @Override - public int hashCode() { - return Objects.hash(hasRemainingIntegrationLink); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteIntegrationLinkModel {\n"); - sb.append(" hasRemainingIntegrationLink: ").append(toIndentedString(hasRemainingIntegrationLink)).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"; + + 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(); } - 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())); + + /** + * 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!DeleteIntegrationLinkModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteIntegrationLinkModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DeleteIntegrationLinkModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteIntegrationLinkModel` properties. JSON: %s", + entry.getKey(), 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(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteIntegrationLinkModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteIntegrationLinkModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); } - } - - /** - * 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); - } -} + /** + * 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 index da8c909..5d26e50 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/DeleteRepositoryReportsRequest.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/DeleteRepositoryReportsRequest.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,303 +10,327 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * DeleteRepositoryReportsRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** DeleteRepositoryReportsRequest */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; + } + + @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); + } + + 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); } - if (o == null || getClass() != o.getClass()) { - return false; + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + @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("}"); + return sb.toString(); } - 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("}"); - 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"; + + /** + * 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 "); } - 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())); + + 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!DeleteRepositoryReportsRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteRepositoryReportsRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DeleteRepositoryReportsRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteRepositoryReportsRequest` properties. JSON: %s", + entry.getKey(), jsonElement.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())); + // 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(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteRepositoryReportsRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteRepositoryReportsRequest read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); } - } - - /** - * 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); - } -} + /** + * 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 index 1b51045..90f2b93 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,436 +10,415 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * EnvironmentAccessModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** EnvironmentAccessModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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_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 static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String 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; + } - public static final String SERIALIZED_NAME_COLOR = "color"; - @SerializedName(SERIALIZED_NAME_COLOR) - private String color; + /** + * The order of the Environment represented on the ConfigCat Dashboard. + * + * @return order + */ + @javax.annotation.Nullable + public Integer getOrder() { + return order; + } - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; + public void setOrder(Integer order) { + this.order = order; + } - public static final String SERIALIZED_NAME_ORDER = "order"; - @SerializedName(SERIALIZED_NAME_ORDER) - private Integer order; + public EnvironmentAccessModel reasonRequired(Boolean reasonRequired) { + this.reasonRequired = reasonRequired; + return this; + } - public static final String SERIALIZED_NAME_REASON_REQUIRED = "reasonRequired"; - @SerializedName(SERIALIZED_NAME_REASON_REQUIRED) - private Boolean reasonRequired; + /** + * 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; + } - /** - * Represent the environment specific Feature Management permission. - */ - @JsonAdapter(EnvironmentAccessTypeEnum.Adapter.class) - public enum EnvironmentAccessTypeEnum { - FULL("full"), - - READ_ONLY("readOnly"), - - NONE("none"); + public void setReasonRequired(Boolean reasonRequired) { + this.reasonRequired = reasonRequired; + } - private String value; + public EnvironmentAccessModel environmentAccessType( + EnvironmentAccessType environmentAccessType) { + this.environmentAccessType = environmentAccessType; + return this; + } - EnvironmentAccessTypeEnum(String value) { - this.value = value; + /** + * Get environmentAccessType + * + * @return environmentAccessType + */ + @javax.annotation.Nullable + public EnvironmentAccessType getEnvironmentAccessType() { + return environmentAccessType; } - public String getValue() { - return value; + public void setEnvironmentAccessType(EnvironmentAccessType environmentAccessType) { + this.environmentAccessType = environmentAccessType; } @Override - public String toString() { - return String.valueOf(value); + 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); + } + + 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())); } - public static EnvironmentAccessTypeEnum fromValue(String value) { - for (EnvironmentAccessTypeEnum b : EnvironmentAccessTypeEnum.values()) { - if (b.value.equals(value)) { - return b; + @Override + public int hashCode() { + return Objects.hash( + environmentId, + name, + color, + description, + order, + reasonRequired, + environmentAccessType); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + 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("}"); + return sb.toString(); } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final EnvironmentAccessTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } + /** + * 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 "); + } - @Override - public EnvironmentAccessTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return EnvironmentAccessTypeEnum.fromValue(value); - } + 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 { - String value = jsonElement.getAsString(); - EnvironmentAccessTypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_ENVIRONMENT_ACCESS_TYPE = "environmentAccessType"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT_ACCESS_TYPE) - private EnvironmentAccessTypeEnum 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(EnvironmentAccessTypeEnum environmentAccessType) { - this.environmentAccessType = environmentAccessType; - return this; - } - - /** - * Represent the environment specific Feature Management permission. - * @return environmentAccessType - */ - @javax.annotation.Nullable - public EnvironmentAccessTypeEnum getEnvironmentAccessType() { - return environmentAccessType; - } - - public void setEnvironmentAccessType(EnvironmentAccessTypeEnum environmentAccessType) { - this.environmentAccessType = environmentAccessType; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EnvironmentAccessModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EnvironmentAccessModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EnvironmentAccessModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `EnvironmentAccessModel` properties. JSON: %s", + entry.getKey(), 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())); - } - 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())); - } - if ((jsonObj.get("environmentAccessType") != null && !jsonObj.get("environmentAccessType").isJsonNull()) && !jsonObj.get("environmentAccessType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `environmentAccessType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environmentAccessType").toString())); - } - // validate the optional field `environmentAccessType` - if (jsonObj.get("environmentAccessType") != null && !jsonObj.get("environmentAccessType").isJsonNull()) { - EnvironmentAccessTypeEnum.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(); - elementAdapter.write(out, obj); - } - - @Override - public EnvironmentAccessModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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(); + elementAdapter.write(out, obj); + } + + @Override + public EnvironmentAccessModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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..ca32c99 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentAccessType.java @@ -0,0 +1,74 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** 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 index c3e2f13..f4e3f84 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/EnvironmentModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,380 +10,404 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * Details of the Environment. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** Details of the Environment. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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; + } + + @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); + } + + 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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EnvironmentModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EnvironmentModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public EnvironmentModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EnvironmentModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `EnvironmentModel` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public EnvironmentModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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..b02f3c1 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/EvaluationVersion.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.model; + + +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * 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 index e6cf083..c1ee569 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/FeatureFlagLimitations.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/FeatureFlagLimitations.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,350 +10,392 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Objects; 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 = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** Subscription limitations regarding Feature flag or Setting values and targeting. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; } - if (o == null || getClass() != o.getClass()) { - return false; + + 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; } - 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); - } - - @Override - public int hashCode() { - return Objects.hash(maxPercentageOptionCount, maxTargetingRuleCount, maxComparisonValueLength, maxComparisonValueListLength, maxComparisonValueListItemLength, maxStringFlagValueLength, maxConditionPerTargetingRuleCount); - } - - @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("}"); - 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"; + + public void setMaxConditionPerTargetingRuleCount(Integer maxConditionPerTargetingRuleCount) { + this.maxConditionPerTargetingRuleCount = maxConditionPerTargetingRuleCount; } - 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())); + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + maxPercentageOptionCount, + maxTargetingRuleCount, + maxComparisonValueLength, + maxComparisonValueListLength, + maxComparisonValueListItemLength, + maxStringFlagValueLength, + maxConditionPerTargetingRuleCount); + } + + @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("}"); + return sb.toString(); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!FeatureFlagLimitations.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FeatureFlagLimitations` properties. JSON: %s", entry.getKey(), jsonElement.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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FeatureFlagLimitations.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `FeatureFlagLimitations` properties. JSON: %s", + entry.getKey(), 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(); - elementAdapter.write(out, obj); - } - - @Override - public FeatureFlagLimitations read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public FeatureFlagLimitations read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); } - } - - /** - * 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); - } -} + /** + * 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 index f081c45..5f9f741 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/FlagReference.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/FlagReference.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,250 +10,249 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; -import com.configcat.publicapi.java.client.JSON; - -/** - * FlagReference - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** FlagReference */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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_SETTING_ID = "settingId"; - public static final String SERIALIZED_NAME_REFERENCES = "references"; - @SerializedName(SERIALIZED_NAME_REFERENCES) - private List references = new ArrayList<>(); + @SerializedName(SERIALIZED_NAME_SETTING_ID) + private Integer settingId; - public FlagReference() { - } + public static final String SERIALIZED_NAME_REFERENCES = "references"; - public FlagReference settingId(Integer settingId) { - this.settingId = settingId; - return this; - } + @SerializedName(SERIALIZED_NAME_REFERENCES) + private List references = new ArrayList<>(); - /** - * The identifier of the Feature Flag or Setting the code reference belongs to. - * @return settingId - */ - @javax.annotation.Nonnull - public Integer getSettingId() { - return settingId; - } + public FlagReference() {} - 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<>(); + public FlagReference settingId(Integer settingId) { + this.settingId = settingId; + return this; } - 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; - } + /** + * 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 setReferences(List references) { - this.references = references; - } + 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; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + /** + * The actual references to the given Feature Flag or Setting. + * + * @return references + */ + @javax.annotation.Nonnull + public List getReferences() { + return references; } - if (o == null || getClass() != o.getClass()) { - return false; + + public void setReferences(List references) { + this.references = references; } - FlagReference flagReference = (FlagReference) o; - return Objects.equals(this.settingId, flagReference.settingId) && - Objects.equals(this.references, flagReference.references); - } - @Override - public int hashCode() { - return Objects.hash(settingId, references); - } + @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); + } - @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("}"); - return sb.toString(); - } + @Override + public int hashCode() { + return Objects.hash(settingId, references); + } - /** - * 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"; + @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("}"); + return sb.toString(); } - return o.toString().replace("\n", "\n "); - } + /** + * 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; + 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"); + 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"); - } + // 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())); + /** + * 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!FlagReference.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FlagReference` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FlagReference.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `FlagReference` properties. JSON: %s", + entry.getKey(), jsonElement.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())); + // 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(); - elementAdapter.write(out, obj); - } + // 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())); + } - @Override - public FlagReference read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } + JsonArray jsonArrayreferences = jsonObj.getAsJsonArray("references"); + // validate the required field `references` (array) + for (int i = 0; i < jsonArrayreferences.size(); i++) { + ReferenceLines.validateJsonElement(jsonArrayreferences.get(i)); + } + ; + } - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public FlagReference read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); - } + /** + * 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); - } + /** + * 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 index 49f2194..2ec5610 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/InitialValue.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/InitialValue.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,236 +10,238 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * InitialValue - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** InitialValue */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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; + } + + @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); + } + + 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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!InitialValue.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InitialValue` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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())); - } - } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } - 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(); - elementAdapter.write(out, obj); - } - - @Override - public InitialValue read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!InitialValue.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `InitialValue` properties. JSON: %s", + entry.getKey(), 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())); + } + } + + 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(); + elementAdapter.write(out, obj); + } + + @Override + public InitialValue read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index a4af7fa..4d6865e 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetail.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetail.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,359 +10,362 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * IntegrationLinkDetail - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** IntegrationLinkDetail */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Get setting + * + * @return setting + */ + @javax.annotation.Nullable + public SettingDataModel getSetting() { + return setting; } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + public void setSetting(SettingDataModel setting) { + this.setting = setting; } - 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("}"); - 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"; + + public IntegrationLinkDetail readOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; } - 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())); + + /** + * 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; + } + + @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); + } + + 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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IntegrationLinkDetail.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IntegrationLinkDetail` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public IntegrationLinkDetail read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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("}"); + 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(); } - } - - /** - * 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); - } -} + /** + * 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IntegrationLinkDetail.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `IntegrationLinkDetail` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public IntegrationLinkDetail read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index d72f823..ea64a03 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetailsModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetailsModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,248 +10,254 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * IntegrationLinkDetailsModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** IntegrationLinkDetailsModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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 static final String SERIALIZED_NAME_DETAILS = "details"; - public IntegrationLinkDetailsModel( - List details - ) { - this(); - this.details = details; - } + @SerializedName(SERIALIZED_NAME_DETAILS) + private List details; - /** - * Get details - * @return details - */ - @javax.annotation.Nullable - public List getDetails() { - return 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 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; - } + 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; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + /** + * Get allIntegrationLinkCount + * + * @return allIntegrationLinkCount + */ + @javax.annotation.Nullable + public Integer getAllIntegrationLinkCount() { + return allIntegrationLinkCount; } - if (o == null || getClass() != o.getClass()) { - return false; + + public void setAllIntegrationLinkCount(Integer allIntegrationLinkCount) { + this.allIntegrationLinkCount = allIntegrationLinkCount; } - IntegrationLinkDetailsModel integrationLinkDetailsModel = (IntegrationLinkDetailsModel) o; - return Objects.equals(this.details, integrationLinkDetailsModel.details) && - Objects.equals(this.allIntegrationLinkCount, integrationLinkDetailsModel.allIntegrationLinkCount); - } - 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 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); + } - @Override - public int hashCode() { - return Objects.hash(details, allIntegrationLinkCount); - } + 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())); + } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + @Override + public int hashCode() { + return Objects.hash(details, allIntegrationLinkCount); } - 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("}"); - return sb.toString(); - } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } - /** - * 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"; + @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("}"); + return sb.toString(); } - return o.toString().replace("\n", "\n "); - } + /** + * 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; + 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"); + 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(); - } + // 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())); + /** + * 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IntegrationLinkDetailsModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IntegrationLinkDetailsModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IntegrationLinkDetailsModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `IntegrationLinkDetailsModel` properties. JSON: %s", + entry.getKey(), jsonElement.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)); - }; + 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(); - elementAdapter.write(out, obj); - } - - @Override - public IntegrationLinkDetailsModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } + } - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public IntegrationLinkDetailsModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); - } + /** + * 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); - } + /** + * 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 index b46ff82..5b4021c 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,354 +10,316 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * IntegrationLinkModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** IntegrationLinkModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - - /** - * Gets or Sets integrationLinkType - */ - @JsonAdapter(IntegrationLinkTypeEnum.Adapter.class) - public enum IntegrationLinkTypeEnum { - TRELLO("trello"), - - JIRA("jira"), - - MONDAY("monday"); - - private String value; - - IntegrationLinkTypeEnum(String value) { - this.value = value; + 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; } - public String getValue() { - return value; + /** + * Get key + * + * @return key + */ + @javax.annotation.Nullable + public String getKey() { + return key; } - @Override - public String toString() { - return String.valueOf(value); + 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; } - public static IntegrationLinkTypeEnum fromValue(String value) { - for (IntegrationLinkTypeEnum b : IntegrationLinkTypeEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + 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); } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final IntegrationLinkTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public IntegrationLinkTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return IntegrationLinkTypeEnum.fromValue(value); - } + 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())); } - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - IntegrationLinkTypeEnum.fromValue(value); + @Override + public int hashCode() { + return Objects.hash(key, description, integrationLinkType, url); } - } - - public static final String SERIALIZED_NAME_INTEGRATION_LINK_TYPE = "integrationLinkType"; - @SerializedName(SERIALIZED_NAME_INTEGRATION_LINK_TYPE) - private IntegrationLinkTypeEnum 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(IntegrationLinkTypeEnum integrationLinkType) { - this.integrationLinkType = integrationLinkType; - return this; - } - - /** - * Get integrationLinkType - * @return integrationLinkType - */ - @javax.annotation.Nullable - public IntegrationLinkTypeEnum getIntegrationLinkType() { - return integrationLinkType; - } - - public void setIntegrationLinkType(IntegrationLinkTypeEnum 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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; } - if (o == null || getClass() != o.getClass()) { - return false; + + @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("}"); + return sb.toString(); } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + /** + * 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 "); } - 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("}"); - 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"; + + 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(); } - 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())); + + /** + * 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IntegrationLinkModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IntegrationLinkModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IntegrationLinkModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `IntegrationLinkModel` properties. JSON: %s", + entry.getKey(), 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())); - } - if ((jsonObj.get("integrationLinkType") != null && !jsonObj.get("integrationLinkType").isJsonNull()) && !jsonObj.get("integrationLinkType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `integrationLinkType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("integrationLinkType").toString())); - } - // validate the optional field `integrationLinkType` - if (jsonObj.get("integrationLinkType") != null && !jsonObj.get("integrationLinkType").isJsonNull()) { - IntegrationLinkTypeEnum.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(); - elementAdapter.write(out, obj); - } - - @Override - public IntegrationLinkModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public IntegrationLinkModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); - } -} + /** + * 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..87a451c --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationLinkType.java @@ -0,0 +1,74 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** 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 index 80d0b3b..3817b34 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,477 +10,447 @@ * 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.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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * Details of the Integration. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** Details of the Integration. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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_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 static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; - @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) - private UUID integrationId; + public void setName(String name) { + this.name = name; + } + + public IntegrationModel integrationType(IntegrationType integrationType) { + this.integrationType = integrationType; + return this; + } - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; + /** + * Get integrationType + * + * @return integrationType + */ + @javax.annotation.Nullable + public IntegrationType getIntegrationType() { + return integrationType; + } - /** - * Type of the Integration. - */ - @JsonAdapter(IntegrationTypeEnum.Adapter.class) - public enum IntegrationTypeEnum { - DATA_DOG("dataDog"), - - SLACK("slack"), - - AMPLITUDE("amplitude"), - - MIX_PANEL("mixPanel"), - - SEGMENT("segment"), - - PUB_NUB("pubNub"); + public void setIntegrationType(IntegrationType integrationType) { + this.integrationType = integrationType; + } - private String value; + public IntegrationModel parameters(Map parameters) { + this.parameters = parameters; + return this; + } - IntegrationTypeEnum(String value) { - this.value = value; + public IntegrationModel putParametersItem(String key, String parametersItem) { + if (this.parameters == null) { + this.parameters = new HashMap<>(); + } + this.parameters.put(key, parametersItem); + return this; } - public String getValue() { - return value; + /** + * 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; } @Override - public String toString() { - return String.valueOf(value); + 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); + } + + 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())); } - public static IntegrationTypeEnum fromValue(String value) { - for (IntegrationTypeEnum b : IntegrationTypeEnum.values()) { - if (b.value.equals(value)) { - return b; + @Override + public int hashCode() { + return Objects.hash( + product, + integrationId, + name, + integrationType, + parameters, + environmentIds, + configIds); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + 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("}"); + return sb.toString(); } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final IntegrationTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } + /** + * 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 "); + } - @Override - public IntegrationTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return IntegrationTypeEnum.fromValue(value); - } + 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 { - String value = jsonElement.getAsString(); - IntegrationTypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_INTEGRATION_TYPE = "integrationType"; - @SerializedName(SERIALIZED_NAME_INTEGRATION_TYPE) - private IntegrationTypeEnum 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(IntegrationTypeEnum integrationType) { - this.integrationType = integrationType; - return this; - } - - /** - * Type of the Integration. - * @return integrationType - */ - @javax.annotation.Nullable - public IntegrationTypeEnum getIntegrationType() { - return integrationType; - } - - public void setIntegrationType(IntegrationTypeEnum 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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IntegrationModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IntegrationModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IntegrationModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `IntegrationModel` properties. JSON: %s", + entry.getKey(), jsonElement.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())); - } - if ((jsonObj.get("integrationType") != null && !jsonObj.get("integrationType").isJsonNull()) && !jsonObj.get("integrationType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `integrationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("integrationType").toString())); - } - // validate the optional field `integrationType` - if (jsonObj.get("integrationType") != null && !jsonObj.get("integrationType").isJsonNull()) { - IntegrationTypeEnum.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(); - elementAdapter.write(out, obj); - } - - @Override - public IntegrationModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + // 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(); + elementAdapter.write(out, obj); + } + + @Override + public IntegrationModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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..3d5ba5e --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationType.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 com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** 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 index 6cf3a04..578bb5d 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/IntegrationsModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/IntegrationsModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,231 +10,233 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * IntegrationsModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** IntegrationsModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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 static final String SERIALIZED_NAME_INTEGRATIONS = "integrations"; - public IntegrationsModel() { - } + @SerializedName(SERIALIZED_NAME_INTEGRATIONS) + private List integrations; - public IntegrationsModel integrations(List integrations) { - this.integrations = integrations; - return this; - } + public IntegrationsModel() {} - public IntegrationsModel addIntegrationsItem(IntegrationModel integrationsItem) { - if (this.integrations == null) { - this.integrations = new ArrayList<>(); + public IntegrationsModel integrations(List integrations) { + this.integrations = integrations; + return this; } - this.integrations.add(integrationsItem); - return this; - } - /** - * The Integrations of the Product. - * @return integrations - */ - @javax.annotation.Nullable - public List getIntegrations() { - return integrations; - } + public IntegrationsModel addIntegrationsItem(IntegrationModel integrationsItem) { + if (this.integrations == null) { + this.integrations = new ArrayList<>(); + } + this.integrations.add(integrationsItem); + return this; + } - public void setIntegrations(List integrations) { - this.integrations = integrations; - } + /** + * The Integrations of the Product. + * + * @return integrations + */ + @javax.annotation.Nullable + public List getIntegrations() { + return integrations; + } + public void setIntegrations(List integrations) { + this.integrations = integrations; + } + @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); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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())); } - if (o == null || getClass() != o.getClass()) { - return false; + + @Override + public int hashCode() { + return Objects.hash(integrations); } - IntegrationsModel integrationsModel = (IntegrationsModel) o; - return Objects.equals(this.integrations, integrationsModel.integrations); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + 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("}"); + 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 "); } - 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("}"); - 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"; + + 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(); } - 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())); + + /** + * 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IntegrationsModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IntegrationsModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IntegrationsModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `IntegrationsModel` properties. JSON: %s", + entry.getKey(), jsonElement.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)); - }; + 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(); - elementAdapter.write(out, obj); - } - - @Override - public IntegrationsModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public IntegrationsModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); } - } - - /** - * 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); - } -} + /** + * 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 index 153d83e..cf7684b 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/InvitationModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/InvitationModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,318 +10,331 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.time.OffsetDateTime; +import java.util.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * InvitationModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** InvitationModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; } - if (o == null || getClass() != o.getClass()) { - return false; + + public InvitationModel permissionGroupId(Long permissionGroupId) { + this.permissionGroupId = permissionGroupId; + return this; } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + /** + * The identifier of the Permission Group the user was invited to. + * + * @return permissionGroupId + */ + @javax.annotation.Nullable + public Long getPermissionGroupId() { + return permissionGroupId; } - 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("}"); - 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"; + + public void setPermissionGroupId(Long permissionGroupId) { + this.permissionGroupId = permissionGroupId; } - 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())); + + 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; + } + + @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); + } + + 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())); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!InvitationModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvitationModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + @Override + public int hashCode() { + return Objects.hash(invitationId, email, permissionGroupId, createdAt, expired); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public InvitationModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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("}"); + return sb.toString(); } - } - - /** - * 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); - } -} + /** + * 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!InvitationModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `InvitationModel` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public InvitationModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index c97e2c8..4e325da 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/InviteMembersRequest.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/InviteMembersRequest.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,245 +10,248 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; -import com.configcat.publicapi.java.client.JSON; - -/** - * InviteMembersRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** InviteMembersRequest */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @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); - } - - @Override - public int hashCode() { - return Objects.hash(emails, permissionGroupId); - } - - @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("}"); - 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())); + 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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(emails, permissionGroupId); + } + + @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("}"); + 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!InviteMembersRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InviteMembersRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!InviteMembersRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `InviteMembersRequest` properties. JSON: %s", + entry.getKey(), jsonElement.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())); + // 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(); - elementAdapter.write(out, obj); - } - - @Override - public InviteMembersRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + // 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(); + elementAdapter.write(out, obj); + } + + @Override + public InviteMembersRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 4cff424..357fb37 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/JsonPatchOperation.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/JsonPatchOperation.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,366 +10,313 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * JsonPatchOperation - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** JsonPatchOperation */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[Etc/UTC]", + comments = "Generator version: 7.7.0") public class JsonPatchOperation { - /** - * The JSON Patch operation. (https://jsonpatch.com) - */ - @JsonAdapter(OpEnum.Adapter.class) - public enum OpEnum { - UNKNOWN("unknown"), - - ADD("add"), - - REMOVE("remove"), - - REPLACE("replace"), - - MOVE("move"), - - COPY("copy"), - - TEST("test"); - - private String value; - - OpEnum(String value) { - this.value = value; + 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; } - public String getValue() { - return value; + /** + * Get op + * + * @return op + */ + @javax.annotation.Nonnull + public OperationType getOp() { + return op; } - @Override - public String toString() { - return String.valueOf(value); + 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 static OpEnum fromValue(String value) { - for (OpEnum b : OpEnum.values()) { - if (b.value.equals(value)) { - return b; + 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + 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); } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final OpEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public OpEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return OpEnum.fromValue(value); - } + 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())); } - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - OpEnum.fromValue(value); + @Override + public int hashCode() { + return Objects.hash(op, path, from, value); } - } - - public static final String SERIALIZED_NAME_OP = "op"; - @SerializedName(SERIALIZED_NAME_OP) - private OpEnum 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(OpEnum op) { - this.op = op; - return this; - } - - /** - * The JSON Patch operation. (https://jsonpatch.com) - * @return op - */ - @javax.annotation.Nonnull - public OpEnum getOp() { - return op; - } - - public void setOp(OpEnum 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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; } - if (o == null || getClass() != o.getClass()) { - return false; + + @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("}"); + return sb.toString(); } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + /** + * 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 "); } - 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("}"); - 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"; + + 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"); } - 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())); + + /** + * 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!JsonPatchOperation.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JsonPatchOperation` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!JsonPatchOperation.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `JsonPatchOperation` properties. JSON: %s", + entry.getKey(), jsonElement.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())); + // 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(); - if (!jsonObj.get("op").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `op` to be a primitive type in the JSON string but got `%s`", jsonObj.get("op").toString())); - } - // validate the required field `op` - OpEnum.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(); - elementAdapter.write(out, obj); - } - - @Override - public JsonPatchOperation read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + // 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(); + elementAdapter.write(out, obj); + } + + @Override + public JsonPatchOperation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); - } -} + /** + * 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..f839528 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/KeyGenerationMode.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 com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** 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 index b77a22d..9b76f19 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/MeModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/MeModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,231 +10,233 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * MeModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** MeModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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_EMAIL = "email"; - public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; - @SerializedName(SERIALIZED_NAME_FULL_NAME) - private String fullName; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; - public MeModel() { - } + public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; - public MeModel( - String email, - String fullName - ) { - this(); - this.email = email; - this.fullName = fullName; - } + @SerializedName(SERIALIZED_NAME_FULL_NAME) + private String fullName; - /** - * Get email - * @return email - */ - @javax.annotation.Nullable - public String getEmail() { - return email; - } + 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; - } + /** + * Get fullName + * + * @return fullName + */ + @javax.annotation.Nullable + public String getFullName() { + return fullName; + } + @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); + } + 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); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; } - if (o == null || getClass() != o.getClass()) { - return false; + + @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("}"); + return sb.toString(); } - MeModel meModel = (MeModel) o; - return Objects.equals(this.email, meModel.email) && - Objects.equals(this.fullName, meModel.fullName); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + /** + * 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 "); } - 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("}"); - 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"; + + 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(); } - 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())); + + /** + * 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MeModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MeModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MeModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `MeModel`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.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(); - elementAdapter.write(out, obj); - } - - @Override - public MeModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public MeModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); } - } - - /** - * 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); - } -} + /** + * 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 index 2d4e1b3..e15a5ac 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/MemberModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/MemberModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,323 +10,345 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * MemberModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** MemberModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Identifier of the Member's Permission Group. + * + * @return permissionGroupId + */ + @javax.annotation.Nullable + public Long getPermissionGroupId() { + return permissionGroupId; } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + public void setPermissionGroupId(Long permissionGroupId) { + this.permissionGroupId = permissionGroupId; } - 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("}"); - 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"; + + public MemberModel fullName(String fullName) { + this.fullName = fullName; + return this; } - 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())); + + /** + * 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; + } + + @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); + } + + 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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MemberModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MemberModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public MemberModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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("}"); + return sb.toString(); } - } - - /** - * 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); - } -} + /** + * 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MemberModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `MemberModel` properties. JSON: %s", + entry.getKey(), 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") != 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(); + elementAdapter.write(out, obj); + } + + @Override + public MemberModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 439a8cf..d75445e 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/ModifyIntegrationRequest.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/ModifyIntegrationRequest.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,327 +10,342 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; -import com.configcat.publicapi.java.client.JSON; - -/** - * ModifyIntegrationRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** ModifyIntegrationRequest */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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<>(); + 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; } - 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<>(); + + /** + * Parameters of the Integration. + * + * @return parameters + */ + @javax.annotation.Nonnull + public Map getParameters() { + return parameters; } - 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<>(); + + public void setParameters(Map parameters) { + this.parameters = parameters; } - 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 ModifyIntegrationRequest environmentIds(List environmentIds) { + this.environmentIds = environmentIds; + return this; + } - public void setConfigIds(List configIds) { - this.configIds = configIds; - } + 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; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public ModifyIntegrationRequest configIds(List configIds) { + this.configIds = configIds; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + public ModifyIntegrationRequest addConfigIdsItem(UUID configIdsItem) { + if (this.configIds == null) { + this.configIds = new ArrayList<>(); + } + this.configIds.add(configIdsItem); + return this; } - 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); - } - - @Override - public int hashCode() { - return Objects.hash(name, parameters, environmentIds, configIds); - } - - @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("}"); - 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"; + + /** + * 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; } - 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())); + + public void setConfigIds(List configIds) { + this.configIds = configIds; + } + + @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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ModifyIntegrationRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModifyIntegrationRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + @Override + public int hashCode() { + return Objects.hash(name, parameters, environmentIds, configIds); + } + + @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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ModifyIntegrationRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ModifyIntegrationRequest` properties. JSON: %s", + entry.getKey(), jsonElement.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())); + // 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(); - elementAdapter.write(out, obj); - } - - @Override - public ModifyIntegrationRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public ModifyIntegrationRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); } - } - - /** - * 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); - } -} + /** + * 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..5b93f3a --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/OperationType.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 com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** 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 index 3cb1ac8..fcccc67 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationAdminModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationAdminModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,293 +10,308 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * Describes an Organization Admin. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** Describes an Organization Admin. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; } - if (o == null || getClass() != o.getClass()) { - return false; + + public OrganizationAdminModel twoFactorEnabled(Boolean twoFactorEnabled) { + this.twoFactorEnabled = twoFactorEnabled; + return this; } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + /** + * Determines whether 2FA is enabled for the Organization Admin. + * + * @return twoFactorEnabled + */ + @javax.annotation.Nullable + public Boolean getTwoFactorEnabled() { + return twoFactorEnabled; } - 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("}"); - 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"; + + public void setTwoFactorEnabled(Boolean twoFactorEnabled) { + this.twoFactorEnabled = twoFactorEnabled; } - 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())); + + @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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrganizationAdminModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OrganizationAdminModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + 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); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public OrganizationAdminModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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("}"); + return sb.toString(); } - } - - /** - * 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); - } -} + /** + * 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrganizationAdminModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OrganizationAdminModel` properties. JSON: %s", + entry.getKey(), 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 (!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(); + elementAdapter.write(out, obj); + } + + @Override + public OrganizationAdminModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index f3fe679..e9eb385 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationInvitationModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationInvitationModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,402 +10,439 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.time.OffsetDateTime; +import java.util.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * OrganizationInvitationModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** OrganizationInvitationModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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; + } + + @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); + } + + 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); + } + + 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("}"); + 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(); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrganizationInvitationModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OrganizationInvitationModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + /** + * 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrganizationInvitationModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OrganizationInvitationModel` properties. JSON: %s", + entry.getKey(), jsonElement.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(); - elementAdapter.write(out, obj); - } - - @Override - public OrganizationInvitationModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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(); + elementAdapter.write(out, obj); + } + + @Override + public OrganizationInvitationModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index a7a18f0..0fe5814 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationMemberModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationMemberModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,344 +10,366 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * Describes an Organization Member. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** Describes an Organization Member. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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<>(); + 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; } - this.permissions.add(permissionsItem); - return this; - } - /** - * The permissions of the Member. - * @return permissions - */ - @javax.annotation.Nullable - public List getPermissions() { - return permissions; - } + /** + * Identifier of the Organization Admin. + * + * @return userId + */ + @javax.annotation.Nullable + public String getUserId() { + return userId; + } - public void setPermissions(List permissions) { - this.permissions = permissions; - } + 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; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public void setFullName(String fullName) { + this.fullName = fullName; } - if (o == null || getClass() != o.getClass()) { - return false; + + public OrganizationMemberModel email(String email) { + this.email = email; + return this; } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + /** + * Email of the OrganizationAdmin. + * + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; } - 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("}"); - 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"; + + public void setEmail(String email) { + this.email = email; } - 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())); + + 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; + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrganizationMemberModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OrganizationMemberModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - } - 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)); - }; + 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); + } + + 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())); + } - 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(); - elementAdapter.write(out, obj); - } - - @Override - public OrganizationMemberModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + public int hashCode() { + return Objects.hash(userId, fullName, email, twoFactorEnabled, permissions); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; } - } - - /** - * 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); - } -} + @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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrganizationMemberModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OrganizationMemberModel` properties. JSON: %s", + entry.getKey(), 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())); + } + 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(); + elementAdapter.write(out, obj); + } + + @Override + public OrganizationMemberModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 93e2c45..cc945db 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationMembersModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationMembersModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,328 +10,344 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * OrganizationMembersModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** OrganizationMembersModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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_ADMINS = "admins"; - public static final String SERIALIZED_NAME_BILLING_MANAGERS = "billingManagers"; - @SerializedName(SERIALIZED_NAME_BILLING_MANAGERS) - private List billingManagers; + @SerializedName(SERIALIZED_NAME_ADMINS) + private List admins; - public static final String SERIALIZED_NAME_MEMBERS = "members"; - @SerializedName(SERIALIZED_NAME_MEMBERS) - private List members; + public static final String SERIALIZED_NAME_BILLING_MANAGERS = "billingManagers"; - public OrganizationMembersModel() { - } + @SerializedName(SERIALIZED_NAME_BILLING_MANAGERS) + private List billingManagers; - public OrganizationMembersModel admins(List admins) { - this.admins = admins; - return this; - } + public static final String SERIALIZED_NAME_MEMBERS = "members"; - public OrganizationMembersModel addAdminsItem(OrganizationAdminModel adminsItem) { - if (this.admins == null) { - this.admins = new ArrayList<>(); + @SerializedName(SERIALIZED_NAME_MEMBERS) + private List members; + + public OrganizationMembersModel() {} + + public OrganizationMembersModel admins(List admins) { + this.admins = admins; + return this; } - 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<>(); + + public OrganizationMembersModel addAdminsItem(OrganizationAdminModel adminsItem) { + if (this.admins == null) { + this.admins = new ArrayList<>(); + } + this.admins.add(adminsItem); + return this; } - 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<>(); + + /** + * List of Organization Admins. + * + * @return admins + */ + @javax.annotation.Nullable + public List getAdmins() { + return admins; } - this.members.add(membersItem); - return this; - } - /** - * List of Organization Members. - * @return members - */ - @javax.annotation.Nullable - public List getMembers() { - return members; - } + public void setAdmins(List admins) { + this.admins = admins; + } - public void setMembers(List members) { - this.members = members; - } + 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; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public void setBillingManagers(List billingManagers) { + this.billingManagers = billingManagers; } - if (o == null || getClass() != o.getClass()) { - return false; + + public OrganizationMembersModel members(List members) { + this.members = members; + return this; } - OrganizationMembersModel organizationMembersModel = (OrganizationMembersModel) o; - return Objects.equals(this.admins, organizationMembersModel.admins) && - Objects.equals(this.billingManagers, organizationMembersModel.billingManagers) && - Objects.equals(this.members, organizationMembersModel.members); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + public OrganizationMembersModel addMembersItem(OrganizationMemberModel membersItem) { + if (this.members == null) { + this.members = new ArrayList<>(); + } + this.members.add(membersItem); + return this; } - 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("}"); - 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"; + + /** + * List of Organization Members. + * + * @return members + */ + @javax.annotation.Nullable + public List getMembers() { + return members; + } + + public void setMembers(List members) { + this.members = members; + } + + @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); + } + + 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())); } - 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())); + + @Override + public int hashCode() { + return Objects.hash(admins, billingManagers, members); + } + + 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("}"); + return sb.toString(); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrganizationMembersModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OrganizationMembersModel` properties. JSON: %s", entry.getKey(), jsonElement.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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrganizationMembersModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OrganizationMembersModel` properties. JSON: %s", + entry.getKey(), jsonElement.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("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("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)); - }; + 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(); - elementAdapter.write(out, obj); - } - - @Override - public OrganizationMembersModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public OrganizationMembersModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); - } -} + /** + * 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 index be94d0b..da995cc 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,239 +10,247 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * Details of the Organization. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** Details of the Organization. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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; + } + + @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); + } + + 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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrganizationModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OrganizationModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public OrganizationModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrganizationModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OrganizationModel` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public OrganizationModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 42e7193..4bd97c2 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationPermissionGroupModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationPermissionGroupModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,235 +10,247 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -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 = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** Describes the Member's Permission Group within a Product. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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; + } + + @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); + } + + 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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrganizationPermissionGroupModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OrganizationPermissionGroupModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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())); - } - } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } - 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(); - elementAdapter.write(out, obj); - } - - @Override - public OrganizationPermissionGroupModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrganizationPermissionGroupModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OrganizationPermissionGroupModel` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public OrganizationPermissionGroupModel read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index de8a519..54529e8 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationPermissionModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationPermissionModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,230 +10,225 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Objects; 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 = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** Describes the Member's permission. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Get product + * + * @return product + */ + @javax.annotation.Nullable + public OrganizationProductModel getProduct() { + return product; } - OrganizationPermissionModel organizationPermissionModel = (OrganizationPermissionModel) o; - return Objects.equals(this.product, organizationPermissionModel.product) && - Objects.equals(this.permissionGroup, organizationPermissionModel.permissionGroup); - } - - @Override - public int hashCode() { - return Objects.hash(product, permissionGroup); - } - - @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("}"); - 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"; + + public void setProduct(OrganizationProductModel product) { + this.product = product; } - 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())); + + 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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(product, permissionGroup); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrganizationPermissionModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OrganizationPermissionModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + @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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrganizationPermissionModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OrganizationPermissionModel` properties. JSON: %s", + entry.getKey(), jsonElement.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(); - elementAdapter.write(out, obj); - } - - @Override - public OrganizationPermissionModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + // 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")); + } } - } - - /** - * 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); - } -} + 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(); + elementAdapter.write(out, obj); + } + + @Override + public OrganizationPermissionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index df40bad..22581fc 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/OrganizationProductModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/OrganizationProductModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,239 +10,248 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * Describes the Member's Product. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** Describes the Member's Product. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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; + } + + @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); + } + + 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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrganizationProductModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OrganizationProductModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public OrganizationProductModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrganizationProductModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OrganizationProductModel` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public OrganizationProductModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 4bd0dcf..c1e3f87 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/PercentageOptionModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/PercentageOptionModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,232 +10,226 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Objects; import java.util.Set; -import com.configcat.publicapi.java.client.JSON; - -/** - * PercentageOptionModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** PercentageOptionModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(percentage, value); + } + + @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("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * 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 "); } - PercentageOptionModel percentageOptionModel = (PercentageOptionModel) o; - return Objects.equals(this.percentage, percentageOptionModel.percentage) && - Objects.equals(this.value, percentageOptionModel.value); - } - - @Override - public int hashCode() { - return Objects.hash(percentage, value); - } - - @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("}"); - 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"; + + 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"); } - 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())); + + /** + * 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PercentageOptionModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PercentageOptionModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PercentageOptionModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PercentageOptionModel` properties. JSON: %s", + entry.getKey(), jsonElement.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())); + // 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")); - } + // 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(); - elementAdapter.write(out, obj); - } - - @Override - public PercentageOptionModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public PercentageOptionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); - } -} + /** + * 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 index e7f5c87..d6b1664 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/PermissionGroupModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/PermissionGroupModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,1011 +10,1043 @@ * Do not edit the class manually. */ - package com.configcat.publicapi.java.client.model; -import java.util.Objects; -import com.configcat.publicapi.java.client.model.EnvironmentAccessModel; -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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * PermissionGroupModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** PermissionGroupModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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_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"; - public static final String SERIALIZED_NAME_CAN_MANAGE_MEMBERS = "canManageMembers"; - @SerializedName(SERIALIZED_NAME_CAN_MANAGE_MEMBERS) - private Boolean canManageMembers; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_CONFIG) + private Boolean canCreateOrUpdateConfig; - 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"; - public static final String SERIALIZED_NAME_CAN_DELETE_CONFIG = "canDeleteConfig"; - @SerializedName(SERIALIZED_NAME_CAN_DELETE_CONFIG) - private Boolean 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_CREATE_OR_UPDATE_ENVIRONMENT = + "canCreateOrUpdateEnvironment"; - public static final String SERIALIZED_NAME_CAN_DELETE_ENVIRONMENT = "canDeleteEnvironment"; - @SerializedName(SERIALIZED_NAME_CAN_DELETE_ENVIRONMENT) - private Boolean canDeleteEnvironment; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_ENVIRONMENT) + private Boolean canCreateOrUpdateEnvironment; - 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_DELETE_ENVIRONMENT = "canDeleteEnvironment"; - public static final String SERIALIZED_NAME_CAN_TAG_SETTING = "canTagSetting"; - @SerializedName(SERIALIZED_NAME_CAN_TAG_SETTING) - private Boolean canTagSetting; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_ENVIRONMENT) + private Boolean canDeleteEnvironment; - 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_SETTING = + "canCreateOrUpdateSetting"; - public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_TAG = "canCreateOrUpdateTag"; - @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_TAG) - private Boolean canCreateOrUpdateTag; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SETTING) + private Boolean canCreateOrUpdateSetting; - 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_TAG_SETTING = "canTagSetting"; - public static final String SERIALIZED_NAME_CAN_MANAGE_WEBHOOK = "canManageWebhook"; - @SerializedName(SERIALIZED_NAME_CAN_MANAGE_WEBHOOK) - private Boolean canManageWebhook; + @SerializedName(SERIALIZED_NAME_CAN_TAG_SETTING) + private Boolean canTagSetting; - 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_DELETE_SETTING = "canDeleteSetting"; - public static final String SERIALIZED_NAME_CAN_MANAGE_PRODUCT_PREFERENCES = "canManageProductPreferences"; - @SerializedName(SERIALIZED_NAME_CAN_MANAGE_PRODUCT_PREFERENCES) - private Boolean canManageProductPreferences; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_SETTING) + private Boolean canDeleteSetting; - 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_CREATE_OR_UPDATE_TAG = "canCreateOrUpdateTag"; - public static final String SERIALIZED_NAME_CAN_VIEW_SDK_KEY = "canViewSdkKey"; - @SerializedName(SERIALIZED_NAME_CAN_VIEW_SDK_KEY) - private Boolean canViewSdkKey; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_TAG) + private Boolean canCreateOrUpdateTag; - 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_DELETE_TAG = "canDeleteTag"; - public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SEGMENTS = "canCreateOrUpdateSegments"; - @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SEGMENTS) - private Boolean canCreateOrUpdateSegments; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_TAG) + private Boolean canDeleteTag; - 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_MANAGE_WEBHOOK = "canManageWebhook"; - public static final String SERIALIZED_NAME_CAN_VIEW_PRODUCT_AUDIT_LOG = "canViewProductAuditLog"; - @SerializedName(SERIALIZED_NAME_CAN_VIEW_PRODUCT_AUDIT_LOG) - private Boolean canViewProductAuditLog; + @SerializedName(SERIALIZED_NAME_CAN_MANAGE_WEBHOOK) + private Boolean canManageWebhook; - 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_USE_EXPORT_IMPORT = "canUseExportImport"; - /** - * Represent the Feature Management permission. - */ - @JsonAdapter(AccessTypeEnum.Adapter.class) - public enum AccessTypeEnum { - READ_ONLY("readOnly"), - - FULL("full"), - - CUSTOM("custom"); + @SerializedName(SERIALIZED_NAME_CAN_USE_EXPORT_IMPORT) + private Boolean canUseExportImport; - private String value; + public static final String SERIALIZED_NAME_CAN_MANAGE_PRODUCT_PREFERENCES = + "canManageProductPreferences"; - AccessTypeEnum(String value) { - this.value = value; + @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; } - public String getValue() { - return value; + /** + * Identifier of the Permission Group. + * + * @return permissionGroupId + */ + @javax.annotation.Nullable + public Long getPermissionGroupId() { + return permissionGroupId; } - @Override - public String toString() { - return String.valueOf(value); + 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 static AccessTypeEnum fromValue(String value) { - for (AccessTypeEnum b : AccessTypeEnum.values()) { - if (b.value.equals(value)) { - return b; + 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<>(); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + this.environmentAccesses.add(environmentAccessesItem); + return this; } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AccessTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } + /** + * List of environment specific permissions. + * + * @return environmentAccesses + */ + @javax.annotation.Nullable + public List getEnvironmentAccesses() { + return environmentAccesses; + } - @Override - public AccessTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AccessTypeEnum.fromValue(value); - } + public void setEnvironmentAccesses(List environmentAccesses) { + this.environmentAccesses = environmentAccesses; } - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - AccessTypeEnum.fromValue(value); + public PermissionGroupModel product(ProductModel product) { + this.product = product; + return this; } - } - public static final String SERIALIZED_NAME_ACCESS_TYPE = "accessType"; - @SerializedName(SERIALIZED_NAME_ACCESS_TYPE) - private AccessTypeEnum accessType; + /** + * Get product + * + * @return product + */ + @javax.annotation.Nullable + public ProductModel getProduct() { + return product; + } - /** - * Represent the environment specific Feature Management permission. - */ - @JsonAdapter(NewEnvironmentAccessTypeEnum.Adapter.class) - public enum NewEnvironmentAccessTypeEnum { - FULL("full"), - - READ_ONLY("readOnly"), - - NONE("none"); + public void setProduct(ProductModel product) { + this.product = product; + } + + @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); + } - private String value; + 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())); + } - NewEnvironmentAccessTypeEnum(String value) { - this.value = value; + @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); } - public String getValue() { - return value; + 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() { - return String.valueOf(value); + 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("}"); + return sb.toString(); } - public static NewEnvironmentAccessTypeEnum fromValue(String value) { - for (NewEnvironmentAccessTypeEnum b : NewEnvironmentAccessTypeEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * 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"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return o.toString().replace("\n", "\n "); } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final NewEnvironmentAccessTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public NewEnvironmentAccessTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return NewEnvironmentAccessTypeEnum.fromValue(value); - } + 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 { - String value = jsonElement.getAsString(); - NewEnvironmentAccessTypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_NEW_ENVIRONMENT_ACCESS_TYPE = "newEnvironmentAccessType"; - @SerializedName(SERIALIZED_NAME_NEW_ENVIRONMENT_ACCESS_TYPE) - private NewEnvironmentAccessTypeEnum 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 accessType(AccessTypeEnum accessType) { - this.accessType = accessType; - return this; - } - - /** - * Represent the Feature Management permission. - * @return accessType - */ - @javax.annotation.Nullable - public AccessTypeEnum getAccessType() { - return accessType; - } - - public void setAccessType(AccessTypeEnum accessType) { - this.accessType = accessType; - } - - - public PermissionGroupModel newEnvironmentAccessType(NewEnvironmentAccessTypeEnum newEnvironmentAccessType) { - this.newEnvironmentAccessType = newEnvironmentAccessType; - return this; - } - - /** - * Represent the environment specific Feature Management permission. - * @return newEnvironmentAccessType - */ - @javax.annotation.Nullable - public NewEnvironmentAccessTypeEnum getNewEnvironmentAccessType() { - return newEnvironmentAccessType; - } - - public void setNewEnvironmentAccessType(NewEnvironmentAccessTypeEnum 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; - } - - - - @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.accessType, permissionGroupModel.accessType) && - Objects.equals(this.newEnvironmentAccessType, permissionGroupModel.newEnvironmentAccessType) && - Objects.equals(this.environmentAccesses, permissionGroupModel.environmentAccesses) && - Objects.equals(this.product, permissionGroupModel.product); - } - - 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, accessType, newEnvironmentAccessType, environmentAccesses, product); - } - - 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(" 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("}"); - 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("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())); + 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PermissionGroupModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PermissionGroupModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PermissionGroupModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PermissionGroupModel` properties. JSON: %s", + entry.getKey(), jsonElement.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("accessType") != null && !jsonObj.get("accessType").isJsonNull()) && !jsonObj.get("accessType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `accessType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accessType").toString())); - } - // validate the optional field `accessType` - if (jsonObj.get("accessType") != null && !jsonObj.get("accessType").isJsonNull()) { - AccessTypeEnum.validateJsonElement(jsonObj.get("accessType")); - } - if ((jsonObj.get("newEnvironmentAccessType") != null && !jsonObj.get("newEnvironmentAccessType").isJsonNull()) && !jsonObj.get("newEnvironmentAccessType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `newEnvironmentAccessType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("newEnvironmentAccessType").toString())); - } - // validate the optional field `newEnvironmentAccessType` - if (jsonObj.get("newEnvironmentAccessType") != null && !jsonObj.get("newEnvironmentAccessType").isJsonNull()) { - NewEnvironmentAccessTypeEnum.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)); - }; + 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 `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(); - elementAdapter.write(out, obj); - } - - @Override - public PermissionGroupModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + // 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(); + elementAdapter.write(out, obj); + } + + @Override + public PermissionGroupModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 38ffc17..d0218a5 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/PreferencesModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/PreferencesModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,400 +10,366 @@ * Do not edit the class manually. */ - package com.configcat.publicapi.java.client.model; -import java.util.Objects; -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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * PreferencesModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** PreferencesModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - - /** - * Determines the Feature Flag key generation mode. - */ - @JsonAdapter(KeyGenerationModeEnum.Adapter.class) - public enum KeyGenerationModeEnum { - CAMEL_CASE("camelCase"), - - LOWER_CASE("lowerCase"), - - UPPER_CASE("upperCase"), - - PASCAL_CASE("pascalCase"), - - KEBAB_CASE("kebabCase"); - - private String value; - - KeyGenerationModeEnum(String value) { - this.value = value; + 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; } - public String getValue() { - return value; + /** + * Indicates that a mandatory note required for saving and publishing. + * + * @return reasonRequired + */ + @javax.annotation.Nullable + public Boolean getReasonRequired() { + return reasonRequired; } - @Override - public String toString() { - return String.valueOf(value); + 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; } - public static KeyGenerationModeEnum fromValue(String value) { - for (KeyGenerationModeEnum b : KeyGenerationModeEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * 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<>(); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + this.reasonRequiredEnvironments.add(reasonRequiredEnvironmentsItem); + return this; } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final KeyGenerationModeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public KeyGenerationModeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return KeyGenerationModeEnum.fromValue(value); - } + /** + * List of Environments where mandatory note must be set before saving and publishing. + * + * @return reasonRequiredEnvironments + */ + @javax.annotation.Nullable + public List getReasonRequiredEnvironments() { + return reasonRequiredEnvironments; } - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - KeyGenerationModeEnum.fromValue(value); + public void setReasonRequiredEnvironments( + List reasonRequiredEnvironments) { + this.reasonRequiredEnvironments = reasonRequiredEnvironments; } - } - - public static final String SERIALIZED_NAME_KEY_GENERATION_MODE = "keyGenerationMode"; - @SerializedName(SERIALIZED_NAME_KEY_GENERATION_MODE) - private KeyGenerationModeEnum 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(KeyGenerationModeEnum keyGenerationMode) { - this.keyGenerationMode = keyGenerationMode; - return this; - } - - /** - * Determines the Feature Flag key generation mode. - * @return keyGenerationMode - */ - @javax.annotation.Nullable - public KeyGenerationModeEnum getKeyGenerationMode() { - return keyGenerationMode; - } - - public void setKeyGenerationMode(KeyGenerationModeEnum 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<>(); + + public PreferencesModel mandatorySettingHint(Boolean mandatorySettingHint) { + this.mandatorySettingHint = mandatorySettingHint; + return this; } - 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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + /** + * 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; } - if (o == null || getClass() != o.getClass()) { - return false; + + @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); } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + 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())); } - 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("}"); - 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"; + + @Override + public int hashCode() { + return Objects.hash( + reasonRequired, + keyGenerationMode, + showVariationId, + reasonRequiredEnvironments, + mandatorySettingHint); } - 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())); + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PreferencesModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PreferencesModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + @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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PreferencesModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PreferencesModel` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("keyGenerationMode") != null && !jsonObj.get("keyGenerationMode").isJsonNull()) && !jsonObj.get("keyGenerationMode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `keyGenerationMode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keyGenerationMode").toString())); - } - // validate the optional field `keyGenerationMode` - if (jsonObj.get("keyGenerationMode") != null && !jsonObj.get("keyGenerationMode").isJsonNull()) { - KeyGenerationModeEnum.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)); - }; + // 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(); - elementAdapter.write(out, obj); - } - - @Override - public PreferencesModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public PreferencesModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); } - } - - /** - * 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); - } -} + /** + * 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..ac7c163 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteComparator.java @@ -0,0 +1,72 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** 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 index 9c59b47..3e3afc2 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteFlagConditionModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/PrerequisiteFlagConditionModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,316 +10,272 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Objects; 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 = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** Describes a condition that is based on a prerequisite flag. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - - /** - * Prerequisite flag comparison operator used during the evaluation process. - */ - @JsonAdapter(ComparatorEnum.Adapter.class) - public enum ComparatorEnum { - EQUALS("equals"), - - DOES_NOT_EQUAL("doesNotEqual"); - - private String value; - - ComparatorEnum(String value) { - this.value = value; + 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; } - public String getValue() { - return value; + /** + * The prerequisite flag's identifier. + * + * @return prerequisiteSettingId + */ + @javax.annotation.Nonnull + public Integer getPrerequisiteSettingId() { + return prerequisiteSettingId; } - @Override - public String toString() { - return String.valueOf(value); + public void setPrerequisiteSettingId(Integer prerequisiteSettingId) { + this.prerequisiteSettingId = prerequisiteSettingId; } - public static ComparatorEnum fromValue(String value) { - for (ComparatorEnum b : ComparatorEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + public PrerequisiteFlagConditionModel comparator(PrerequisiteComparator comparator) { + this.comparator = comparator; + return this; } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ComparatorEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ComparatorEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ComparatorEnum.fromValue(value); - } + /** + * Get comparator + * + * @return comparator + */ + @javax.annotation.Nonnull + public PrerequisiteComparator getComparator() { + return comparator; } - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - ComparatorEnum.fromValue(value); + public void setComparator(PrerequisiteComparator comparator) { + this.comparator = comparator; + } + + public PrerequisiteFlagConditionModel prerequisiteComparisonValue( + ValueModel prerequisiteComparisonValue) { + this.prerequisiteComparisonValue = prerequisiteComparisonValue; + return this; } - } - - public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; - @SerializedName(SERIALIZED_NAME_COMPARATOR) - private ComparatorEnum 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(ComparatorEnum comparator) { - this.comparator = comparator; - return this; - } - - /** - * Prerequisite flag comparison operator used during the evaluation process. - * @return comparator - */ - @javax.annotation.Nonnull - public ComparatorEnum getComparator() { - return comparator; - } - - public void setComparator(ComparatorEnum 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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + /** + * Get prerequisiteComparisonValue + * + * @return prerequisiteComparisonValue + */ + @javax.annotation.Nonnull + public ValueModel getPrerequisiteComparisonValue() { + return prerequisiteComparisonValue; } - if (o == null || getClass() != o.getClass()) { - return false; + + public void setPrerequisiteComparisonValue(ValueModel prerequisiteComparisonValue) { + this.prerequisiteComparisonValue = prerequisiteComparisonValue; } - PrerequisiteFlagConditionModel prerequisiteFlagConditionModel = (PrerequisiteFlagConditionModel) o; - return Objects.equals(this.prerequisiteSettingId, prerequisiteFlagConditionModel.prerequisiteSettingId) && - Objects.equals(this.comparator, prerequisiteFlagConditionModel.comparator) && - Objects.equals(this.prerequisiteComparisonValue, prerequisiteFlagConditionModel.prerequisiteComparisonValue); - } - - @Override - public int hashCode() { - return Objects.hash(prerequisiteSettingId, comparator, prerequisiteComparisonValue); - } - - @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("}"); - 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"; + + @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); } - 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())); + + @Override + public int hashCode() { + return Objects.hash(prerequisiteSettingId, comparator, prerequisiteComparisonValue); + } + + @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("}"); + 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 "); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PrerequisiteFlagConditionModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PrerequisiteFlagConditionModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + 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())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PrerequisiteFlagConditionModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PrerequisiteFlagConditionModel` properties. JSON: %s", + entry.getKey(), jsonElement.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(); - if (!jsonObj.get("comparator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `comparator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparator").toString())); - } - // validate the required field `comparator` - ComparatorEnum.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(); - elementAdapter.write(out, obj); - } - - @Override - public PrerequisiteFlagConditionModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + // validate the required field `comparator` + PrerequisiteComparator.validateJsonElement(jsonObj.get("comparator")); + // validate the required field `prerequisiteComparisonValue` + ValueModel.validateJsonElement(jsonObj.get("prerequisiteComparisonValue")); } - } - - /** - * 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); - } -} + 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(); + elementAdapter.write(out, obj); + } + + @Override + public PrerequisiteFlagConditionModel read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 61fc320..235a27a 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/ProductModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/ProductModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,351 +10,368 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * Details of the Product. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** Details of the Product. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Get organization + * + * @return organization + */ + @javax.annotation.Nullable + public OrganizationModel getOrganization() { + return organization; } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + public void setOrganization(OrganizationModel organization) { + this.organization = organization; } - 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("}"); - 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"; + + public ProductModel productId(UUID productId) { + this.productId = productId; + return this; } - 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())); + + /** + * 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; + } + + @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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ProductModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProductModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + 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); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public ProductModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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("}"); + return sb.toString(); } - } - - /** - * 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); - } -} + /** + * 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ProductModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ProductModel` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public ProductModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index b729728..3d3a2b8 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/ReasonRequiredEnvironmentModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/ReasonRequiredEnvironmentModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,265 +10,282 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * ReasonRequiredEnvironmentModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** ReasonRequiredEnvironmentModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Identifier of the Environment. + * + * @return environmentId + */ + @javax.annotation.Nullable + public UUID getEnvironmentId() { + return environmentId; } - ReasonRequiredEnvironmentModel reasonRequiredEnvironmentModel = (ReasonRequiredEnvironmentModel) o; - return Objects.equals(this.environmentId, reasonRequiredEnvironmentModel.environmentId) && - Objects.equals(this.reasonRequired, reasonRequiredEnvironmentModel.reasonRequired) && - Objects.equals(this.environmentName, reasonRequiredEnvironmentModel.environmentName); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + public void setEnvironmentId(UUID environmentId) { + this.environmentId = environmentId; } - 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("}"); - 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"; + + public ReasonRequiredEnvironmentModel reasonRequired(Boolean reasonRequired) { + this.reasonRequired = reasonRequired; + return this; } - 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())); + + /** + * 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; + } + + @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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ReasonRequiredEnvironmentModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ReasonRequiredEnvironmentModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + 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); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public ReasonRequiredEnvironmentModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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("}"); + 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 "); } - } - - /** - * 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); - } -} + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ReasonRequiredEnvironmentModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ReasonRequiredEnvironmentModel` properties. JSON: %s", + entry.getKey(), 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())); + } + 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(); + elementAdapter.write(out, obj); + } + + @Override + public ReasonRequiredEnvironmentModel read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 3c7f26a..5e31d38 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLine.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLine.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,243 +10,248 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * Determines a code reference line. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** Determines a code reference line. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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; + } + + @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); + } + + 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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ReferenceLine.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ReferenceLine` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + 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("}"); + return sb.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())); + /** + * 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ReferenceLine.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ReferenceLine` properties. JSON: %s", + entry.getKey(), jsonElement.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())); - } - } + 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(); - elementAdapter.write(out, obj); - } - - @Override - public ReferenceLine read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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(); + elementAdapter.write(out, obj); + } + + @Override + public ReferenceLine read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index f91580b..f47d38e 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLines.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/ReferenceLines.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,374 +10,397 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * ReferenceLines - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** ReferenceLines */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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<>(); + 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; } - 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<>(); + + public void setFile(String _file) { + this._file = _file; } - 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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + public ReferenceLines fileUrl(String fileUrl) { + this.fileUrl = fileUrl; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * 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; } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + public void setFileUrl(String fileUrl) { + this.fileUrl = fileUrl; } - 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("}"); - 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"; + + public ReferenceLines preLines(List preLines) { + this.preLines = preLines; + return this; } - 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())); + + 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; + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ReferenceLines.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ReferenceLines` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + 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; + } - // 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())); + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - } - 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 (o == null || getClass() != o.getClass()) { + return false; } - } - 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)); - }; + 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); + } + + 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); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - // validate the required field `referenceLine` - ReferenceLine.validateJsonElement(jsonObj.get("referenceLine")); - } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } - 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(); - elementAdapter.write(out, obj); - } - - @Override - public ReferenceLines read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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("}"); + return sb.toString(); } - } - - /** - * 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); - } -} + /** + * 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ReferenceLines.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ReferenceLines` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public ReferenceLines read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index be2c213..884a50f 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/ReplaceSettingModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/ReplaceSettingModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,312 +10,331 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * ReplaceSettingModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** ReplaceSettingModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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<>(); + 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; } - 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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + public void setHint(String hint) { + this.hint = hint; + } + + public ReplaceSettingModel tags(List tags) { + this.tags = tags; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + public ReplaceSettingModel addTagsItem(Long tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + /** + * The IDs of the tags which are attached to the setting. + * + * @return tags + */ + @javax.annotation.Nullable + public List getTags() { + return tags; } - 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("}"); - 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"; + + 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; } - 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())); + + 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; + } + + @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); + } + + 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); + } + + 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("}"); + 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"); - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ReplaceSettingModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ReplaceSettingModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + // 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())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ReplaceSettingModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ReplaceSettingModel` properties. JSON: %s", + entry.getKey(), jsonElement.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(); - elementAdapter.write(out, obj); - } - - @Override - public ReplaceSettingModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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())); + } } - } - - /** - * 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); - } -} + 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(); + elementAdapter.write(out, obj); + } + + @Override + public ReplaceSettingModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 2fae59b..72ea3db 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/RolloutPercentageItemModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/RolloutPercentageItemModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,240 +10,243 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * RolloutPercentageItemModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** RolloutPercentageItemModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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; + } + + @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); + } + + 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); + } + + 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("}"); + 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; - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!RolloutPercentageItemModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RolloutPercentageItemModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RolloutPercentageItemModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RolloutPercentageItemModel` properties. JSON: %s", + entry.getKey(), jsonElement.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())); + // 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(); - elementAdapter.write(out, obj); - } - - @Override - public RolloutPercentageItemModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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(); + elementAdapter.write(out, obj); + } + + @Override + public RolloutPercentageItemModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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..3a5772c --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/RolloutRuleComparator.java @@ -0,0 +1,107 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * 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 index 1fd1cd2..d3d8352 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/RolloutRuleModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/RolloutRuleModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,496 +10,383 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * RolloutRuleModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** RolloutRuleModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - - /** - * Gets or Sets comparator - */ - @JsonAdapter(ComparatorEnum.Adapter.class) - public enum ComparatorEnum { - 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; - - ComparatorEnum(String value) { - this.value = value; + 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; } - public String getValue() { - return value; + /** + * The user attribute to compare. + * + * @return comparisonAttribute + */ + @javax.annotation.Nullable + public String getComparisonAttribute() { + return comparisonAttribute; } - @Override - public String toString() { - return String.valueOf(value); + public void setComparisonAttribute(String comparisonAttribute) { + this.comparisonAttribute = comparisonAttribute; } - public static ComparatorEnum fromValue(String value) { - for (ComparatorEnum b : ComparatorEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; + public RolloutRuleModel comparator(RolloutRuleComparator comparator) { + this.comparator = comparator; + return this; } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ComparatorEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ComparatorEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ComparatorEnum.fromValue(value); - } + /** + * Get comparator + * + * @return comparator + */ + @javax.annotation.Nullable + public RolloutRuleComparator getComparator() { + return comparator; } - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - ComparatorEnum.fromValue(value); + public void setComparator(RolloutRuleComparator comparator) { + this.comparator = comparator; + } + + public RolloutRuleModel comparisonValue(String comparisonValue) { + this.comparisonValue = comparisonValue; + return this; } - } - public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; - @SerializedName(SERIALIZED_NAME_COMPARATOR) - private ComparatorEnum comparator; + /** + * The value to compare against. + * + * @return comparisonValue + */ + @javax.annotation.Nullable + public String getComparisonValue() { + return comparisonValue; + } - public static final String SERIALIZED_NAME_COMPARISON_VALUE = "comparisonValue"; - @SerializedName(SERIALIZED_NAME_COMPARISON_VALUE) - private String comparisonValue; + public void setComparisonValue(String comparisonValue) { + this.comparisonValue = comparisonValue; + } - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private Object value = null; + public RolloutRuleModel value(Object value) { + this.value = value; + return this; + } - /** - * The segment comparison operator. - */ - @JsonAdapter(SegmentComparatorEnum.Adapter.class) - public enum SegmentComparatorEnum { - IS_IN("isIn"), - - IS_NOT_IN("isNotIn"); + /** + * The value to serve when the comparison matches. It must respect the setting type. + * + * @return value + */ + @javax.annotation.Nullable + public Object getValue() { + return value; + } - private String value; + public void setValue(Object value) { + this.value = value; + } - SegmentComparatorEnum(String value) { - this.value = value; + public RolloutRuleModel segmentComparator(SegmentComparator segmentComparator) { + this.segmentComparator = segmentComparator; + return this; } - public String getValue() { - return value; + /** + * Get segmentComparator + * + * @return segmentComparator + */ + @javax.annotation.Nullable + public SegmentComparator getSegmentComparator() { + return segmentComparator; } - @Override - public String toString() { - return String.valueOf(value); + 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 static SegmentComparatorEnum fromValue(String value) { - for (SegmentComparatorEnum b : SegmentComparatorEnum.values()) { - if (b.value.equals(value)) { - return b; + public void setSegmentId(UUID segmentId) { + this.segmentId = segmentId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - } - return null; + 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); } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final SegmentComparatorEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public SegmentComparatorEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return SegmentComparatorEnum.fromValue(value); - } + 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())); } - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - SegmentComparatorEnum.fromValue(value); + @Override + public int hashCode() { + return Objects.hash( + comparisonAttribute, + comparator, + comparisonValue, + value, + segmentComparator, + segmentId); } - } - - public static final String SERIALIZED_NAME_SEGMENT_COMPARATOR = "segmentComparator"; - @SerializedName(SERIALIZED_NAME_SEGMENT_COMPARATOR) - private SegmentComparatorEnum 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(ComparatorEnum comparator) { - this.comparator = comparator; - return this; - } - - /** - * Get comparator - * @return comparator - */ - @javax.annotation.Nullable - public ComparatorEnum getComparator() { - return comparator; - } - - public void setComparator(ComparatorEnum 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(SegmentComparatorEnum segmentComparator) { - this.segmentComparator = segmentComparator; - return this; - } - - /** - * The segment comparison operator. - * @return segmentComparator - */ - @javax.annotation.Nullable - public SegmentComparatorEnum getSegmentComparator() { - return segmentComparator; - } - - public void setSegmentComparator(SegmentComparatorEnum 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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; } - if (o == null || getClass() != o.getClass()) { - return false; + + @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("}"); + return sb.toString(); } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + /** + * 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 "); } - 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("}"); - 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"; + + 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(); } - 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())); + + /** + * 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!RolloutRuleModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RolloutRuleModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RolloutRuleModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RolloutRuleModel` properties. JSON: %s", + entry.getKey(), 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())); - } - if ((jsonObj.get("comparator") != null && !jsonObj.get("comparator").isJsonNull()) && !jsonObj.get("comparator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `comparator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparator").toString())); - } - // validate the optional field `comparator` - if (jsonObj.get("comparator") != null && !jsonObj.get("comparator").isJsonNull()) { - ComparatorEnum.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())); - } - if ((jsonObj.get("segmentComparator") != null && !jsonObj.get("segmentComparator").isJsonNull()) && !jsonObj.get("segmentComparator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `segmentComparator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("segmentComparator").toString())); - } - // validate the optional field `segmentComparator` - if (jsonObj.get("segmentComparator") != null && !jsonObj.get("segmentComparator").isJsonNull()) { - SegmentComparatorEnum.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(); - elementAdapter.write(out, obj); - } - - @Override - public RolloutRuleModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public RolloutRuleModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); } - } - - /** - * 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); - } -} + /** + * 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 index 9e01da7..5eaed89 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/SdkKeysModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/SdkKeysModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,238 +10,245 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * SdkKeysModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** SdkKeysModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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; + } + + @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); + } + + 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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SdkKeysModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SdkKeysModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public SdkKeysModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SdkKeysModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `SdkKeysModel` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public SdkKeysModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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..4b9be25 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/SegmentComparator.java @@ -0,0 +1,72 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** 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 index 0cba14a..19f0d9c 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/SegmentConditionModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/SegmentConditionModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,290 +10,234 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Objects; import java.util.Set; +import java.util.UUID; -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 = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** Describes a condition that is based on a segment. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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_SEGMENT_ID = "segmentId"; - /** - * The segment comparison operator used during the evaluation process. - */ - @JsonAdapter(ComparatorEnum.Adapter.class) - public enum ComparatorEnum { - IS_IN("isIn"), - - IS_NOT_IN("isNotIn"); + @SerializedName(SERIALIZED_NAME_SEGMENT_ID) + private UUID segmentId; - private String value; + public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; - ComparatorEnum(String value) { - this.value = value; - } + @SerializedName(SERIALIZED_NAME_COMPARATOR) + private SegmentComparator comparator; - public String getValue() { - return value; - } + public SegmentConditionModel() {} - @Override - public String toString() { - return String.valueOf(value); + public SegmentConditionModel segmentId(UUID segmentId) { + this.segmentId = segmentId; + return this; } - public static ComparatorEnum fromValue(String value) { - for (ComparatorEnum b : ComparatorEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + /** + * The segment's identifier. + * + * @return segmentId + */ + @javax.annotation.Nonnull + public UUID getSegmentId() { + return segmentId; } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ComparatorEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ComparatorEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ComparatorEnum.fromValue(value); - } + public void setSegmentId(UUID segmentId) { + this.segmentId = segmentId; } - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - ComparatorEnum.fromValue(value); + public SegmentConditionModel comparator(SegmentComparator comparator) { + this.comparator = comparator; + return this; } - } - - public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; - @SerializedName(SERIALIZED_NAME_COMPARATOR) - private ComparatorEnum 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(ComparatorEnum comparator) { - this.comparator = comparator; - return this; - } - - /** - * The segment comparison operator used during the evaluation process. - * @return comparator - */ - @javax.annotation.Nonnull - public ComparatorEnum getComparator() { - return comparator; - } - - public void setComparator(ComparatorEnum comparator) { - this.comparator = comparator; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + /** + * Get comparator + * + * @return comparator + */ + @javax.annotation.Nonnull + public SegmentComparator getComparator() { + return comparator; } - if (o == null || getClass() != o.getClass()) { - return false; + + public void setComparator(SegmentComparator comparator) { + this.comparator = comparator; } - SegmentConditionModel segmentConditionModel = (SegmentConditionModel) o; - return Objects.equals(this.segmentId, segmentConditionModel.segmentId) && - Objects.equals(this.comparator, segmentConditionModel.comparator); - } - @Override - public int hashCode() { - return Objects.hash(segmentId, comparator); - } + @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); + } - @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("}"); - return sb.toString(); - } + @Override + public int hashCode() { + return Objects.hash(segmentId, comparator); + } - /** - * 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"; + @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("}"); + return sb.toString(); } - return o.toString().replace("\n", "\n "); - } + /** + * 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; + 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"); + 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"); - } + // 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())); + /** + * 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SegmentConditionModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SegmentConditionModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SegmentConditionModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `SegmentConditionModel` properties. JSON: %s", + entry.getKey(), jsonElement.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())); + // 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())); - } - if (!jsonObj.get("comparator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `comparator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparator").toString())); - } - // validate the required field `comparator` - ComparatorEnum.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(); - elementAdapter.write(out, obj); - } - - @Override - public SegmentConditionModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } + 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")); + } - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public SegmentConditionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); - } + /** + * 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); - } + /** + * 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 index e6b2269..2df4824 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/SegmentListModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/SegmentListModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,494 +10,550 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.time.OffsetDateTime; +import java.util.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * SegmentListModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** SegmentListModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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; + } + + @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); + } + + 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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SegmentListModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SegmentListModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public SegmentListModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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("}"); + 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())); + } + } + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SegmentListModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `SegmentListModel` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public SegmentListModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 78e9ef4..a68704e 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/SegmentModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/SegmentModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,643 +10,628 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.time.OffsetDateTime; +import java.util.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * SegmentModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** SegmentModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - - /** - * The comparison operator the evaluation process must use when it compares the given user attribute's value with the comparison value. - */ - @JsonAdapter(ComparatorEnum.Adapter.class) - public enum ComparatorEnum { - 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; - - ComparatorEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; + 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; } @Override - public String toString() { - return String.valueOf(value); + 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); + } + + 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())); } - public static ComparatorEnum fromValue(String value) { - for (ComparatorEnum b : ComparatorEnum.values()) { - if (b.value.equals(value)) { - return b; + @Override + public int hashCode() { + return Objects.hash( + product, + segmentId, + name, + description, + creatorEmail, + creatorFullName, + createdAt, + lastUpdaterEmail, + lastUpdaterFullName, + updatedAt, + comparisonAttribute, + comparator, + comparisonValue); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + 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("}"); + return sb.toString(); } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ComparatorEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } + /** + * 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 "); + } - @Override - public ComparatorEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ComparatorEnum.fromValue(value); - } + 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 { - String value = jsonElement.getAsString(); - ComparatorEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; - @SerializedName(SERIALIZED_NAME_COMPARATOR) - private ComparatorEnum 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(ComparatorEnum comparator) { - this.comparator = comparator; - return this; - } - - /** - * The comparison operator the evaluation process must use when it compares the given user attribute's value with the comparison value. - * @return comparator - */ - @javax.annotation.Nullable - public ComparatorEnum getComparator() { - return comparator; - } - - public void setComparator(ComparatorEnum 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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SegmentModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SegmentModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SegmentModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `SegmentModel` properties. JSON: %s", + entry.getKey(), jsonElement.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())); - } - if ((jsonObj.get("comparator") != null && !jsonObj.get("comparator").isJsonNull()) && !jsonObj.get("comparator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `comparator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparator").toString())); - } - // validate the optional field `comparator` - if (jsonObj.get("comparator") != null && !jsonObj.get("comparator").isJsonNull()) { - ComparatorEnum.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(); - elementAdapter.write(out, obj); - } - - @Override - public SegmentModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + // 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(); + elementAdapter.write(out, obj); + } + + @Override + public SegmentModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index c3064ff..b30346c 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/SettingDataModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/SettingDataModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,519 +10,501 @@ * 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 org.openapitools.jackson.nullable.JsonNullable; +import com.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.time.OffsetDateTime; +import java.util.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * Metadata of a Feature Flag or Setting. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** Metadata of a Feature Flag or Setting. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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_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_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; + public static final String SERIALIZED_NAME_ORDER = "order"; - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; + @SerializedName(SERIALIZED_NAME_ORDER) + private Integer order; - public static final String SERIALIZED_NAME_HINT = "hint"; - @SerializedName(SERIALIZED_NAME_HINT) - private String hint; + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - /** - * The type of the Feature Flag or Setting. - */ - @JsonAdapter(SettingTypeEnum.Adapter.class) - public enum SettingTypeEnum { - BOOLEAN("boolean"), - - STRING("string"), - - INT("int"), - - DOUBLE("double"); + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; - private String value; + public static final String SERIALIZED_NAME_CREATOR_EMAIL = "creatorEmail"; - SettingTypeEnum(String value) { - this.value = value; + @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 String getValue() { - return value; + 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; } @Override - public String toString() { - return String.valueOf(value); + 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); + } + + 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); } - public static SettingTypeEnum fromValue(String value) { - for (SettingTypeEnum b : SettingTypeEnum.values()) { - if (b.value.equals(value)) { - return b; + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final SettingTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } + @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("}"); + return sb.toString(); + } - @Override - public SettingTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return SettingTypeEnum.fromValue(value); - } + /** + * 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 { - String value = jsonElement.getAsString(); - SettingTypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_SETTING_TYPE = "settingType"; - @SerializedName(SERIALIZED_NAME_SETTING_TYPE) - private SettingTypeEnum 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(SettingTypeEnum settingType) { - this.settingType = settingType; - return this; - } - - /** - * The type of the Feature Flag or Setting. - * @return settingType - */ - @javax.annotation.Nullable - public SettingTypeEnum getSettingType() { - return settingType; - } - - public void setSettingType(SettingTypeEnum 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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SettingDataModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SettingDataModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SettingDataModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `SettingDataModel` properties. JSON: %s", + entry.getKey(), 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("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())); - } - if ((jsonObj.get("settingType") != null && !jsonObj.get("settingType").isJsonNull()) && !jsonObj.get("settingType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `settingType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("settingType").toString())); - } - // validate the optional field `settingType` - if (jsonObj.get("settingType") != null && !jsonObj.get("settingType").isJsonNull()) { - SettingTypeEnum.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(); - elementAdapter.write(out, obj); - } - - @Override - public SettingDataModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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(); + elementAdapter.write(out, obj); + } + + @Override + public SettingDataModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index c1abcc4..3b0d0f0 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/SettingFormulaModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/SettingFormulaModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,692 +10,782 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * SettingFormulaModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** SettingFormulaModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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; + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SettingFormulaModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SettingFormulaModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + 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<>(); } - } - 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)); - }; + 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - } - // 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 (o == null || getClass() != o.getClass()) { + return false; } - } - 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)); - }; + 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); + } + + 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); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - // 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public SettingFormulaModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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("}"); + 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())); + } + } + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SettingFormulaModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `SettingFormulaModel` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public SettingFormulaModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 972b225..a130355 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/SettingModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/SettingModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,518 +10,494 @@ * Do not edit the class manually. */ - package com.configcat.publicapi.java.client.model; -import java.util.Objects; -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.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; +import com.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * Metadata of a Feature Flag or Setting. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** Metadata of a Feature Flag or Setting. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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_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_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; + public static final String SERIALIZED_NAME_HINT = "hint"; - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; + @SerializedName(SERIALIZED_NAME_HINT) + private String hint; - public static final String SERIALIZED_NAME_HINT = "hint"; - @SerializedName(SERIALIZED_NAME_HINT) - private String hint; + public static final String SERIALIZED_NAME_ORDER = "order"; - public static final String SERIALIZED_NAME_ORDER = "order"; - @SerializedName(SERIALIZED_NAME_ORDER) - private Integer order; + @SerializedName(SERIALIZED_NAME_ORDER) + private Integer order; - /** - * The type of the Feature Flag or Setting. - */ - @JsonAdapter(SettingTypeEnum.Adapter.class) - public enum SettingTypeEnum { - BOOLEAN("boolean"), - - STRING("string"), - - INT("int"), - - DOUBLE("double"); + public static final String SERIALIZED_NAME_SETTING_TYPE = "settingType"; - private String value; + @SerializedName(SERIALIZED_NAME_SETTING_TYPE) + private SettingType settingType; - SettingTypeEnum(String value) { - this.value = value; + 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_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 String getValue() { - return value; + 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 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; } @Override - public String toString() { - return String.valueOf(value); + 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.tags, settingModel.tags); + } + + 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, tags); } - public static SettingTypeEnum fromValue(String value) { - for (SettingTypeEnum b : SettingTypeEnum.values()) { - if (b.value.equals(value)) { - return b; + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final SettingTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } + @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(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append("}"); + return sb.toString(); + } - @Override - public SettingTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return SettingTypeEnum.fromValue(value); - } + /** + * 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("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 { - String value = jsonElement.getAsString(); - SettingTypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_SETTING_TYPE = "settingType"; - @SerializedName(SERIALIZED_NAME_SETTING_TYPE) - private SettingTypeEnum 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_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(SettingTypeEnum settingType) { - this.settingType = settingType; - return this; - } - - /** - * The type of the Feature Flag or Setting. - * @return settingType - */ - @javax.annotation.Nullable - public SettingTypeEnum getSettingType() { - return settingType; - } - - public void setSettingType(SettingTypeEnum 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 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; - } - - - - @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.tags, settingModel.tags); - } - - 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, tags); - } - - 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(" tags: ").append(toIndentedString(tags)).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("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())); + 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SettingModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SettingModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SettingModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `SettingModel` properties. JSON: %s", + entry.getKey(), 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("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())); - } - if ((jsonObj.get("settingType") != null && !jsonObj.get("settingType").isJsonNull()) && !jsonObj.get("settingType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `settingType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("settingType").toString())); - } - // validate the optional field `settingType` - if (jsonObj.get("settingType") != null && !jsonObj.get("settingType").isJsonNull()) { - SettingTypeEnum.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)); - }; + 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(); - elementAdapter.write(out, obj); - } - - @Override - public SettingModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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(); + elementAdapter.write(out, obj); + } + + @Override + public SettingModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 4facf74..9ae34f7 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/SettingTagModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/SettingTagModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,290 +10,300 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * SettingTagModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** SettingTagModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Get settingTagId + * + * @return settingTagId + */ + @javax.annotation.Nullable + public Long getSettingTagId() { + return settingTagId; } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + public void setSettingTagId(Long settingTagId) { + this.settingTagId = settingTagId; } - 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("}"); - 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"; + + 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; } - 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())); + + 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; + } + + @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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SettingTagModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SettingTagModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + 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); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public SettingTagModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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("}"); + return sb.toString(); } - } - - /** - * 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); - } -} + /** + * 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SettingTagModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `SettingTagModel` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public SettingTagModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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..b60ce47 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/SettingType.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.model; + + +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** 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 index 8bf5e78..be56aee 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/SettingValueModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/SettingValueModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,639 +10,705 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * SettingValueModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** SettingValueModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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; + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SettingValueModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SettingValueModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + 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<>(); } - } - 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)); - }; + 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<>(); } - } - 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)); - }; + 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<>(); } - } - // 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)); - }; + 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - } - 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)); - }; + if (o == null || getClass() != o.getClass()) { + return false; } - } - // 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") + 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); + } + + 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 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(); - elementAdapter.write(out, obj); - } - - @Override - public SettingValueModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + public int hashCode() { + return Objects.hash( + rolloutRules, + rolloutPercentageItems, + value, + setting, + updatedAt, + lastUpdaterUserEmail, + lastUpdaterUserFullName, + integrationLinks, + settingTags, + config, + environment, + featureFlagLimitations, + readOnly); + } + + 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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SettingValueModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `SettingValueModel` properties. JSON: %s", + entry.getKey(), 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++) { + 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(); + elementAdapter.write(out, obj); + } + + @Override + public SettingValueModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 2e87e25..3be3ce2 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/TagModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/TagModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,295 +10,303 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * TagModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** TagModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; } - if (o == null || getClass() != o.getClass()) { - return false; + + public TagModel color(String color) { + this.color = color; + return this; } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + /** + * The configured color of the Tag. + * + * @return color + */ + @javax.annotation.Nullable + public String getColor() { + return color; } - 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("}"); - 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"; + + public void setColor(String color) { + this.color = color; } - 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())); + + @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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TagModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TagModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + 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); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public TagModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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("}"); + return sb.toString(); } - } - - /** - * 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); - } -} + /** + * 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TagModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `TagModel` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public TagModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index d01ce6b..1bcb08f 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/TargetingRuleModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/TargetingRuleModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,311 +10,324 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * TargetingRuleModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** TargetingRuleModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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_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 static final String SERIALIZED_NAME_PERCENTAGE_OPTIONS = "percentageOptions"; - @SerializedName(SERIALIZED_NAME_PERCENTAGE_OPTIONS) - private List percentageOptions; + public TargetingRuleModel percentageOptions(List percentageOptions) { + this.percentageOptions = percentageOptions; + return this; + } - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private ValueModel value; + 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 TargetingRuleModel() { - } + public void setPercentageOptions(List percentageOptions) { + this.percentageOptions = percentageOptions; + } - public TargetingRuleModel conditions(List conditions) { - this.conditions = conditions; - return this; - } + public TargetingRuleModel value(ValueModel value) { + this.value = value; + return this; + } - public TargetingRuleModel addConditionsItem(ConditionModel conditionsItem) { - if (this.conditions == null) { - this.conditions = new ArrayList<>(); + /** + * Get value + * + * @return value + */ + @javax.annotation.Nullable + public ValueModel getValue() { + return value; } - 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<>(); + + public void setValue(ValueModel value) { + this.value = value; } - 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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + @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); + } + + 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); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; } - if (o == null || getClass() != o.getClass()) { - return false; + + @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("}"); + return sb.toString(); } - TargetingRuleModel targetingRuleModel = (TargetingRuleModel) o; - return Objects.equals(this.conditions, targetingRuleModel.conditions) && - Objects.equals(this.percentageOptions, targetingRuleModel.percentageOptions) && - Objects.equals(this.value, targetingRuleModel.value); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + /** + * 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 "); } - 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("}"); - 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"; + + 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(); } - 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())); + + /** + * 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TargetingRuleModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TargetingRuleModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TargetingRuleModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `TargetingRuleModel` properties. JSON: %s", + entry.getKey(), jsonElement.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("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)); - }; + 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(); + elementAdapter.write(out, obj); + } + + @Override + public TargetingRuleModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); } - } - // 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(); - elementAdapter.write(out, obj); - } - - @Override - public TargetingRuleModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + /** + * 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 index 75938f9..5f186b2 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateConfigRequest.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateConfigRequest.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,264 +10,274 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateConfigRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** UpdateConfigRequest */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * The name of the Config. + * + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; } - UpdateConfigRequest updateConfigRequest = (UpdateConfigRequest) o; - return Objects.equals(this.name, updateConfigRequest.name) && - Objects.equals(this.description, updateConfigRequest.description) && - Objects.equals(this.order, updateConfigRequest.order); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + public void setName(String name) { + this.name = name; } - 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("}"); - 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"; + + 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; } - 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())); + + public void setOrder(Integer order) { + this.order = order; + } + + @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); + } + + 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())); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateConfigRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateConfigRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + @Override + public int hashCode() { + return Objects.hash(name, description, order); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateConfigRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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("}"); + return sb.toString(); } - } - - /** - * 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); - } -} + /** + * 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateConfigRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateConfigRequest` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateConfigRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 30f795d..7161152 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateEnvironmentModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateEnvironmentModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,293 +10,309 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateEnvironmentModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** UpdateEnvironmentModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; } - if (o == null || getClass() != o.getClass()) { - return false; + + public UpdateEnvironmentModel order(Integer order) { + this.order = order; + return this; } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + /** + * 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; } - 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("}"); - 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"; + + public void setOrder(Integer order) { + this.order = order; } - 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())); + + @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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateEnvironmentModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateEnvironmentModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + 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); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateEnvironmentModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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("}"); + return sb.toString(); } - } - - /** - * 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); - } -} + /** + * 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateEnvironmentModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateEnvironmentModel` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateEnvironmentModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 1717c79..dba37e4 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,297 +10,322 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateEvaluationFormulaModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** UpdateEvaluationFormulaModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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<>(); + 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; } - 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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + /** + * 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; } - if (o == null || getClass() != o.getClass()) { - return false; + + public UpdateEvaluationFormulaModel addTargetingRulesItem( + TargetingRuleModel targetingRulesItem) { + if (this.targetingRules == null) { + this.targetingRules = new ArrayList<>(); + } + this.targetingRules.add(targetingRulesItem); + return this; } - UpdateEvaluationFormulaModel updateEvaluationFormulaModel = (UpdateEvaluationFormulaModel) o; - return Objects.equals(this.defaultValue, updateEvaluationFormulaModel.defaultValue) && - Objects.equals(this.targetingRules, updateEvaluationFormulaModel.targetingRules) && - Objects.equals(this.percentageEvaluationAttribute, updateEvaluationFormulaModel.percentageEvaluationAttribute); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + /** + * The targeting rules of the Feature Flag or Setting. + * + * @return targetingRules + */ + @javax.annotation.Nullable + public List getTargetingRules() { + return targetingRules; } - 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("}"); - 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"; + + public void setTargetingRules(List targetingRules) { + this.targetingRules = targetingRules; } - 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())); + + 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; + } + + @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); + } + + 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())); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateEvaluationFormulaModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateEvaluationFormulaModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + @Override + public int hashCode() { + return Objects.hash(defaultValue, targetingRules, percentageEvaluationAttribute); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } - // 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())); + @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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateEvaluationFormulaModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateEvaluationFormulaModel` properties. JSON: %s", + entry.getKey(), jsonElement.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)); - }; + // 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(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateEvaluationFormulaModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); } - } - 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(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateEvaluationFormulaModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + /** + * 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 index 9a138fd..5593081 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaWithIdModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaWithIdModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,323 +10,354 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateEvaluationFormulaWithIdModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** UpdateEvaluationFormulaWithIdModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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<>(); + 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; } - 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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + public void setDefaultValue(ValueModel defaultValue) { + this.defaultValue = defaultValue; } - if (o == null || getClass() != o.getClass()) { - return false; + + public UpdateEvaluationFormulaWithIdModel targetingRules( + List targetingRules) { + this.targetingRules = targetingRules; + return this; } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + public UpdateEvaluationFormulaWithIdModel addTargetingRulesItem( + TargetingRuleModel targetingRulesItem) { + if (this.targetingRules == null) { + this.targetingRules = new ArrayList<>(); + } + this.targetingRules.add(targetingRulesItem); + return this; } - 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("}"); - 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"; + + /** + * The targeting rules of the Feature Flag or Setting. + * + * @return targetingRules + */ + @javax.annotation.Nullable + public List getTargetingRules() { + return targetingRules; } - 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())); + + 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; + } + + @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); + } + + 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())); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateEvaluationFormulaWithIdModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateEvaluationFormulaWithIdModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + @Override + public int hashCode() { + return Objects.hash(defaultValue, targetingRules, percentageEvaluationAttribute, settingId); + } + + 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("}"); + return sb.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())); + /** + * 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateEvaluationFormulaWithIdModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateEvaluationFormulaWithIdModel` properties. JSON: %s", + entry.getKey(), jsonElement.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)); - }; + // 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())); } - } - 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(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateEvaluationFormulaWithIdModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateEvaluationFormulaWithIdModel read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 954d39a..ed49737 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulasModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulasModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,231 +10,242 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateEvaluationFormulasModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** UpdateEvaluationFormulasModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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 static final String SERIALIZED_NAME_UPDATE_FORMULAS = "updateFormulas"; - public UpdateEvaluationFormulasModel() { - } + @SerializedName(SERIALIZED_NAME_UPDATE_FORMULAS) + private List updateFormulas; - public UpdateEvaluationFormulasModel updateFormulas(List updateFormulas) { - this.updateFormulas = updateFormulas; - return this; - } + public UpdateEvaluationFormulasModel() {} - public UpdateEvaluationFormulasModel addUpdateFormulasItem(UpdateEvaluationFormulaWithIdModel updateFormulasItem) { - if (this.updateFormulas == null) { - this.updateFormulas = new ArrayList<>(); + public UpdateEvaluationFormulasModel updateFormulas( + List updateFormulas) { + this.updateFormulas = updateFormulas; + return this; } - 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 UpdateEvaluationFormulasModel addUpdateFormulasItem( + UpdateEvaluationFormulaWithIdModel updateFormulasItem) { + if (this.updateFormulas == null) { + this.updateFormulas = new ArrayList<>(); + } + this.updateFormulas.add(updateFormulasItem); + return this; + } - public void setUpdateFormulas(List updateFormulas) { - this.updateFormulas = updateFormulas; - } + /** + * 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; + } + @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); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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())); } - if (o == null || getClass() != o.getClass()) { - return false; + + @Override + public int hashCode() { + return Objects.hash(updateFormulas); } - UpdateEvaluationFormulasModel updateEvaluationFormulasModel = (UpdateEvaluationFormulasModel) o; - return Objects.equals(this.updateFormulas, updateEvaluationFormulasModel.updateFormulas); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + 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("}"); + 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 "); } - 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("}"); - 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"; + + 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(); } - 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())); + + /** + * 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateEvaluationFormulasModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateEvaluationFormulasModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateEvaluationFormulasModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateEvaluationFormulasModel` properties. JSON: %s", + entry.getKey(), jsonElement.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)); - }; + 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(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateEvaluationFormulasModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateEvaluationFormulasModel read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); } - } - - /** - * 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); - } -} + /** + * 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 index 1946352..b121b5f 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateMemberPermissionsRequest.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateMemberPermissionsRequest.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,298 +10,326 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateMemberPermissionsRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** UpdateMemberPermissionsRequest */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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_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 static final String SERIALIZED_NAME_IS_ADMIN = "isAdmin"; - @SerializedName(SERIALIZED_NAME_IS_ADMIN) - private Boolean isAdmin; + public UpdateMemberPermissionsRequest permissionGroupIds(List permissionGroupIds) { + this.permissionGroupIds = permissionGroupIds; + return this; + } - public static final String SERIALIZED_NAME_IS_BILLING_MANAGER = "isBillingManager"; - @SerializedName(SERIALIZED_NAME_IS_BILLING_MANAGER) - private Boolean isBillingManager; + public UpdateMemberPermissionsRequest addPermissionGroupIdsItem(Long permissionGroupIdsItem) { + if (this.permissionGroupIds == null) { + this.permissionGroupIds = new ArrayList<>(); + } + this.permissionGroupIds.add(permissionGroupIdsItem); + return this; + } - 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; + /** + * List of Permission Group identifiers to where the Member should be added. + * + * @return permissionGroupIds + */ + @javax.annotation.Nullable + public List getPermissionGroupIds() { + return permissionGroupIds; + } - public UpdateMemberPermissionsRequest() { - } + public void setPermissionGroupIds(List permissionGroupIds) { + this.permissionGroupIds = permissionGroupIds; + } - public UpdateMemberPermissionsRequest permissionGroupIds(List permissionGroupIds) { - this.permissionGroupIds = permissionGroupIds; - return this; - } + public UpdateMemberPermissionsRequest isAdmin(Boolean isAdmin) { + this.isAdmin = isAdmin; + return this; + } - public UpdateMemberPermissionsRequest addPermissionGroupIdsItem(Long permissionGroupIdsItem) { - if (this.permissionGroupIds == null) { - this.permissionGroupIds = new ArrayList<>(); + /** + * Indicates that the member must be Organization Admin. + * + * @return isAdmin + */ + @javax.annotation.Nullable + public Boolean getIsAdmin() { + return isAdmin; } - 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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + public void setIsAdmin(Boolean isAdmin) { + this.isAdmin = isAdmin; } - if (o == null || getClass() != o.getClass()) { - return false; + + public UpdateMemberPermissionsRequest isBillingManager(Boolean isBillingManager) { + this.isBillingManager = isBillingManager; + return this; } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + /** + * Indicates that the member must be Billing Manager. + * + * @return isBillingManager + */ + @javax.annotation.Nullable + public Boolean getIsBillingManager() { + return isBillingManager; } - 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("}"); - 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"; + + public void setIsBillingManager(Boolean isBillingManager) { + this.isBillingManager = isBillingManager; } - 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())); + + 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; + } + + @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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateMemberPermissionsRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateMemberPermissionsRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + 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); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateMemberPermissionsRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateMemberPermissionsRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateMemberPermissionsRequest` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateMemberPermissionsRequest read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); } - } - - /** - * 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); - } -} + /** + * 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 index e2a61f3..09f01bc 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdatePermissionGroupRequest.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdatePermissionGroupRequest.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,954 +10,1003 @@ * Do not edit the class manually. */ - package com.configcat.publicapi.java.client.model; -import java.util.Objects; -import com.configcat.publicapi.java.client.model.CreateOrUpdateEnvironmentAccessModel; -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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdatePermissionGroupRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** UpdatePermissionGroupRequest */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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_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"; - public static final String SERIALIZED_NAME_CAN_MANAGE_MEMBERS = "canManageMembers"; - @SerializedName(SERIALIZED_NAME_CAN_MANAGE_MEMBERS) - private Boolean canManageMembers; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_CONFIG) + private Boolean canCreateOrUpdateConfig; - 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"; - public static final String SERIALIZED_NAME_CAN_DELETE_CONFIG = "canDeleteConfig"; - @SerializedName(SERIALIZED_NAME_CAN_DELETE_CONFIG) - private Boolean 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_CREATE_OR_UPDATE_ENVIRONMENT = + "canCreateOrUpdateEnvironment"; - public static final String SERIALIZED_NAME_CAN_DELETE_ENVIRONMENT = "canDeleteEnvironment"; - @SerializedName(SERIALIZED_NAME_CAN_DELETE_ENVIRONMENT) - private Boolean canDeleteEnvironment; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_ENVIRONMENT) + private Boolean canCreateOrUpdateEnvironment; - 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_DELETE_ENVIRONMENT = "canDeleteEnvironment"; - public static final String SERIALIZED_NAME_CAN_TAG_SETTING = "canTagSetting"; - @SerializedName(SERIALIZED_NAME_CAN_TAG_SETTING) - private Boolean canTagSetting; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_ENVIRONMENT) + private Boolean canDeleteEnvironment; - 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_SETTING = + "canCreateOrUpdateSetting"; - public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_TAG = "canCreateOrUpdateTag"; - @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_TAG) - private Boolean canCreateOrUpdateTag; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SETTING) + private Boolean canCreateOrUpdateSetting; - 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_TAG_SETTING = "canTagSetting"; - public static final String SERIALIZED_NAME_CAN_MANAGE_WEBHOOK = "canManageWebhook"; - @SerializedName(SERIALIZED_NAME_CAN_MANAGE_WEBHOOK) - private Boolean canManageWebhook; + @SerializedName(SERIALIZED_NAME_CAN_TAG_SETTING) + private Boolean canTagSetting; - 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_DELETE_SETTING = "canDeleteSetting"; - public static final String SERIALIZED_NAME_CAN_MANAGE_PRODUCT_PREFERENCES = "canManageProductPreferences"; - @SerializedName(SERIALIZED_NAME_CAN_MANAGE_PRODUCT_PREFERENCES) - private Boolean canManageProductPreferences; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_SETTING) + private Boolean canDeleteSetting; - 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_CREATE_OR_UPDATE_TAG = "canCreateOrUpdateTag"; - public static final String SERIALIZED_NAME_CAN_VIEW_SDK_KEY = "canViewSdkKey"; - @SerializedName(SERIALIZED_NAME_CAN_VIEW_SDK_KEY) - private Boolean canViewSdkKey; + @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_TAG) + private Boolean canCreateOrUpdateTag; - 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_DELETE_TAG = "canDeleteTag"; - public static final String SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SEGMENTS = "canCreateOrUpdateSegments"; - @SerializedName(SERIALIZED_NAME_CAN_CREATE_OR_UPDATE_SEGMENTS) - private Boolean canCreateOrUpdateSegments; + @SerializedName(SERIALIZED_NAME_CAN_DELETE_TAG) + private Boolean canDeleteTag; - 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_MANAGE_WEBHOOK = "canManageWebhook"; - public static final String SERIALIZED_NAME_CAN_VIEW_PRODUCT_AUDIT_LOG = "canViewProductAuditLog"; - @SerializedName(SERIALIZED_NAME_CAN_VIEW_PRODUCT_AUDIT_LOG) - private Boolean canViewProductAuditLog; + @SerializedName(SERIALIZED_NAME_CAN_MANAGE_WEBHOOK) + private Boolean canManageWebhook; - 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_USE_EXPORT_IMPORT = "canUseExportImport"; - /** - * Gets or Sets accessType - */ - @JsonAdapter(AccessTypeEnum.Adapter.class) - public enum AccessTypeEnum { - READ_ONLY("readOnly"), - - FULL("full"), - - CUSTOM("custom"); + @SerializedName(SERIALIZED_NAME_CAN_USE_EXPORT_IMPORT) + private Boolean canUseExportImport; - private String value; + public static final String SERIALIZED_NAME_CAN_MANAGE_PRODUCT_PREFERENCES = + "canManageProductPreferences"; - AccessTypeEnum(String value) { - this.value = value; + @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; } - public String getValue() { - return value; + /** + * Name of the Permission Group. + * + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; } - @Override - public String toString() { - return String.valueOf(value); + public void setName(String name) { + this.name = name; } - public static AccessTypeEnum fromValue(String value) { - for (AccessTypeEnum b : AccessTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; + public UpdatePermissionGroupRequest canManageMembers(Boolean canManageMembers) { + this.canManageMembers = canManageMembers; + return this; } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AccessTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } + /** + * Group members can manage team members. + * + * @return canManageMembers + */ + @javax.annotation.Nullable + public Boolean getCanManageMembers() { + return canManageMembers; + } - @Override - public AccessTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AccessTypeEnum.fromValue(value); - } + public void setCanManageMembers(Boolean canManageMembers) { + this.canManageMembers = canManageMembers; } - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - AccessTypeEnum.fromValue(value); + 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; } - } - public static final String SERIALIZED_NAME_ACCESS_TYPE = "accessType"; - @SerializedName(SERIALIZED_NAME_ACCESS_TYPE) - private AccessTypeEnum accessType; + /** + * 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; + } - /** - * Gets or Sets newEnvironmentAccessType - */ - @JsonAdapter(NewEnvironmentAccessTypeEnum.Adapter.class) - public enum NewEnvironmentAccessTypeEnum { - FULL("full"), - - READ_ONLY("readOnly"), - - NONE("none"); + 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; + } - private String value; + 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; + } - NewEnvironmentAccessTypeEnum(String value) { - this.value = value; + /** + * Group members has access to product statistics. + * + * @return canViewProductStatistics + */ + @javax.annotation.Nullable + public Boolean getCanViewProductStatistics() { + return canViewProductStatistics; } - public String getValue() { - return value; + 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; } @Override - public String toString() { - return String.valueOf(value); + 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); } - public static NewEnvironmentAccessTypeEnum fromValue(String value) { - for (NewEnvironmentAccessTypeEnum b : NewEnvironmentAccessTypeEnum.values()) { - if (b.value.equals(value)) { - return b; + 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); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - return null; + 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("}"); + return sb.toString(); } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final NewEnvironmentAccessTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } + /** + * 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 "); + } - @Override - public NewEnvironmentAccessTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return NewEnvironmentAccessTypeEnum.fromValue(value); - } + 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 { - String value = jsonElement.getAsString(); - NewEnvironmentAccessTypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_NEW_ENVIRONMENT_ACCESS_TYPE = "newEnvironmentAccessType"; - @SerializedName(SERIALIZED_NAME_NEW_ENVIRONMENT_ACCESS_TYPE) - private NewEnvironmentAccessTypeEnum 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 accessType(AccessTypeEnum accessType) { - this.accessType = accessType; - return this; - } - - /** - * Get accessType - * @return accessType - */ - @javax.annotation.Nullable - public AccessTypeEnum getAccessType() { - return accessType; - } - - public void setAccessType(AccessTypeEnum accessType) { - this.accessType = accessType; - } - - - public UpdatePermissionGroupRequest newEnvironmentAccessType(NewEnvironmentAccessTypeEnum newEnvironmentAccessType) { - this.newEnvironmentAccessType = newEnvironmentAccessType; - return this; - } - - /** - * Get newEnvironmentAccessType - * @return newEnvironmentAccessType - */ - @javax.annotation.Nullable - public NewEnvironmentAccessTypeEnum getNewEnvironmentAccessType() { - return newEnvironmentAccessType; - } - - public void setNewEnvironmentAccessType(NewEnvironmentAccessTypeEnum 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; - } - - - - @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.accessType, updatePermissionGroupRequest.accessType) && - Objects.equals(this.newEnvironmentAccessType, updatePermissionGroupRequest.newEnvironmentAccessType) && - Objects.equals(this.environmentAccesses, updatePermissionGroupRequest.environmentAccesses); - } - - 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); - } - - 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(" accessType: ").append(toIndentedString(accessType)).append("\n"); - sb.append(" newEnvironmentAccessType: ").append(toIndentedString(newEnvironmentAccessType)).append("\n"); - sb.append(" environmentAccesses: ").append(toIndentedString(environmentAccesses)).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"); - - // 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())); + 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdatePermissionGroupRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdatePermissionGroupRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdatePermissionGroupRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdatePermissionGroupRequest` properties. JSON: %s", + entry.getKey(), jsonElement.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("accessType") != null && !jsonObj.get("accessType").isJsonNull()) && !jsonObj.get("accessType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `accessType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accessType").toString())); - } - // validate the optional field `accessType` - if (jsonObj.get("accessType") != null && !jsonObj.get("accessType").isJsonNull()) { - AccessTypeEnum.validateJsonElement(jsonObj.get("accessType")); - } - if ((jsonObj.get("newEnvironmentAccessType") != null && !jsonObj.get("newEnvironmentAccessType").isJsonNull()) && !jsonObj.get("newEnvironmentAccessType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `newEnvironmentAccessType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("newEnvironmentAccessType").toString())); - } - // validate the optional field `newEnvironmentAccessType` - if (jsonObj.get("newEnvironmentAccessType") != null && !jsonObj.get("newEnvironmentAccessType").isJsonNull()) { - NewEnvironmentAccessTypeEnum.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)); - }; + 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(); - elementAdapter.write(out, obj); - } - - @Override - public UpdatePermissionGroupRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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(); + elementAdapter.write(out, obj); + } + + @Override + public UpdatePermissionGroupRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index fcdbaac..7b2b3ee 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdatePreferencesRequest.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdatePreferencesRequest.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,400 +10,369 @@ * Do not edit the class manually. */ - package com.configcat.publicapi.java.client.model; -import java.util.Objects; -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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdatePreferencesRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** UpdatePreferencesRequest */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - - /** - * Determines the Feature Flag key generation mode. - */ - @JsonAdapter(KeyGenerationModeEnum.Adapter.class) - public enum KeyGenerationModeEnum { - CAMEL_CASE("camelCase"), - - LOWER_CASE("lowerCase"), - - UPPER_CASE("upperCase"), - - PASCAL_CASE("pascalCase"), - - KEBAB_CASE("kebabCase"); - - private String value; - - KeyGenerationModeEnum(String value) { - this.value = value; + 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; } - public String getValue() { - return value; + /** + * Indicates that a mandatory note is required for saving and publishing. + * + * @return reasonRequired + */ + @javax.annotation.Nullable + public Boolean getReasonRequired() { + return reasonRequired; } - @Override - public String toString() { - return String.valueOf(value); + public void setReasonRequired(Boolean reasonRequired) { + this.reasonRequired = reasonRequired; } - public static KeyGenerationModeEnum fromValue(String value) { - for (KeyGenerationModeEnum b : KeyGenerationModeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; + public UpdatePreferencesRequest keyGenerationMode(KeyGenerationMode keyGenerationMode) { + this.keyGenerationMode = keyGenerationMode; + return this; } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final KeyGenerationModeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public KeyGenerationModeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return KeyGenerationModeEnum.fromValue(value); - } + /** + * Get keyGenerationMode + * + * @return keyGenerationMode + */ + @javax.annotation.Nullable + public KeyGenerationMode getKeyGenerationMode() { + return keyGenerationMode; } - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - KeyGenerationModeEnum.fromValue(value); + 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 static final String SERIALIZED_NAME_KEY_GENERATION_MODE = "keyGenerationMode"; - @SerializedName(SERIALIZED_NAME_KEY_GENERATION_MODE) - private KeyGenerationModeEnum 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(KeyGenerationModeEnum keyGenerationMode) { - this.keyGenerationMode = keyGenerationMode; - return this; - } - - /** - * Determines the Feature Flag key generation mode. - * @return keyGenerationMode - */ - @javax.annotation.Nullable - public KeyGenerationModeEnum getKeyGenerationMode() { - return keyGenerationMode; - } - - public void setKeyGenerationMode(KeyGenerationModeEnum 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<>(); + + public void setShowVariationId(Boolean showVariationId) { + this.showVariationId = showVariationId; + } + + public UpdatePreferencesRequest mandatorySettingHint(Boolean mandatorySettingHint) { + this.mandatorySettingHint = mandatorySettingHint; + return this; } - 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; - } + /** + * Indicates whether Feature flags and Settings must have a hint. + * + * @return mandatorySettingHint + */ + @javax.annotation.Nullable + public Boolean getMandatorySettingHint() { + return mandatorySettingHint; + } - public void setReasonRequiredEnvironments(List reasonRequiredEnvironments) { - this.reasonRequiredEnvironments = reasonRequiredEnvironments; - } + 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; + } + + @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); + } + + 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); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; } - if (o == null || getClass() != o.getClass()) { - return false; + + @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("}"); + return sb.toString(); } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + /** + * 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 "); } - 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("}"); - 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"; + + 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(); } - 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())); + + /** + * 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdatePreferencesRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdatePreferencesRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdatePreferencesRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdatePreferencesRequest` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("keyGenerationMode") != null && !jsonObj.get("keyGenerationMode").isJsonNull()) && !jsonObj.get("keyGenerationMode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `keyGenerationMode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keyGenerationMode").toString())); - } - // validate the optional field `keyGenerationMode` - if (jsonObj.get("keyGenerationMode") != null && !jsonObj.get("keyGenerationMode").isJsonNull()) { - KeyGenerationModeEnum.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)); - }; + // 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(); - elementAdapter.write(out, obj); - } - - @Override - public UpdatePreferencesRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public UpdatePreferencesRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); } - } - - /** - * 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); - } -} + /** + * 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 index 36be190..5e08784 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateProductRequest.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateProductRequest.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,264 +10,274 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateProductRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** UpdateProductRequest */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * The name of the Product. + * + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; } - UpdateProductRequest updateProductRequest = (UpdateProductRequest) o; - return Objects.equals(this.name, updateProductRequest.name) && - Objects.equals(this.description, updateProductRequest.description) && - Objects.equals(this.order, updateProductRequest.order); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + public void setName(String name) { + this.name = name; } - 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("}"); - 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"; + + 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; } - 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())); + + public void setOrder(Integer order) { + this.order = order; + } + + @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); + } + + 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())); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateProductRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateProductRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + @Override + public int hashCode() { + return Objects.hash(name, description, order); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateProductRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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("}"); + return sb.toString(); } - } - - /** - * 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); - } -} + /** + * 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateProductRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateProductRequest` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateProductRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 9042f0e..128963c 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateReasonRequiredEnvironmentModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateReasonRequiredEnvironmentModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,224 +10,233 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Objects; import java.util.Set; +import java.util.UUID; -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateReasonRequiredEnvironmentModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** UpdateReasonRequiredEnvironmentModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Identifier of the Environment. + * + * @return environmentId + */ + @javax.annotation.Nullable + public UUID getEnvironmentId() { + return environmentId; + } + + public void setEnvironmentId(UUID environmentId) { + this.environmentId = environmentId; } - UpdateReasonRequiredEnvironmentModel updateReasonRequiredEnvironmentModel = (UpdateReasonRequiredEnvironmentModel) o; - return Objects.equals(this.environmentId, updateReasonRequiredEnvironmentModel.environmentId) && - Objects.equals(this.reasonRequired, updateReasonRequiredEnvironmentModel.reasonRequired); - } - - @Override - public int hashCode() { - return Objects.hash(environmentId, reasonRequired); - } - - @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("}"); - 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"; + + public UpdateReasonRequiredEnvironmentModel reasonRequired(Boolean reasonRequired) { + this.reasonRequired = reasonRequired; + return this; } - 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())); + + /** + * 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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(environmentId, reasonRequired); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateReasonRequiredEnvironmentModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateReasonRequiredEnvironmentModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + @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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateReasonRequiredEnvironmentModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateReasonRequiredEnvironmentModel` properties. JSON:" + + " %s", + entry.getKey(), 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())); - } - } + 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(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateReasonRequiredEnvironmentModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateReasonRequiredEnvironmentModel read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); - } -} + /** + * 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 index cb54d37..e198718 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateSegmentModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateSegmentModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,413 +10,350 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateSegmentModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** UpdateSegmentModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - - /** - * Gets or Sets comparator - */ - @JsonAdapter(ComparatorEnum.Adapter.class) - public enum ComparatorEnum { - 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; - - ComparatorEnum(String value) { - this.value = value; + 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; } - public String getValue() { - return value; + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; } - @Override - public String toString() { - return String.valueOf(value); + public void setName(String name) { + this.name = name; } - public static ComparatorEnum fromValue(String value) { - for (ComparatorEnum b : ComparatorEnum.values()) { - if (b.value.equals(value)) { - return b; + 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - } - return null; + 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); } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ComparatorEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ComparatorEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ComparatorEnum.fromValue(value); - } + 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())); } - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - ComparatorEnum.fromValue(value); + @Override + public int hashCode() { + return Objects.hash(name, description, comparisonAttribute, comparator, comparisonValue); } - } - - public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; - @SerializedName(SERIALIZED_NAME_COMPARATOR) - private ComparatorEnum 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(ComparatorEnum comparator) { - this.comparator = comparator; - return this; - } - - /** - * Get comparator - * @return comparator - */ - @javax.annotation.Nullable - public ComparatorEnum getComparator() { - return comparator; - } - - public void setComparator(ComparatorEnum 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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; } - if (o == null || getClass() != o.getClass()) { - return false; + + @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("}"); + return sb.toString(); } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + /** + * 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 "); } - 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("}"); - 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"; + + 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(); } - 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())); + + /** + * 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateSegmentModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateSegmentModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateSegmentModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateSegmentModel` properties. JSON: %s", + entry.getKey(), jsonElement.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())); - } - if ((jsonObj.get("comparator") != null && !jsonObj.get("comparator").isJsonNull()) && !jsonObj.get("comparator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `comparator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparator").toString())); - } - // validate the optional field `comparator` - if (jsonObj.get("comparator") != null && !jsonObj.get("comparator").isJsonNull()) { - ComparatorEnum.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(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateSegmentModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateSegmentModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); } - } - - /** - * 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); - } -} + /** + * 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 index 8bbdcce..097ca81 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,306 +10,323 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateSettingValueModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** UpdateSettingValueModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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_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 static final String SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS = "rolloutPercentageItems"; - @SerializedName(SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS) - private List rolloutPercentageItems; + public UpdateSettingValueModel rolloutPercentageItems( + List rolloutPercentageItems) { + this.rolloutPercentageItems = rolloutPercentageItems; + return this; + } - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private Object value = null; + public UpdateSettingValueModel addRolloutPercentageItemsItem( + RolloutPercentageItemModel rolloutPercentageItemsItem) { + if (this.rolloutPercentageItems == null) { + this.rolloutPercentageItems = new ArrayList<>(); + } + this.rolloutPercentageItems.add(rolloutPercentageItemsItem); + return this; + } - public UpdateSettingValueModel() { - } + /** + * The percentage rule collection. + * + * @return rolloutPercentageItems + */ + @javax.annotation.Nullable + public List getRolloutPercentageItems() { + return rolloutPercentageItems; + } - public UpdateSettingValueModel rolloutRules(List rolloutRules) { - this.rolloutRules = rolloutRules; - return this; - } + public void setRolloutPercentageItems(List rolloutPercentageItems) { + this.rolloutPercentageItems = rolloutPercentageItems; + } - public UpdateSettingValueModel addRolloutRulesItem(RolloutRuleModel rolloutRulesItem) { - if (this.rolloutRules == null) { - this.rolloutRules = new ArrayList<>(); + public UpdateSettingValueModel value(Object value) { + this.value = value; + return this; } - 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<>(); + + /** + * The value to serve. It must respect the setting type. + * + * @return value + */ + @javax.annotation.Nullable + public Object getValue() { + return value; } - 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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + public void setValue(Object value) { + this.value = value; } - if (o == null || getClass() != o.getClass()) { - return false; + + @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); } - UpdateSettingValueModel updateSettingValueModel = (UpdateSettingValueModel) o; - return Objects.equals(this.rolloutRules, updateSettingValueModel.rolloutRules) && - Objects.equals(this.rolloutPercentageItems, updateSettingValueModel.rolloutPercentageItems) && - Objects.equals(this.value, updateSettingValueModel.value); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + 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())); } - 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("}"); - 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"; + + @Override + public int hashCode() { + return Objects.hash(rolloutRules, rolloutPercentageItems, value); } - 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())); + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateSettingValueModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateSettingValueModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + @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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateSettingValueModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateSettingValueModel` properties. JSON: %s", + entry.getKey(), 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++) { - RolloutRuleModel.validateJsonElement(jsonArrayrolloutRules.get(i)); - }; + 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)); - }; + 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(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateSettingValueModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateSettingValueModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); - } -} + /** + * 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 index d230f72..0012c40 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueWithSettingIdModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValueWithSettingIdModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,332 +10,361 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateSettingValueWithSettingIdModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** UpdateSettingValueWithSettingIdModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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_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_ROLLOUT_PERCENTAGE_ITEMS = "rolloutPercentageItems"; - @SerializedName(SERIALIZED_NAME_ROLLOUT_PERCENTAGE_ITEMS) - private List rolloutPercentageItems; + public static final String SERIALIZED_NAME_VALUE = "value"; - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private Object value = null; + @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 static final String SERIALIZED_NAME_SETTING_ID = "settingId"; - @SerializedName(SERIALIZED_NAME_SETTING_ID) - private Integer settingId; + public UpdateSettingValueWithSettingIdModel addRolloutRulesItem( + RolloutRuleModel rolloutRulesItem) { + if (this.rolloutRules == null) { + this.rolloutRules = new ArrayList<>(); + } + this.rolloutRules.add(rolloutRulesItem); + return this; + } - public UpdateSettingValueWithSettingIdModel() { - } + /** + * The targeting rule collection. + * + * @return rolloutRules + */ + @javax.annotation.Nullable + public List getRolloutRules() { + return rolloutRules; + } - public UpdateSettingValueWithSettingIdModel rolloutRules(List rolloutRules) { - this.rolloutRules = rolloutRules; - return this; - } + public void setRolloutRules(List rolloutRules) { + this.rolloutRules = rolloutRules; + } - public UpdateSettingValueWithSettingIdModel addRolloutRulesItem(RolloutRuleModel rolloutRulesItem) { - if (this.rolloutRules == null) { - this.rolloutRules = new ArrayList<>(); + public UpdateSettingValueWithSettingIdModel rolloutPercentageItems( + List rolloutPercentageItems) { + this.rolloutPercentageItems = rolloutPercentageItems; + return this; } - 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<>(); + + public UpdateSettingValueWithSettingIdModel addRolloutPercentageItemsItem( + RolloutPercentageItemModel rolloutPercentageItemsItem) { + if (this.rolloutPercentageItems == null) { + this.rolloutPercentageItems = new ArrayList<>(); + } + this.rolloutPercentageItems.add(rolloutPercentageItemsItem); + return this; } - 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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + /** + * The percentage rule collection. + * + * @return rolloutPercentageItems + */ + @javax.annotation.Nullable + public List getRolloutPercentageItems() { + return rolloutPercentageItems; } - if (o == null || getClass() != o.getClass()) { - return false; + + public void setRolloutPercentageItems(List rolloutPercentageItems) { + this.rolloutPercentageItems = rolloutPercentageItems; } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + public UpdateSettingValueWithSettingIdModel value(Object value) { + this.value = value; + return this; } - 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("}"); - 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"; + + /** + * The value to serve. It must respect the setting type. + * + * @return value + */ + @javax.annotation.Nullable + public Object getValue() { + return value; } - 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())); + + 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; + } + + @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); + } + + 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); + } + + 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("}"); + 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateSettingValueWithSettingIdModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateSettingValueWithSettingIdModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateSettingValueWithSettingIdModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateSettingValueWithSettingIdModel` properties. JSON:" + + " %s", + entry.getKey(), 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++) { - RolloutRuleModel.validateJsonElement(jsonArrayrolloutRules.get(i)); - }; + 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)); - }; + 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(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateSettingValueWithSettingIdModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateSettingValueWithSettingIdModel read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); } - } - - /** - * 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); - } -} + /** + * 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 index d234f84..6befdc7 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValuesWithIdModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateSettingValuesWithIdModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,231 +10,242 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateSettingValuesWithIdModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** UpdateSettingValuesWithIdModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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 static final String SERIALIZED_NAME_SETTING_VALUES = "settingValues"; - public UpdateSettingValuesWithIdModel() { - } + @SerializedName(SERIALIZED_NAME_SETTING_VALUES) + private List settingValues; - public UpdateSettingValuesWithIdModel settingValues(List settingValues) { - this.settingValues = settingValues; - return this; - } + public UpdateSettingValuesWithIdModel() {} - public UpdateSettingValuesWithIdModel addSettingValuesItem(UpdateSettingValueWithSettingIdModel settingValuesItem) { - if (this.settingValues == null) { - this.settingValues = new ArrayList<>(); + public UpdateSettingValuesWithIdModel settingValues( + List settingValues) { + this.settingValues = settingValues; + return this; } - this.settingValues.add(settingValuesItem); - return this; - } - /** - * The values to update. - * @return settingValues - */ - @javax.annotation.Nullable - public List getSettingValues() { - return settingValues; - } + public UpdateSettingValuesWithIdModel addSettingValuesItem( + UpdateSettingValueWithSettingIdModel settingValuesItem) { + if (this.settingValues == null) { + this.settingValues = new ArrayList<>(); + } + this.settingValues.add(settingValuesItem); + return this; + } - public void setSettingValues(List settingValues) { - this.settingValues = settingValues; - } + /** + * The values to update. + * + * @return settingValues + */ + @javax.annotation.Nullable + public List getSettingValues() { + return settingValues; + } + public void setSettingValues(List settingValues) { + this.settingValues = settingValues; + } + @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); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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())); } - if (o == null || getClass() != o.getClass()) { - return false; + + @Override + public int hashCode() { + return Objects.hash(settingValues); } - UpdateSettingValuesWithIdModel updateSettingValuesWithIdModel = (UpdateSettingValuesWithIdModel) o; - return Objects.equals(this.settingValues, updateSettingValuesWithIdModel.settingValues); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + 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("}"); + 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 "); } - 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("}"); - 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"; + + 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(); } - 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())); + + /** + * 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateSettingValuesWithIdModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateSettingValuesWithIdModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateSettingValuesWithIdModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateSettingValuesWithIdModel` properties. JSON: %s", + entry.getKey(), jsonElement.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)); - }; + 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(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateSettingValuesWithIdModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateSettingValuesWithIdModel read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); } - } - - /** - * 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); - } -} + /** + * 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 index bd9eb52..1eddeda 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/UpdateTagModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/UpdateTagModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,238 +10,245 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * UpdateTagModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** UpdateTagModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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. - * @return color - */ - @javax.annotation.Nullable - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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. + * + * @return color + */ + @javax.annotation.Nullable + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + @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); + } + + 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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateTagModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateTagModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateTagModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateTagModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateTagModel` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateTagModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 new file mode 100644 index 0000000..30a7f4a --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/UserComparator.java @@ -0,0 +1,143 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * 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 index 2bb1905..256e583 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/UserConditionModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/UserConditionModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,387 +10,266 @@ * 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.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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Objects; 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 = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** Describes a condition that is based on user attributes. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - - /** - * The comparison operator which defines the relation between the comparison attribute and the comparison value. - */ - @JsonAdapter(ComparatorEnum.Adapter.class) - public enum ComparatorEnum { - 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; - - ComparatorEnum(String value) { - this.value = value; + 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; } - public String getValue() { - return value; + /** + * 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; } - @Override - public String toString() { - return String.valueOf(value); + public void setComparisonAttribute(String comparisonAttribute) { + this.comparisonAttribute = comparisonAttribute; } - public static ComparatorEnum fromValue(String value) { - for (ComparatorEnum b : ComparatorEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + public UserConditionModel comparator(UserComparator comparator) { + this.comparator = comparator; + return this; } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ComparatorEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ComparatorEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ComparatorEnum.fromValue(value); - } + /** + * Get comparator + * + * @return comparator + */ + @javax.annotation.Nonnull + public UserComparator getComparator() { + return comparator; } - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - ComparatorEnum.fromValue(value); + public void setComparator(UserComparator comparator) { + this.comparator = comparator; } - } - - public static final String SERIALIZED_NAME_COMPARATOR = "comparator"; - @SerializedName(SERIALIZED_NAME_COMPARATOR) - private ComparatorEnum 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(ComparatorEnum comparator) { - this.comparator = comparator; - return this; - } - - /** - * The comparison operator which defines the relation between the comparison attribute and the comparison value. - * @return comparator - */ - @javax.annotation.Nonnull - public ComparatorEnum getComparator() { - return comparator; - } - - public void setComparator(ComparatorEnum 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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + public UserConditionModel comparisonValue(ComparisonValueModel comparisonValue) { + this.comparisonValue = comparisonValue; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Get comparisonValue + * + * @return comparisonValue + */ + @javax.annotation.Nonnull + public ComparisonValueModel getComparisonValue() { + return comparisonValue; } - UserConditionModel userConditionModel = (UserConditionModel) o; - return Objects.equals(this.comparisonAttribute, userConditionModel.comparisonAttribute) && - Objects.equals(this.comparator, userConditionModel.comparator) && - Objects.equals(this.comparisonValue, userConditionModel.comparisonValue); - } - - @Override - public int hashCode() { - return Objects.hash(comparisonAttribute, comparator, comparisonValue); - } - - @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("}"); - 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"; + + public void setComparisonValue(ComparisonValueModel comparisonValue) { + this.comparisonValue = comparisonValue; } - 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())); + + @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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserConditionModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserConditionModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + @Override + public int hashCode() { + return Objects.hash(comparisonAttribute, comparator, comparisonValue); + } + + @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("}"); + 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 "); + } - // 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())); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserConditionModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UserConditionModel` properties. JSON: %s", + entry.getKey(), jsonElement.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())); - } - if (!jsonObj.get("comparator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `comparator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparator").toString())); - } - // validate the required field `comparator` - ComparatorEnum.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(); - elementAdapter.write(out, obj); - } - - @Override - public UserConditionModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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")); } - } - - /** - * 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); - } -} + 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(); + elementAdapter.write(out, obj); + } + + @Override + public UserConditionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index fc629f3..7c5f5d5 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/UserModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/UserModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,293 +10,307 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * UserModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** UserModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; } - if (o == null || getClass() != o.getClass()) { - return false; + + public UserModel twoFactorEnabled(Boolean twoFactorEnabled) { + this.twoFactorEnabled = twoFactorEnabled; + return this; } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + /** + * Determines whether 2FA is enabled for the Member. + * + * @return twoFactorEnabled + */ + @javax.annotation.Nullable + public Boolean getTwoFactorEnabled() { + return twoFactorEnabled; } - 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("}"); - 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"; + + public void setTwoFactorEnabled(Boolean twoFactorEnabled) { + this.twoFactorEnabled = twoFactorEnabled; } - 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())); + + @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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + 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); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public UserModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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("}"); + return sb.toString(); } - } - - /** - * 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); - } -} + /** + * 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UserModel` properties. JSON: %s", + entry.getKey(), 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(); + elementAdapter.write(out, obj); + } + + @Override + public UserModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 3510baf..223024c 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/ValueModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/ValueModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,287 +10,291 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -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 = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** Represents the value of a Feature Flag or Setting. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; } - if (o == null || getClass() != o.getClass()) { - return false; + + 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; } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + public void setStringValue(String stringValue) { + this.stringValue = stringValue; } - 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("}"); - 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"; + + public ValueModel intValue(Integer intValue) { + this.intValue = intValue; + return this; } - 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())); + + /** + * 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; + } + + @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); + } + + 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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ValueModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ValueModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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())); - } - } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } - 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(); - elementAdapter.write(out, obj); - } - - @Override - public ValueModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ValueModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ValueModel` properties. JSON: %s", + entry.getKey(), 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(); + elementAdapter.write(out, obj); + } + + @Override + public ValueModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); } - } - - /** - * 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); - } -} + /** + * 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..a2498f0 --- /dev/null +++ b/src/main/java/com/configcat/publicapi/java/client/model/WebHookHttpMethod.java @@ -0,0 +1,72 @@ +/* + * ConfigCat Public Management API + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * + * The version of the OpenAPI document: v1 + * Contact: support@configcat.com + * + * NOTE: This class is auto 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.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** 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 index 0903d62..3faad40 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/WebHookRequest.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/WebHookRequest.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,382 +10,343 @@ * Do not edit the class manually. */ - package com.configcat.publicapi.java.client.model; -import java.util.Objects; -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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * WebHookRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** WebHookRequest */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - - /** - * The HTTP method of the remote endpoint. - */ - @JsonAdapter(HttpMethodEnum.Adapter.class) - public enum HttpMethodEnum { - GET("get"), - - POST("post"); - - private String value; - - HttpMethodEnum(String value) { - this.value = value; + 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; } - public String getValue() { - return value; + /** + * The URL of the Webhook. + * + * @return url + */ + @javax.annotation.Nonnull + public String getUrl() { + return url; } - @Override - public String toString() { - return String.valueOf(value); + public void setUrl(String url) { + this.url = url; } - public static HttpMethodEnum fromValue(String value) { - for (HttpMethodEnum b : HttpMethodEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + public WebHookRequest content(String content) { + this.content = content; + return this; } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final HttpMethodEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public HttpMethodEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return HttpMethodEnum.fromValue(value); - } + /** + * The HTTP body content. + * + * @return content + */ + @javax.annotation.Nullable + public String getContent() { + return content; } - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - HttpMethodEnum.fromValue(value); + 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 static final String SERIALIZED_NAME_HTTP_METHOD = "httpMethod"; - @SerializedName(SERIALIZED_NAME_HTTP_METHOD) - private HttpMethodEnum 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(HttpMethodEnum httpMethod) { - this.httpMethod = httpMethod; - return this; - } - - /** - * The HTTP method of the remote endpoint. - * @return httpMethod - */ - @javax.annotation.Nullable - public HttpMethodEnum getHttpMethod() { - return httpMethod; - } - - public void setHttpMethod(HttpMethodEnum 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<>(); + + public void setHttpMethod(WebHookHttpMethod httpMethod) { + this.httpMethod = httpMethod; } - this.webHookHeaders.add(webHookHeadersItem); - return this; - } - /** - * List of HTTP headers. - * @return webHookHeaders - */ - @javax.annotation.Nullable - public List getWebHookHeaders() { - return webHookHeaders; - } + 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; + } - public void setWebHookHeaders(List webHookHeaders) { - this.webHookHeaders = webHookHeaders; - } + /** + * List of HTTP headers. + * + * @return webHookHeaders + */ + @javax.annotation.Nullable + public List getWebHookHeaders() { + return webHookHeaders; + } + public void setWebHookHeaders(List webHookHeaders) { + this.webHookHeaders = webHookHeaders; + } + @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); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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())); } - if (o == null || getClass() != o.getClass()) { - return false; + + @Override + public int hashCode() { + return Objects.hash(url, content, httpMethod, webHookHeaders); } - 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); - } - - 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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; } - 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("}"); - 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"; + + @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("}"); + return sb.toString(); } - 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())); + + /** + * 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"); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebHookRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebHookRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + /** + * 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebHookRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `WebHookRequest` properties. JSON: %s", + entry.getKey(), jsonElement.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())); + // 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())); - } - if ((jsonObj.get("httpMethod") != null && !jsonObj.get("httpMethod").isJsonNull()) && !jsonObj.get("httpMethod").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `httpMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("httpMethod").toString())); - } - // validate the optional field `httpMethod` - if (jsonObj.get("httpMethod") != null && !jsonObj.get("httpMethod").isJsonNull()) { - HttpMethodEnum.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)); - }; + 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(); - elementAdapter.write(out, obj); - } - - @Override - public WebHookRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public WebHookRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); - } -} + /** + * 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 index 612aced..58f1dcb 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/WebhookConfig.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/WebhookConfig.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,239 +10,246 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -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 = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** The Config where the applied changes will invoke the Webhook. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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; + } + + @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); + } + + 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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebhookConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookConfig` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public WebhookConfig read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebhookConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `WebhookConfig` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public WebhookConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 61ab756..2c759b0 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/WebhookEnvironment.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/WebhookEnvironment.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,239 +10,247 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; -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 = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** The Environment where the applied changes will invoke the Webhook. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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; + } + + @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); + } + + 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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebhookEnvironment.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookEnvironment` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public WebhookEnvironment read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebhookEnvironment.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `WebhookEnvironment` properties. JSON: %s", + entry.getKey(), jsonElement.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(); + elementAdapter.write(out, obj); + } + + @Override + public WebhookEnvironment read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 27cc371..1769ec2 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/WebhookHeaderModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/WebhookHeaderModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,261 +10,265 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Objects; import java.util.Set; -import com.configcat.publicapi.java.client.JSON; - -/** - * WebhookHeaderModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** WebhookHeaderModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * The HTTP header key. + * + * @return key + */ + @javax.annotation.Nonnull + public String getKey() { + return key; } - WebhookHeaderModel webhookHeaderModel = (WebhookHeaderModel) o; - return Objects.equals(this.key, webhookHeaderModel.key) && - Objects.equals(this.value, webhookHeaderModel.value) && - Objects.equals(this.isSecure, webhookHeaderModel.isSecure); - } - - @Override - public int hashCode() { - return Objects.hash(key, value, isSecure); - } - - @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("}"); - 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"; + + public void setKey(String key) { + this.key = key; } - 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())); + + 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; + } + + @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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebhookHeaderModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookHeaderModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + @Override + public int hashCode() { + return Objects.hash(key, value, isSecure); + } + + @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("}"); + 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; - // 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())); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebhookHeaderModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `WebhookHeaderModel` properties. JSON: %s", + entry.getKey(), jsonElement.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(); - elementAdapter.write(out, obj); - } - - @Override - public WebhookHeaderModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + 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(); + elementAdapter.write(out, obj); + } + + @Override + public WebhookHeaderModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); - } -} + /** + * 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 index c6ef8ae..2466b81 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/WebhookModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/WebhookModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,462 +10,423 @@ * Do not edit the class manually. */ - package com.configcat.publicapi.java.client.model; -import java.util.Objects; -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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * WebhookModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** WebhookModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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_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; + } - public static final String SERIALIZED_NAME_URL = "url"; - @SerializedName(SERIALIZED_NAME_URL) - private String url; + /** + * List of HTTP headers that the Webhook must send. + * + * @return webHookHeaders + */ + @javax.annotation.Nullable + public List getWebHookHeaders() { + return webHookHeaders; + } - /** - * The HTTP method. - */ - @JsonAdapter(HttpMethodEnum.Adapter.class) - public enum HttpMethodEnum { - GET("get"), - - POST("post"); + public void setWebHookHeaders(List webHookHeaders) { + this.webHookHeaders = webHookHeaders; + } - private String value; + public WebhookModel config(WebhookConfig config) { + this.config = config; + return this; + } - HttpMethodEnum(String value) { - this.value = value; + /** + * Get config + * + * @return config + */ + @javax.annotation.Nullable + public WebhookConfig getConfig() { + return config; } - public String getValue() { - return value; + 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; } @Override - public String toString() { - return String.valueOf(value); + 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); } - public static HttpMethodEnum fromValue(String value) { - for (HttpMethodEnum b : HttpMethodEnum.values()) { - if (b.value.equals(value)) { - return b; + 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); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final HttpMethodEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } + @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("}"); + 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 "); + } - @Override - public HttpMethodEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return HttpMethodEnum.fromValue(value); - } + 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 { - String value = jsonElement.getAsString(); - HttpMethodEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_HTTP_METHOD = "httpMethod"; - @SerializedName(SERIALIZED_NAME_HTTP_METHOD) - private HttpMethodEnum 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(HttpMethodEnum httpMethod) { - this.httpMethod = httpMethod; - return this; - } - - /** - * The HTTP method. - * @return httpMethod - */ - @javax.annotation.Nullable - public HttpMethodEnum getHttpMethod() { - return httpMethod; - } - - public void setHttpMethod(HttpMethodEnum 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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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())); + } } - } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebhookModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebhookModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `WebhookModel` properties. JSON: %s", + entry.getKey(), jsonElement.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())); - } - if ((jsonObj.get("httpMethod") != null && !jsonObj.get("httpMethod").isJsonNull()) && !jsonObj.get("httpMethod").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `httpMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("httpMethod").toString())); - } - // validate the optional field `httpMethod` - if (jsonObj.get("httpMethod") != null && !jsonObj.get("httpMethod").isJsonNull()) { - HttpMethodEnum.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)); - }; + 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 `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(); - elementAdapter.write(out, obj); - } - - @Override - public WebhookModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + // 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(); + elementAdapter.write(out, obj); + } + + @Override + public WebhookModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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 index 8ee4945..d8c21c0 100644 --- a/src/main/java/com/configcat/publicapi/java/client/model/WebhookSigningKeysModel.java +++ b/src/main/java/com/configcat/publicapi/java/client/model/WebhookSigningKeysModel.java @@ -1,6 +1,6 @@ /* * ConfigCat Public Management API - * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. + * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. **Base API URL**: https://api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. * * The version of the OpenAPI document: v1 * Contact: support@configcat.com @@ -10,238 +10,247 @@ * 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.configcat.publicapi.java.client.JSON; 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.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; 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.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.configcat.publicapi.java.client.JSON; - -/** - * WebhookSigningKeysModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-10T12:39:37.024419310Z[Etc/UTC]", comments = "Generator version: 7.7.0") +/** WebhookSigningKeysModel */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2024-10-09T12:38:06.739118192Z[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; - } - - - - @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); - } - - 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); - } - - 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("}"); - 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())); + 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; + } + + @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); + } + + 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); + } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebhookSigningKeysModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookSigningKeysModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; } - } - 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") + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @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(); - elementAdapter.write(out, obj); - } - - @Override - public WebhookSigningKeysModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.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); - } -} + 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("}"); + 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())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebhookSigningKeysModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `WebhookSigningKeysModel` properties. JSON: %s", + entry.getKey(), 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(); + elementAdapter.write(out, obj); + } + + @Override + public WebhookSigningKeysModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.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); + } +} diff --git a/src/test/java/com/configcat/publicapi/java/client/api/AuditLogsApiTest.java b/src/test/java/com/configcat/publicapi/java/client/api/AuditLogsApiTest.java deleted file mode 100644 index eb27009..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/api/AuditLogsApiTest.java +++ /dev/null @@ -1,90 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.ApiException; -import com.configcat.publicapi.java.client.model.AuditLogItemModel; -import java.time.OffsetDateTime; -import com.configcat.publicapi.java.client.model.SettingModel; -import java.util.UUID; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for AuditLogsApi - */ -@Disabled -public class AuditLogsApiTest { - - private final AuditLogsApi api = new AuditLogsApi(); - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getAuditlogsTest() throws ApiException { - UUID productId = null; - UUID configId = null; - UUID environmentId = null; - String auditLogType = null; - OffsetDateTime fromUtcDateTime = null; - OffsetDateTime toUtcDateTime = null; - List response = api.getAuditlogs(productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime); - // TODO: test validations - } - - /** - * List Deleted Settings - * - * This endpoint returns the list of Feature Flags and Settings that were deleted from the given Config. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getDeletedSettingsTest() throws ApiException { - UUID configId = null; - List response = api.getDeletedSettings(configId); - // TODO: test validations - } - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getOrganizationAuditlogsTest() throws ApiException { - UUID organizationId = null; - UUID productId = null; - UUID configId = null; - UUID environmentId = null; - String auditLogType = null; - OffsetDateTime fromUtcDateTime = null; - OffsetDateTime toUtcDateTime = null; - List response = api.getOrganizationAuditlogs(organizationId, productId, configId, environmentId, auditLogType, fromUtcDateTime, toUtcDateTime); - // TODO: test validations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/api/CodeReferencesApiTest.java b/src/test/java/com/configcat/publicapi/java/client/api/CodeReferencesApiTest.java deleted file mode 100644 index a9b8d87..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/api/CodeReferencesApiTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.ApiException; -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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for CodeReferencesApi - */ -@Disabled -public class CodeReferencesApiTest { - - private final CodeReferencesApi api = new CodeReferencesApi(); - - /** - * Delete Reference reports - * - * - * - * @throws ApiException if the Api call fails - */ - @Test - public void v1CodeReferencesDeleteReportsPostTest() throws ApiException { - DeleteRepositoryReportsRequest deleteRepositoryReportsRequest = null; - api.v1CodeReferencesDeleteReportsPost(deleteRepositoryReportsRequest); - // TODO: test validations - } - - /** - * Upload References - * - * - * - * @throws ApiException if the Api call fails - */ - @Test - public void v1CodeReferencesPostTest() throws ApiException { - CodeReferenceRequest codeReferenceRequest = null; - api.v1CodeReferencesPost(codeReferenceRequest); - // TODO: test validations - } - - /** - * Get References for Feature Flag or Setting - * - * - * - * @throws ApiException if the Api call fails - */ - @Test - public void v1SettingsSettingIdCodeReferencesGetTest() throws ApiException { - Integer settingId = null; - List response = api.v1SettingsSettingIdCodeReferencesGet(settingId); - // TODO: test validations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/api/ConfigsApiTest.java b/src/test/java/com/configcat/publicapi/java/client/api/ConfigsApiTest.java deleted file mode 100644 index de84e17..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/api/ConfigsApiTest.java +++ /dev/null @@ -1,109 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.ApiException; -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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for ConfigsApi - */ -@Disabled -public class ConfigsApiTest { - - private final ConfigsApi api = new ConfigsApi(); - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void createConfigTest() throws ApiException { - UUID productId = null; - CreateConfigRequest createConfigRequest = null; - ConfigModel response = api.createConfig(productId, createConfigRequest); - // TODO: test validations - } - - /** - * Delete Config - * - * This endpoint removes a Config identified by the `configId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void deleteConfigTest() throws ApiException { - UUID configId = null; - api.deleteConfig(configId); - // TODO: test validations - } - - /** - * Get Config - * - * This endpoint returns the metadata of a Config identified by the `configId`. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getConfigTest() throws ApiException { - UUID configId = null; - ConfigModel response = api.getConfig(configId); - // TODO: test validations - } - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getConfigsTest() throws ApiException { - UUID productId = null; - List response = api.getConfigs(productId); - // TODO: test validations - } - - /** - * Update Config - * - * This endpoint updates a Config identified by the `configId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void updateConfigTest() throws ApiException { - UUID configId = null; - UpdateConfigRequest updateConfigRequest = null; - ConfigModel response = api.updateConfig(configId, updateConfigRequest); - // TODO: test validations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/api/EnvironmentsApiTest.java b/src/test/java/com/configcat/publicapi/java/client/api/EnvironmentsApiTest.java deleted file mode 100644 index 92c79a8..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/api/EnvironmentsApiTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.ApiException; -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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for EnvironmentsApi - */ -@Disabled -public class EnvironmentsApiTest { - - private final EnvironmentsApi api = new EnvironmentsApi(); - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void createEnvironmentTest() throws ApiException { - UUID productId = null; - CreateEnvironmentModel createEnvironmentModel = null; - EnvironmentModel response = api.createEnvironment(productId, createEnvironmentModel); - // TODO: test validations - } - - /** - * 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). - * - * @throws ApiException if the Api call fails - */ - @Test - public void deleteEnvironmentTest() throws ApiException { - UUID environmentId = null; - Boolean cleanupAuditLogs = null; - api.deleteEnvironment(environmentId, cleanupAuditLogs); - // TODO: test validations - } - - /** - * Get Environment - * - * This endpoint returns the metadata of an Environment identified by the `environmentId`. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getEnvironmentTest() throws ApiException { - UUID environmentId = null; - EnvironmentModel response = api.getEnvironment(environmentId); - // TODO: test validations - } - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getEnvironmentsTest() throws ApiException { - UUID productId = null; - List response = api.getEnvironments(productId); - // TODO: test validations - } - - /** - * Update Environment - * - * This endpoint updates an Environment identified by the `environmentId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void updateEnvironmentTest() throws ApiException { - UUID environmentId = null; - UpdateEnvironmentModel updateEnvironmentModel = null; - EnvironmentModel response = api.updateEnvironment(environmentId, updateEnvironmentModel); - // TODO: test validations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesApiTest.java b/src/test/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesApiTest.java deleted file mode 100644 index 2646030..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesApiTest.java +++ /dev/null @@ -1,120 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.ApiException; -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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for FeatureFlagSettingValuesApi - */ -@Disabled -public class FeatureFlagSettingValuesApiTest { - - private final FeatureFlagSettingValuesApi api = new FeatureFlagSettingValuesApi(); - - /** - * 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). - * - * @throws ApiException if the Api call fails - */ - @Test - public void getSettingValueTest() throws ApiException { - UUID environmentId = null; - Integer settingId = null; - SettingValueModel response = api.getSettingValue(environmentId, settingId); - // TODO: test validations - } - - /** - * 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/). - * - * @throws ApiException if the Api call fails - */ - @Test - public void getSettingValuesTest() throws ApiException { - UUID configId = null; - UUID environmentId = null; - ConfigSettingValuesModel response = api.getSettingValues(configId, environmentId); - // TODO: test validations - } - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void postSettingValuesTest() throws ApiException { - UUID configId = null; - UUID environmentId = null; - UpdateSettingValuesWithIdModel updateSettingValuesWithIdModel = null; - String reason = null; - ConfigSettingValuesModel response = api.postSettingValues(configId, environmentId, updateSettingValuesWithIdModel, reason); - // TODO: test validations - } - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void replaceSettingValueTest() throws ApiException { - UUID environmentId = null; - Integer settingId = null; - UpdateSettingValueModel updateSettingValueModel = null; - String reason = null; - SettingValueModel response = api.replaceSettingValue(environmentId, settingId, updateSettingValueModel, reason); - // TODO: test validations - } - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void updateSettingValueTest() throws ApiException { - UUID environmentId = null; - Integer settingId = null; - List jsonPatchOperation = null; - String reason = null; - SettingValueModel response = api.updateSettingValue(environmentId, settingId, jsonPatchOperation, reason); - // TODO: test validations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyApiTest.java b/src/test/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyApiTest.java deleted file mode 100644 index 410bae9..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyApiTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.ApiException; -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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for FeatureFlagSettingValuesUsingSdkKeyApi - */ -@Disabled -public class FeatureFlagSettingValuesUsingSdkKeyApiTest { - - private final FeatureFlagSettingValuesUsingSdkKeyApi api = new FeatureFlagSettingValuesUsingSdkKeyApi(); - - /** - * 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/). - * - * @throws ApiException if the Api call fails - */ - @Test - public void getSettingValueBySdkkeyTest() throws ApiException { - String settingKeyOrId = null; - String X_CONFIGCAT_SDKKEY = null; - SettingValueModel response = api.getSettingValueBySdkkey(settingKeyOrId, X_CONFIGCAT_SDKKEY); - // TODO: test validations - } - - /** - * 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 } ``` - * - * @throws ApiException if the Api call fails - */ - @Test - public void replaceSettingValueBySdkkeyTest() throws ApiException { - String settingKeyOrId = null; - UpdateSettingValueModel updateSettingValueModel = null; - String reason = null; - String X_CONFIGCAT_SDKKEY = null; - SettingValueModel response = api.replaceSettingValueBySdkkey(settingKeyOrId, updateSettingValueModel, reason, X_CONFIGCAT_SDKKEY); - // TODO: test validations - } - - /** - * 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 } ``` - * - * @throws ApiException if the Api call fails - */ - @Test - public void updateSettingValueBySdkkeyTest() throws ApiException { - String settingKeyOrId = null; - List jsonPatchOperation = null; - String reason = null; - String X_CONFIGCAT_SDKKEY = null; - SettingValueModel response = api.updateSettingValueBySdkkey(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY); - // TODO: test validations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyV2ApiTest.java b/src/test/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyV2ApiTest.java deleted file mode 100644 index ef0d16d..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesUsingSdkKeyV2ApiTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.ApiException; -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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for FeatureFlagSettingValuesUsingSdkKeyV2Api - */ -@Disabled -public class FeatureFlagSettingValuesUsingSdkKeyV2ApiTest { - - private final FeatureFlagSettingValuesUsingSdkKeyV2Api api = new FeatureFlagSettingValuesUsingSdkKeyV2Api(); - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getSettingValueBySdkkeyV2Test() throws ApiException { - String settingKeyOrId = null; - String X_CONFIGCAT_SDKKEY = null; - SettingFormulaModel response = api.getSettingValueBySdkkeyV2(settingKeyOrId, X_CONFIGCAT_SDKKEY); - // TODO: test validations - } - - /** - * 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\": [] } ``` - * - * @throws ApiException if the Api call fails - */ - @Test - public void replaceSettingValueBySdkkeyV2Test() throws ApiException { - String settingKeyOrId = null; - UpdateEvaluationFormulaModel updateEvaluationFormulaModel = null; - String reason = null; - String X_CONFIGCAT_SDKKEY = null; - SettingFormulaModel response = api.replaceSettingValueBySdkkeyV2(settingKeyOrId, updateEvaluationFormulaModel, reason, X_CONFIGCAT_SDKKEY); - // TODO: test validations - } - - /** - * 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 } } ] } ``` - * - * @throws ApiException if the Api call fails - */ - @Test - public void updateSettingValueBySdkkeyV2Test() throws ApiException { - String settingKeyOrId = null; - List jsonPatchOperation = null; - String reason = null; - String X_CONFIGCAT_SDKKEY = null; - SettingFormulaModel response = api.updateSettingValueBySdkkeyV2(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY); - // TODO: test validations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesV2ApiTest.java b/src/test/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesV2ApiTest.java deleted file mode 100644 index a675706..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/api/FeatureFlagSettingValuesV2ApiTest.java +++ /dev/null @@ -1,120 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.ApiException; -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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for FeatureFlagSettingValuesV2Api - */ -@Disabled -public class FeatureFlagSettingValuesV2ApiTest { - - private final FeatureFlagSettingValuesV2Api api = new FeatureFlagSettingValuesV2Api(); - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getSettingValueV2Test() throws ApiException { - UUID environmentId = null; - Integer settingId = null; - SettingFormulaModel response = api.getSettingValueV2(environmentId, settingId); - // TODO: test validations - } - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getSettingValuesV2Test() throws ApiException { - UUID configId = null; - UUID environmentId = null; - ConfigSettingFormulasModel response = api.getSettingValuesV2(configId, environmentId); - // TODO: test validations - } - - /** - * 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 } } ] } ``` - * - * @throws ApiException if the Api call fails - */ - @Test - public void postSettingValuesV2Test() throws ApiException { - UUID configId = null; - UUID environmentId = null; - UpdateEvaluationFormulasModel updateEvaluationFormulasModel = null; - String reason = null; - ConfigSettingFormulasModel response = api.postSettingValuesV2(configId, environmentId, updateEvaluationFormulasModel, reason); - // TODO: test validations - } - - /** - * 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\": [] } ``` - * - * @throws ApiException if the Api call fails - */ - @Test - public void replaceSettingValueV2Test() throws ApiException { - UUID environmentId = null; - Integer settingId = null; - UpdateEvaluationFormulaModel updateEvaluationFormulaModel = null; - String reason = null; - SettingFormulaModel response = api.replaceSettingValueV2(environmentId, settingId, updateEvaluationFormulaModel, reason); - // TODO: test validations - } - - /** - * 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 } } ] } ``` - * - * @throws ApiException if the Api call fails - */ - @Test - public void updateSettingValueV2Test() throws ApiException { - UUID environmentId = null; - Integer settingId = null; - List jsonPatchOperation = null; - String reason = null; - SettingFormulaModel response = api.updateSettingValueV2(environmentId, settingId, jsonPatchOperation, reason); - // TODO: test validations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/api/FeatureFlagsSettingsApiTest.java b/src/test/java/com/configcat/publicapi/java/client/api/FeatureFlagsSettingsApiTest.java deleted file mode 100644 index ff8f6a3..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/api/FeatureFlagsSettingsApiTest.java +++ /dev/null @@ -1,125 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.ApiException; -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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for FeatureFlagsSettingsApi - */ -@Disabled -public class FeatureFlagsSettingsApiTest { - - private final FeatureFlagsSettingsApi api = new FeatureFlagsSettingsApi(); - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void createSettingTest() throws ApiException { - UUID configId = null; - CreateSettingInitialValues createSettingInitialValues = null; - SettingModel response = api.createSetting(configId, createSettingInitialValues); - // TODO: test validations - } - - /** - * Delete Flag - * - * This endpoint removes a Feature Flag or Setting from a specified Config, identified by the `configId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void deleteSettingTest() throws ApiException { - Integer settingId = null; - api.deleteSetting(settingId); - // TODO: test validations - } - - /** - * Get Flag - * - * This endpoint returns the metadata attributes of a Feature Flag or Setting identified by the `settingId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getSettingTest() throws ApiException { - Integer settingId = null; - SettingModel response = api.getSetting(settingId); - // TODO: test validations - } - - /** - * List Flags - * - * This endpoint returns the list of the Feature Flags and Settings defined in a specified Config, identified by the `configId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getSettingsTest() throws ApiException { - UUID configId = null; - List response = api.getSettings(configId); - // TODO: test validations - } - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void replaceSettingTest() throws ApiException { - Integer settingId = null; - ReplaceSettingModel replaceSettingModel = null; - SettingModel response = api.replaceSetting(settingId, replaceSettingModel); - // TODO: test validations - } - - /** - * 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\" } ] } ``` - * - * @throws ApiException if the Api call fails - */ - @Test - public void updateSettingTest() throws ApiException { - Integer settingId = null; - List jsonPatchOperation = null; - SettingModel response = api.updateSetting(settingId, jsonPatchOperation); - // TODO: test validations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/api/IntegrationLinksApiTest.java b/src/test/java/com/configcat/publicapi/java/client/api/IntegrationLinksApiTest.java deleted file mode 100644 index 16a50a1..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/api/IntegrationLinksApiTest.java +++ /dev/null @@ -1,113 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.ApiException; -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 java.util.UUID; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for IntegrationLinksApi - */ -@Disabled -public class IntegrationLinksApiTest { - - private final IntegrationLinksApi api = new IntegrationLinksApi(); - - /** - * Add or update Integration link - * - * - * - * @throws ApiException if the Api call fails - */ - @Test - public void addOrUpdateIntegrationLinkTest() throws ApiException { - UUID environmentId = null; - Integer settingId = null; - String integrationLinkType = null; - String key = null; - AddOrUpdateIntegrationLinkModel addOrUpdateIntegrationLinkModel = null; - IntegrationLinkModel response = api.addOrUpdateIntegrationLink(environmentId, settingId, integrationLinkType, key, addOrUpdateIntegrationLinkModel); - // TODO: test validations - } - - /** - * Delete Integration link - * - * - * - * @throws ApiException if the Api call fails - */ - @Test - public void deleteIntegrationLinkTest() throws ApiException { - UUID environmentId = null; - Integer settingId = null; - String integrationLinkType = null; - String key = null; - DeleteIntegrationLinkModel response = api.deleteIntegrationLink(environmentId, settingId, integrationLinkType, key); - // TODO: test validations - } - - /** - * Get Integration link - * - * - * - * @throws ApiException if the Api call fails - */ - @Test - public void getIntegrationLinkDetailsTest() throws ApiException { - String integrationLinkType = null; - String key = null; - IntegrationLinkDetailsModel response = api.getIntegrationLinkDetails(integrationLinkType, key); - // TODO: test validations - } - - /** - * @throws ApiException if the Api call fails - */ - @Test - public void jiraAddOrUpdateIntegrationLinkTest() throws ApiException { - UUID environmentId = null; - Integer settingId = null; - String key = null; - AddOrUpdateJiraIntegrationLinkModel addOrUpdateJiraIntegrationLinkModel = null; - IntegrationLinkModel response = api.jiraAddOrUpdateIntegrationLink(environmentId, settingId, key, addOrUpdateJiraIntegrationLinkModel); - // TODO: test validations - } - - /** - * @throws ApiException if the Api call fails - */ - @Test - public void jiraConnectTest() throws ApiException { - ConnectRequest connectRequest = null; - api.jiraConnect(connectRequest); - // TODO: test validations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/api/IntegrationsApiTest.java b/src/test/java/com/configcat/publicapi/java/client/api/IntegrationsApiTest.java deleted file mode 100644 index 7142054..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/api/IntegrationsApiTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.ApiException; -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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for IntegrationsApi - */ -@Disabled -public class IntegrationsApiTest { - - private final IntegrationsApi api = new IntegrationsApi(); - - /** - * 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) - * - * @throws ApiException if the Api call fails - */ - @Test - public void createIntegrationTest() throws ApiException { - UUID productId = null; - CreateIntegrationModel createIntegrationModel = null; - IntegrationModel response = api.createIntegration(productId, createIntegrationModel); - // TODO: test validations - } - - /** - * Delete Integration - * - * This endpoint removes a Integration identified by the `integrationId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void deleteIntegrationTest() throws ApiException { - UUID integrationId = null; - api.deleteIntegration(integrationId); - // TODO: test validations - } - - /** - * Get Integration - * - * This endpoint returns the metadata of an Integration identified by the `integrationId`. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getIntegrationTest() throws ApiException { - UUID integrationId = null; - IntegrationModel response = api.getIntegration(integrationId); - // TODO: test validations - } - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getIntegrationsTest() throws ApiException { - UUID productId = null; - IntegrationsModel response = api.getIntegrations(productId); - // TODO: test validations - } - - /** - * 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) - * - * @throws ApiException if the Api call fails - */ - @Test - public void updateIntegrationTest() throws ApiException { - UUID integrationId = null; - ModifyIntegrationRequest modifyIntegrationRequest = null; - IntegrationModel response = api.updateIntegration(integrationId, modifyIntegrationRequest); - // TODO: test validations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/api/MeApiTest.java b/src/test/java/com/configcat/publicapi/java/client/api/MeApiTest.java deleted file mode 100644 index 3399fd5..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/api/MeApiTest.java +++ /dev/null @@ -1,47 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.ApiException; -import com.configcat.publicapi.java.client.model.MeModel; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for MeApi - */ -@Disabled -public class MeApiTest { - - private final MeApi api = new MeApi(); - - /** - * Get authenticated user details - * - * - * - * @throws ApiException if the Api call fails - */ - @Test - public void getMeTest() throws ApiException { - MeModel response = api.getMe(); - // TODO: test validations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/api/MembersApiTest.java b/src/test/java/com/configcat/publicapi/java/client/api/MembersApiTest.java deleted file mode 100644 index c09a6c0..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/api/MembersApiTest.java +++ /dev/null @@ -1,186 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.ApiException; -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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for MembersApi - */ -@Disabled -public class MembersApiTest { - - private final MembersApi api = new MembersApi(); - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void addMemberToGroupTest() throws ApiException { - UUID organizationId = null; - String userId = null; - UpdateMemberPermissionsRequest updateMemberPermissionsRequest = null; - api.addMemberToGroup(organizationId, userId, updateMemberPermissionsRequest); - // TODO: test validations - } - - /** - * Delete Invitation - * - * This endpoint removes an Invitation identified by the `invitationId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void deleteInvitationTest() throws ApiException { - UUID invitationId = null; - api.deleteInvitation(invitationId); - // TODO: test validations - } - - /** - * Delete Member from Organization - * - * This endpoint removes a Member identified by the `userId` from the given Organization identified by the `organizationId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void deleteOrganizationMemberTest() throws ApiException { - UUID organizationId = null; - String userId = null; - api.deleteOrganizationMember(organizationId, userId); - // TODO: test validations - } - - /** - * Delete Member from Product - * - * This endpoint removes a Member identified by the `userId` from the given Product identified by the `productId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void deleteProductMemberTest() throws ApiException { - UUID productId = null; - String userId = null; - api.deleteProductMember(productId, userId); - // TODO: test validations - } - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getOrganizationMembersTest() throws ApiException { - UUID organizationId = null; - List response = api.getOrganizationMembers(organizationId); - // TODO: test validations - } - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getOrganizationMembersV2Test() throws ApiException { - UUID organizationId = null; - OrganizationMembersModel response = api.getOrganizationMembersV2(organizationId); - // TODO: test validations - } - - /** - * List Pending Invitations in Product - * - * This endpoint returns the list of pending invitations within the given Product identified by the `productId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getPendingInvitationsTest() throws ApiException { - UUID productId = null; - List response = api.getPendingInvitations(productId); - // TODO: test validations - } - - /** - * List Pending Invitations in Organization - * - * This endpoint returns the list of pending invitations within the given Organization identified by the `organizationId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getPendingInvitationsOrgTest() throws ApiException { - UUID organizationId = null; - List response = api.getPendingInvitationsOrg(organizationId); - // TODO: test validations - } - - /** - * List Product Members - * - * This endpoint returns the list of Members that belongs to the given Product, identified by the `productId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getProductMembersTest() throws ApiException { - UUID productId = null; - List response = api.getProductMembers(productId); - // TODO: test validations - } - - /** - * Invite Member - * - * This endpoint invites a Member into the given Product identified by the `productId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void inviteMemberTest() throws ApiException { - UUID productId = null; - InviteMembersRequest inviteMembersRequest = null; - api.inviteMember(productId, inviteMembersRequest); - // TODO: test validations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/api/OrganizationsApiTest.java b/src/test/java/com/configcat/publicapi/java/client/api/OrganizationsApiTest.java deleted file mode 100644 index 1963681..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/api/OrganizationsApiTest.java +++ /dev/null @@ -1,47 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.ApiException; -import com.configcat.publicapi.java.client.model.OrganizationModel; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for OrganizationsApi - */ -@Disabled -public class OrganizationsApiTest { - - private final OrganizationsApi api = new OrganizationsApi(); - - /** - * List Organizations - * - * This endpoint returns the list of the Organizations that belongs to the user. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getOrganizationsTest() throws ApiException { - List response = api.getOrganizations(); - // TODO: test validations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/api/PermissionGroupsApiTest.java b/src/test/java/com/configcat/publicapi/java/client/api/PermissionGroupsApiTest.java deleted file mode 100644 index 4509a40..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/api/PermissionGroupsApiTest.java +++ /dev/null @@ -1,109 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.ApiException; -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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for PermissionGroupsApi - */ -@Disabled -public class PermissionGroupsApiTest { - - private final PermissionGroupsApi api = new PermissionGroupsApi(); - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void createPermissionGroupTest() throws ApiException { - UUID productId = null; - CreatePermissionGroupRequest createPermissionGroupRequest = null; - PermissionGroupModel response = api.createPermissionGroup(productId, createPermissionGroupRequest); - // TODO: test validations - } - - /** - * Delete Permission Group - * - * This endpoint removes a Permission Group identified by the `permissionGroupId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void deletePermissionGroupTest() throws ApiException { - Long permissionGroupId = null; - api.deletePermissionGroup(permissionGroupId); - // TODO: test validations - } - - /** - * Get Permission Group - * - * This endpoint returns the metadata of a Permission Group identified by the `permissionGroupId`. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getPermissionGroupTest() throws ApiException { - Long permissionGroupId = null; - PermissionGroupModel response = api.getPermissionGroup(permissionGroupId); - // TODO: test validations - } - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getPermissionGroupsTest() throws ApiException { - UUID productId = null; - List response = api.getPermissionGroups(productId); - // TODO: test validations - } - - /** - * Update Permission Group - * - * This endpoint updates a Permission Group identified by the `permissionGroupId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void updatePermissionGroupTest() throws ApiException { - Long permissionGroupId = null; - UpdatePermissionGroupRequest updatePermissionGroupRequest = null; - PermissionGroupModel response = api.updatePermissionGroup(permissionGroupId, updatePermissionGroupRequest); - // TODO: test validations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/api/ProductsApiTest.java b/src/test/java/com/configcat/publicapi/java/client/api/ProductsApiTest.java deleted file mode 100644 index a1569be..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/api/ProductsApiTest.java +++ /dev/null @@ -1,139 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.ApiException; -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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for ProductsApi - */ -@Disabled -public class ProductsApiTest { - - private final ProductsApi api = new ProductsApi(); - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void createProductTest() throws ApiException { - UUID organizationId = null; - CreateProductRequest createProductRequest = null; - ProductModel response = api.createProduct(organizationId, createProductRequest); - // TODO: test validations - } - - /** - * Delete Product - * - * This endpoint removes a Product identified by the `productId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void deleteProductTest() throws ApiException { - UUID productId = null; - api.deleteProduct(productId); - // TODO: test validations - } - - /** - * Get Product - * - * This endpoint returns the metadata of a Product identified by the `productId`. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getProductTest() throws ApiException { - UUID productId = null; - ProductModel response = api.getProduct(productId); - // TODO: test validations - } - - /** - * Get Product Preferences - * - * This endpoint returns the preferences of a Product identified by the `productId`. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getProductPreferencesTest() throws ApiException { - UUID productId = null; - PreferencesModel response = api.getProductPreferences(productId); - // TODO: test validations - } - - /** - * List Products - * - * This endpoint returns the list of the Products that belongs to the user. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getProductsTest() throws ApiException { - List response = api.getProducts(); - // TODO: test validations - } - - /** - * Update Product - * - * This endpoint updates a Product identified by the `productId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void updateProductTest() throws ApiException { - UUID productId = null; - UpdateProductRequest updateProductRequest = null; - ProductModel response = api.updateProduct(productId, updateProductRequest); - // TODO: test validations - } - - /** - * Update Product Preferences - * - * This endpoint updates the preferences of a Product identified by the `productId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void updateProductPreferencesTest() throws ApiException { - UUID productId = null; - UpdatePreferencesRequest updatePreferencesRequest = null; - PreferencesModel response = api.updateProductPreferences(productId, updatePreferencesRequest); - // TODO: test validations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/api/SdkKeysApiTest.java b/src/test/java/com/configcat/publicapi/java/client/api/SdkKeysApiTest.java deleted file mode 100644 index fae9add..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/api/SdkKeysApiTest.java +++ /dev/null @@ -1,50 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.ApiException; -import com.configcat.publicapi.java.client.model.SdkKeysModel; -import java.util.UUID; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for SdkKeysApi - */ -@Disabled -public class SdkKeysApiTest { - - private final SdkKeysApi api = new SdkKeysApi(); - - /** - * Get SDK Key - * - * This endpoint returns the SDK Key for your Config in a specified Environment. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getSdkKeysTest() throws ApiException { - UUID configId = null; - UUID environmentId = null; - SdkKeysModel response = api.getSdkKeys(configId, environmentId); - // TODO: test validations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/api/SegmentsApiTest.java b/src/test/java/com/configcat/publicapi/java/client/api/SegmentsApiTest.java deleted file mode 100644 index eb7c2fc..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/api/SegmentsApiTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.ApiException; -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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for SegmentsApi - */ -@Disabled -public class SegmentsApiTest { - - private final SegmentsApi api = new SegmentsApi(); - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void createSegmentTest() throws ApiException { - UUID productId = null; - CreateSegmentModel createSegmentModel = null; - SegmentModel response = api.createSegment(productId, createSegmentModel); - // TODO: test validations - } - - /** - * Delete Segment - * - * This endpoint removes a Segment identified by the `segmentId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void deleteSegmentTest() throws ApiException { - UUID segmentId = null; - api.deleteSegment(segmentId); - // TODO: test validations - } - - /** - * Get Segment - * - * This endpoint returns the metadata of a Segment identified by the `segmentId`. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getSegmentTest() throws ApiException { - UUID segmentId = null; - SegmentModel response = api.getSegment(segmentId); - // TODO: test validations - } - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getSegmentsTest() throws ApiException { - UUID productId = null; - List response = api.getSegments(productId); - // TODO: test validations - } - - /** - * Update Segment - * - * This endpoint updates a Segment identified by the `segmentId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void updateSegmentTest() throws ApiException { - UUID segmentId = null; - UpdateSegmentModel updateSegmentModel = null; - SegmentModel response = api.updateSegment(segmentId, updateSegmentModel); - // TODO: test validations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/api/TagsApiTest.java b/src/test/java/com/configcat/publicapi/java/client/api/TagsApiTest.java deleted file mode 100644 index 9f2108a..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/api/TagsApiTest.java +++ /dev/null @@ -1,124 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.ApiException; -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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for TagsApi - */ -@Disabled -public class TagsApiTest { - - private final TagsApi api = new TagsApi(); - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void createTagTest() throws ApiException { - UUID productId = null; - CreateTagModel createTagModel = null; - TagModel response = api.createTag(productId, createTagModel); - // TODO: test validations - } - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void deleteTagTest() throws ApiException { - Long tagId = null; - api.deleteTag(tagId); - // TODO: test validations - } - - /** - * List Settings by Tag - * - * This endpoint returns the list of the Settings that has the specified Tag, identified by the `tagId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getSettingsByTagTest() throws ApiException { - Long tagId = null; - List response = api.getSettingsByTag(tagId); - // TODO: test validations - } - - /** - * Get Tag - * - * This endpoint returns the metadata of a Tag identified by the `tagId`. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getTagTest() throws ApiException { - Long tagId = null; - TagModel response = api.getTag(tagId); - // TODO: test validations - } - - /** - * List Tags - * - * This endpoint returns the list of the Tags in a specified Product, identified by the `productId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getTagsTest() throws ApiException { - UUID productId = null; - List response = api.getTags(productId); - // TODO: test validations - } - - /** - * Update Tag - * - * This endpoint updates a Tag identified by the `tagId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void updateTagTest() throws ApiException { - Long tagId = null; - UpdateTagModel updateTagModel = null; - TagModel response = api.updateTag(tagId, updateTagModel); - // TODO: test validations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/api/WebhooksApiTest.java b/src/test/java/com/configcat/publicapi/java/client/api/WebhooksApiTest.java deleted file mode 100644 index 429a284..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/api/WebhooksApiTest.java +++ /dev/null @@ -1,140 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.ApiException; -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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for WebhooksApi - */ -@Disabled -public class WebhooksApiTest { - - private final WebhooksApi api = new WebhooksApi(); - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void createWebhookTest() throws ApiException { - UUID configId = null; - UUID environmentId = null; - WebHookRequest webHookRequest = null; - WebhookModel response = api.createWebhook(configId, environmentId, webHookRequest); - // TODO: test validations - } - - /** - * Delete Webhook - * - * This endpoint removes a Webhook identified by the `webhookId` parameter. - * - * @throws ApiException if the Api call fails - */ - @Test - public void deleteWebhookTest() throws ApiException { - Integer webhookId = null; - api.deleteWebhook(webhookId); - // TODO: test validations - } - - /** - * Get Webhook - * - * This endpoint returns the metadata of a Webhook identified by the `webhookId`. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getWebhookTest() throws ApiException { - Integer webhookId = null; - WebhookModel response = api.getWebhook(webhookId); - // TODO: test validations - } - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getWebhookSigningKeysTest() throws ApiException { - Integer webhookId = null; - WebhookSigningKeysModel response = api.getWebhookSigningKeys(webhookId); - // TODO: test validations - } - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getWebhooksTest() throws ApiException { - UUID productId = null; - List response = api.getWebhooks(productId); - // TODO: test validations - } - - /** - * 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. - * - * @throws ApiException if the Api call fails - */ - @Test - public void replaceWebhookTest() throws ApiException { - Integer webhookId = null; - WebHookRequest webHookRequest = null; - WebhookModel response = api.replaceWebhook(webhookId, webHookRequest); - // TODO: test validations - } - - /** - * 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 } ] } ``` - * - * @throws ApiException if the Api call fails - */ - @Test - public void updateWebhookTest() throws ApiException { - Integer webhookId = null; - List jsonPatchOperation = null; - WebhookModel response = api.updateWebhook(webhookId, jsonPatchOperation); - // TODO: test validations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/AddOrUpdateIntegrationLinkModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/AddOrUpdateIntegrationLinkModelTest.java deleted file mode 100644 index 266c3ad..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/AddOrUpdateIntegrationLinkModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for AddOrUpdateIntegrationLinkModel - */ -public class AddOrUpdateIntegrationLinkModelTest { - private final AddOrUpdateIntegrationLinkModel model = new AddOrUpdateIntegrationLinkModel(); - - /** - * Model tests for AddOrUpdateIntegrationLinkModel - */ - @Test - public void testAddOrUpdateIntegrationLinkModel() { - // TODO: test AddOrUpdateIntegrationLinkModel - } - - /** - * Test the property 'description' - */ - @Test - public void descriptionTest() { - // TODO: test description - } - - /** - * Test the property 'url' - */ - @Test - public void urlTest() { - // TODO: test url - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/AddOrUpdateJiraIntegrationLinkModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/AddOrUpdateJiraIntegrationLinkModelTest.java deleted file mode 100644 index 36102e9..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/AddOrUpdateJiraIntegrationLinkModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for AddOrUpdateJiraIntegrationLinkModel - */ -public class AddOrUpdateJiraIntegrationLinkModelTest { - private final AddOrUpdateJiraIntegrationLinkModel model = new AddOrUpdateJiraIntegrationLinkModel(); - - /** - * Model tests for AddOrUpdateJiraIntegrationLinkModel - */ - @Test - public void testAddOrUpdateJiraIntegrationLinkModel() { - // TODO: test AddOrUpdateJiraIntegrationLinkModel - } - - /** - * Test the property 'jiraJwtToken' - */ - @Test - public void jiraJwtTokenTest() { - // TODO: test jiraJwtToken - } - - /** - * Test the property 'clientKey' - */ - @Test - public void clientKeyTest() { - // TODO: test clientKey - } - - /** - * Test the property 'description' - */ - @Test - public void descriptionTest() { - // TODO: test description - } - - /** - * Test the property 'url' - */ - @Test - public void urlTest() { - // TODO: test url - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/AuditLogItemModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/AuditLogItemModelTest.java deleted file mode 100644 index 187b321..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/AuditLogItemModelTest.java +++ /dev/null @@ -1,139 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for AuditLogItemModel - */ -public class AuditLogItemModelTest { - private final AuditLogItemModel model = new AuditLogItemModel(); - - /** - * Model tests for AuditLogItemModel - */ - @Test - public void testAuditLogItemModel() { - // TODO: test AuditLogItemModel - } - - /** - * Test the property 'auditLogId' - */ - @Test - public void auditLogIdTest() { - // TODO: test auditLogId - } - - /** - * Test the property 'auditLogDateTime' - */ - @Test - public void auditLogDateTimeTest() { - // TODO: test auditLogDateTime - } - - /** - * Test the property 'auditLogTypeEnum' - */ - @Test - public void auditLogTypeEnumTest() { - // TODO: test auditLogTypeEnum - } - - /** - * Test the property 'changeSetId' - */ - @Test - public void changeSetIdTest() { - // TODO: test changeSetId - } - - /** - * Test the property 'truncated' - */ - @Test - public void truncatedTest() { - // TODO: test truncated - } - - /** - * Test the property 'auditLogType' - */ - @Test - public void auditLogTypeTest() { - // TODO: test auditLogType - } - - /** - * Test the property 'userEmail' - */ - @Test - public void userEmailTest() { - // TODO: test userEmail - } - - /** - * Test the property 'userName' - */ - @Test - public void userNameTest() { - // TODO: test userName - } - - /** - * Test the property 'where' - */ - @Test - public void whereTest() { - // TODO: test where - } - - /** - * Test the property 'why' - */ - @Test - public void whyTest() { - // TODO: test why - } - - /** - * Test the property 'actionTarget' - */ - @Test - public void actionTargetTest() { - // TODO: test actionTarget - } - - /** - * Test the property 'details' - */ - @Test - public void detailsTest() { - // TODO: test details - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/CodeReferenceModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/CodeReferenceModelTest.java deleted file mode 100644 index 247cbaa..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/CodeReferenceModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for CodeReferenceModel - */ -public class CodeReferenceModelTest { - private final CodeReferenceModel model = new CodeReferenceModel(); - - /** - * Model tests for CodeReferenceModel - */ - @Test - public void testCodeReferenceModel() { - // TODO: test CodeReferenceModel - } - - /** - * Test the property 'branch' - */ - @Test - public void branchTest() { - // TODO: test branch - } - - /** - * Test the property 'references' - */ - @Test - public void referencesTest() { - // TODO: test references - } - - /** - * Test the property 'commitUrl' - */ - @Test - public void commitUrlTest() { - // TODO: test commitUrl - } - - /** - * Test the property 'commitHash' - */ - @Test - public void commitHashTest() { - // TODO: test commitHash - } - - /** - * Test the property 'syncedAt' - */ - @Test - public void syncedAtTest() { - // TODO: test syncedAt - } - - /** - * Test the property 'repository' - */ - @Test - public void repositoryTest() { - // TODO: test repository - } - - /** - * Test the property 'codeReferenceId' - */ - @Test - public void codeReferenceIdTest() { - // TODO: test codeReferenceId - } - - /** - * Test the property 'uploader' - */ - @Test - public void uploaderTest() { - // TODO: test uploader - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/CodeReferenceRequestTest.java b/src/test/java/com/configcat/publicapi/java/client/model/CodeReferenceRequestTest.java deleted file mode 100644 index 1b3f3b2..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/CodeReferenceRequestTest.java +++ /dev/null @@ -1,109 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for CodeReferenceRequest - */ -public class CodeReferenceRequestTest { - private final CodeReferenceRequest model = new CodeReferenceRequest(); - - /** - * Model tests for CodeReferenceRequest - */ - @Test - public void testCodeReferenceRequest() { - // TODO: test CodeReferenceRequest - } - - /** - * Test the property 'configId' - */ - @Test - public void configIdTest() { - // TODO: test configId - } - - /** - * Test the property 'repository' - */ - @Test - public void repositoryTest() { - // TODO: test repository - } - - /** - * Test the property 'branch' - */ - @Test - public void branchTest() { - // TODO: test branch - } - - /** - * Test the property 'commitUrl' - */ - @Test - public void commitUrlTest() { - // TODO: test commitUrl - } - - /** - * Test the property 'commitHash' - */ - @Test - public void commitHashTest() { - // TODO: test commitHash - } - - /** - * Test the property 'uploader' - */ - @Test - public void uploaderTest() { - // TODO: test uploader - } - - /** - * Test the property 'activeBranches' - */ - @Test - public void activeBranchesTest() { - // TODO: test activeBranches - } - - /** - * Test the property 'flagReferences' - */ - @Test - public void flagReferencesTest() { - // TODO: test flagReferences - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/ComparisonValueListModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/ComparisonValueListModelTest.java deleted file mode 100644 index b1bd4c2..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/ComparisonValueListModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for ComparisonValueListModel - */ -public class ComparisonValueListModelTest { - private final ComparisonValueListModel model = new ComparisonValueListModel(); - - /** - * Model tests for ComparisonValueListModel - */ - @Test - public void testComparisonValueListModel() { - // TODO: test ComparisonValueListModel - } - - /** - * Test the property 'value' - */ - @Test - public void valueTest() { - // TODO: test value - } - - /** - * Test the property 'hint' - */ - @Test - public void hintTest() { - // TODO: test hint - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/ComparisonValueModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/ComparisonValueModelTest.java deleted file mode 100644 index 61754ba..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/ComparisonValueModelTest.java +++ /dev/null @@ -1,68 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for ComparisonValueModel - */ -public class ComparisonValueModelTest { - private final ComparisonValueModel model = new ComparisonValueModel(); - - /** - * Model tests for ComparisonValueModel - */ - @Test - public void testComparisonValueModel() { - // TODO: test ComparisonValueModel - } - - /** - * Test the property 'stringValue' - */ - @Test - public void stringValueTest() { - // TODO: test stringValue - } - - /** - * Test the property 'doubleValue' - */ - @Test - public void doubleValueTest() { - // TODO: test doubleValue - } - - /** - * Test the property 'listValue' - */ - @Test - public void listValueTest() { - // TODO: test listValue - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/ConditionModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/ConditionModelTest.java deleted file mode 100644 index 466780f..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/ConditionModelTest.java +++ /dev/null @@ -1,67 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for ConditionModel - */ -public class ConditionModelTest { - private final ConditionModel model = new ConditionModel(); - - /** - * Model tests for ConditionModel - */ - @Test - public void testConditionModel() { - // TODO: test ConditionModel - } - - /** - * Test the property 'userCondition' - */ - @Test - public void userConditionTest() { - // TODO: test userCondition - } - - /** - * Test the property 'segmentCondition' - */ - @Test - public void segmentConditionTest() { - // TODO: test segmentCondition - } - - /** - * Test the property 'prerequisiteFlagCondition' - */ - @Test - public void prerequisiteFlagConditionTest() { - // TODO: test prerequisiteFlagCondition - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/ConfigModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/ConfigModelTest.java deleted file mode 100644 index e9b6de5..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/ConfigModelTest.java +++ /dev/null @@ -1,99 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for ConfigModel - */ -public class ConfigModelTest { - private final ConfigModel model = new ConfigModel(); - - /** - * Model tests for ConfigModel - */ - @Test - public void testConfigModel() { - // TODO: test ConfigModel - } - - /** - * Test the property 'product' - */ - @Test - public void productTest() { - // TODO: test product - } - - /** - * Test the property 'configId' - */ - @Test - public void configIdTest() { - // TODO: test configId - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'description' - */ - @Test - public void descriptionTest() { - // TODO: test description - } - - /** - * Test the property 'order' - */ - @Test - public void orderTest() { - // TODO: test order - } - - /** - * Test the property 'migratedConfigId' - */ - @Test - public void migratedConfigIdTest() { - // TODO: test migratedConfigId - } - - /** - * Test the property 'evaluationVersion' - */ - @Test - public void evaluationVersionTest() { - // TODO: test evaluationVersion - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulaModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulaModelTest.java deleted file mode 100644 index 37fb026..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulaModelTest.java +++ /dev/null @@ -1,138 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for ConfigSettingFormulaModel - */ -public class ConfigSettingFormulaModelTest { - private final ConfigSettingFormulaModel model = new ConfigSettingFormulaModel(); - - /** - * Model tests for ConfigSettingFormulaModel - */ - @Test - public void testConfigSettingFormulaModel() { - // TODO: test ConfigSettingFormulaModel - } - - /** - * Test the property 'lastVersionId' - */ - @Test - public void lastVersionIdTest() { - // TODO: test lastVersionId - } - - /** - * Test the property 'defaultValue' - */ - @Test - public void defaultValueTest() { - // TODO: test defaultValue - } - - /** - * Test the property 'targetingRules' - */ - @Test - public void targetingRulesTest() { - // TODO: test targetingRules - } - - /** - * Test the property 'setting' - */ - @Test - public void settingTest() { - // TODO: test setting - } - - /** - * Test the property 'updatedAt' - */ - @Test - public void updatedAtTest() { - // TODO: test updatedAt - } - - /** - * Test the property 'percentageEvaluationAttribute' - */ - @Test - public void percentageEvaluationAttributeTest() { - // TODO: test percentageEvaluationAttribute - } - - /** - * Test the property 'lastUpdaterUserEmail' - */ - @Test - public void lastUpdaterUserEmailTest() { - // TODO: test lastUpdaterUserEmail - } - - /** - * Test the property 'lastUpdaterUserFullName' - */ - @Test - public void lastUpdaterUserFullNameTest() { - // TODO: test lastUpdaterUserFullName - } - - /** - * Test the property 'integrationLinks' - */ - @Test - public void integrationLinksTest() { - // TODO: test integrationLinks - } - - /** - * Test the property 'settingTags' - */ - @Test - public void settingTagsTest() { - // TODO: test settingTags - } - - /** - * Test the property 'settingIdsWherePrerequisite' - */ - @Test - public void settingIdsWherePrerequisiteTest() { - // TODO: test settingIdsWherePrerequisite - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulasModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulasModelTest.java deleted file mode 100644 index 708ec08..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/ConfigSettingFormulasModelTest.java +++ /dev/null @@ -1,87 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for ConfigSettingFormulasModel - */ -public class ConfigSettingFormulasModelTest { - private final ConfigSettingFormulasModel model = new ConfigSettingFormulasModel(); - - /** - * Model tests for ConfigSettingFormulasModel - */ - @Test - public void testConfigSettingFormulasModel() { - // TODO: test ConfigSettingFormulasModel - } - - /** - * Test the property 'config' - */ - @Test - public void configTest() { - // TODO: test config - } - - /** - * Test the property 'environment' - */ - @Test - public void environmentTest() { - // TODO: test environment - } - - /** - * Test the property 'readOnly' - */ - @Test - public void readOnlyTest() { - // TODO: test readOnly - } - - /** - * Test the property 'settingFormulas' - */ - @Test - public void settingFormulasTest() { - // TODO: test settingFormulas - } - - /** - * Test the property 'featureFlagLimitations' - */ - @Test - public void featureFlagLimitationsTest() { - // TODO: test featureFlagLimitations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/ConfigSettingValueModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/ConfigSettingValueModelTest.java deleted file mode 100644 index 04b80c0..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/ConfigSettingValueModelTest.java +++ /dev/null @@ -1,121 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for ConfigSettingValueModel - */ -public class ConfigSettingValueModelTest { - private final ConfigSettingValueModel model = new ConfigSettingValueModel(); - - /** - * Model tests for ConfigSettingValueModel - */ - @Test - public void testConfigSettingValueModel() { - // TODO: test ConfigSettingValueModel - } - - /** - * Test the property 'rolloutRules' - */ - @Test - public void rolloutRulesTest() { - // TODO: test rolloutRules - } - - /** - * Test the property 'rolloutPercentageItems' - */ - @Test - public void rolloutPercentageItemsTest() { - // TODO: test rolloutPercentageItems - } - - /** - * Test the property 'value' - */ - @Test - public void valueTest() { - // TODO: test value - } - - /** - * Test the property 'setting' - */ - @Test - public void settingTest() { - // TODO: test setting - } - - /** - * Test the property 'updatedAt' - */ - @Test - public void updatedAtTest() { - // TODO: test updatedAt - } - - /** - * Test the property 'lastUpdaterUserEmail' - */ - @Test - public void lastUpdaterUserEmailTest() { - // TODO: test lastUpdaterUserEmail - } - - /** - * Test the property 'lastUpdaterUserFullName' - */ - @Test - public void lastUpdaterUserFullNameTest() { - // TODO: test lastUpdaterUserFullName - } - - /** - * Test the property 'integrationLinks' - */ - @Test - public void integrationLinksTest() { - // TODO: test integrationLinks - } - - /** - * Test the property 'settingTags' - */ - @Test - public void settingTagsTest() { - // TODO: test settingTags - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/ConfigSettingValuesModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/ConfigSettingValuesModelTest.java deleted file mode 100644 index 03f847b..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/ConfigSettingValuesModelTest.java +++ /dev/null @@ -1,87 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for ConfigSettingValuesModel - */ -public class ConfigSettingValuesModelTest { - private final ConfigSettingValuesModel model = new ConfigSettingValuesModel(); - - /** - * Model tests for ConfigSettingValuesModel - */ - @Test - public void testConfigSettingValuesModel() { - // TODO: test ConfigSettingValuesModel - } - - /** - * Test the property 'config' - */ - @Test - public void configTest() { - // TODO: test config - } - - /** - * Test the property 'environment' - */ - @Test - public void environmentTest() { - // TODO: test environment - } - - /** - * Test the property 'readOnly' - */ - @Test - public void readOnlyTest() { - // TODO: test readOnly - } - - /** - * Test the property 'settingValues' - */ - @Test - public void settingValuesTest() { - // TODO: test settingValues - } - - /** - * Test the property 'featureFlagLimitations' - */ - @Test - public void featureFlagLimitationsTest() { - // TODO: test featureFlagLimitations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/ConnectRequestTest.java b/src/test/java/com/configcat/publicapi/java/client/model/ConnectRequestTest.java deleted file mode 100644 index ade96bb..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/ConnectRequestTest.java +++ /dev/null @@ -1,56 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for ConnectRequest - */ -public class ConnectRequestTest { - private final ConnectRequest model = new ConnectRequest(); - - /** - * Model tests for ConnectRequest - */ - @Test - public void testConnectRequest() { - // TODO: test ConnectRequest - } - - /** - * Test the property 'clientKey' - */ - @Test - public void clientKeyTest() { - // TODO: test clientKey - } - - /** - * Test the property 'jiraJwtToken' - */ - @Test - public void jiraJwtTokenTest() { - // TODO: test jiraJwtToken - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/CreateConfigRequestTest.java b/src/test/java/com/configcat/publicapi/java/client/model/CreateConfigRequestTest.java deleted file mode 100644 index 269906f..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/CreateConfigRequestTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for CreateConfigRequest - */ -public class CreateConfigRequestTest { - private final CreateConfigRequest model = new CreateConfigRequest(); - - /** - * Model tests for CreateConfigRequest - */ - @Test - public void testCreateConfigRequest() { - // TODO: test CreateConfigRequest - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'description' - */ - @Test - public void descriptionTest() { - // TODO: test description - } - - /** - * Test the property 'order' - */ - @Test - public void orderTest() { - // TODO: test order - } - - /** - * Test the property 'evaluationVersion' - */ - @Test - public void evaluationVersionTest() { - // TODO: test evaluationVersion - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/CreateEnvironmentModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/CreateEnvironmentModelTest.java deleted file mode 100644 index a03b5cf..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/CreateEnvironmentModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for CreateEnvironmentModel - */ -public class CreateEnvironmentModelTest { - private final CreateEnvironmentModel model = new CreateEnvironmentModel(); - - /** - * Model tests for CreateEnvironmentModel - */ - @Test - public void testCreateEnvironmentModel() { - // TODO: test CreateEnvironmentModel - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - - /** - * Test the property 'description' - */ - @Test - public void descriptionTest() { - // TODO: test description - } - - /** - * Test the property 'order' - */ - @Test - public void orderTest() { - // TODO: test order - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/CreateIntegrationModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/CreateIntegrationModelTest.java deleted file mode 100644 index c79b723..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/CreateIntegrationModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for CreateIntegrationModel - */ -public class CreateIntegrationModelTest { - private final CreateIntegrationModel model = new CreateIntegrationModel(); - - /** - * Model tests for CreateIntegrationModel - */ - @Test - public void testCreateIntegrationModel() { - // TODO: test CreateIntegrationModel - } - - /** - * Test the property 'integrationType' - */ - @Test - public void integrationTypeTest() { - // TODO: test integrationType - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'parameters' - */ - @Test - public void parametersTest() { - // TODO: test parameters - } - - /** - * Test the property 'environmentIds' - */ - @Test - public void environmentIdsTest() { - // TODO: test environmentIds - } - - /** - * Test the property 'configIds' - */ - @Test - public void configIdsTest() { - // TODO: test configIds - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/CreateOrUpdateEnvironmentAccessModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/CreateOrUpdateEnvironmentAccessModelTest.java deleted file mode 100644 index 8330952..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/CreateOrUpdateEnvironmentAccessModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for CreateOrUpdateEnvironmentAccessModel - */ -public class CreateOrUpdateEnvironmentAccessModelTest { - private final CreateOrUpdateEnvironmentAccessModel model = new CreateOrUpdateEnvironmentAccessModel(); - - /** - * Model tests for CreateOrUpdateEnvironmentAccessModel - */ - @Test - public void testCreateOrUpdateEnvironmentAccessModel() { - // TODO: test CreateOrUpdateEnvironmentAccessModel - } - - /** - * Test the property 'environmentId' - */ - @Test - public void environmentIdTest() { - // TODO: test environmentId - } - - /** - * Test the property 'environmentAccessType' - */ - @Test - public void environmentAccessTypeTest() { - // TODO: test environmentAccessType - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/CreatePermissionGroupRequestTest.java b/src/test/java/com/configcat/publicapi/java/client/model/CreatePermissionGroupRequestTest.java deleted file mode 100644 index 2e51cd2..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/CreatePermissionGroupRequestTest.java +++ /dev/null @@ -1,236 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.model.CreateOrUpdateEnvironmentAccessModel; -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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for CreatePermissionGroupRequest - */ -public class CreatePermissionGroupRequestTest { - private final CreatePermissionGroupRequest model = new CreatePermissionGroupRequest(); - - /** - * Model tests for CreatePermissionGroupRequest - */ - @Test - public void testCreatePermissionGroupRequest() { - // TODO: test CreatePermissionGroupRequest - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'canManageMembers' - */ - @Test - public void canManageMembersTest() { - // TODO: test canManageMembers - } - - /** - * Test the property 'canCreateOrUpdateConfig' - */ - @Test - public void canCreateOrUpdateConfigTest() { - // TODO: test canCreateOrUpdateConfig - } - - /** - * Test the property 'canDeleteConfig' - */ - @Test - public void canDeleteConfigTest() { - // TODO: test canDeleteConfig - } - - /** - * Test the property 'canCreateOrUpdateEnvironment' - */ - @Test - public void canCreateOrUpdateEnvironmentTest() { - // TODO: test canCreateOrUpdateEnvironment - } - - /** - * Test the property 'canDeleteEnvironment' - */ - @Test - public void canDeleteEnvironmentTest() { - // TODO: test canDeleteEnvironment - } - - /** - * Test the property 'canCreateOrUpdateSetting' - */ - @Test - public void canCreateOrUpdateSettingTest() { - // TODO: test canCreateOrUpdateSetting - } - - /** - * Test the property 'canTagSetting' - */ - @Test - public void canTagSettingTest() { - // TODO: test canTagSetting - } - - /** - * Test the property 'canDeleteSetting' - */ - @Test - public void canDeleteSettingTest() { - // TODO: test canDeleteSetting - } - - /** - * Test the property 'canCreateOrUpdateTag' - */ - @Test - public void canCreateOrUpdateTagTest() { - // TODO: test canCreateOrUpdateTag - } - - /** - * Test the property 'canDeleteTag' - */ - @Test - public void canDeleteTagTest() { - // TODO: test canDeleteTag - } - - /** - * Test the property 'canManageWebhook' - */ - @Test - public void canManageWebhookTest() { - // TODO: test canManageWebhook - } - - /** - * Test the property 'canUseExportImport' - */ - @Test - public void canUseExportImportTest() { - // TODO: test canUseExportImport - } - - /** - * Test the property 'canManageProductPreferences' - */ - @Test - public void canManageProductPreferencesTest() { - // TODO: test canManageProductPreferences - } - - /** - * Test the property 'canManageIntegrations' - */ - @Test - public void canManageIntegrationsTest() { - // TODO: test canManageIntegrations - } - - /** - * Test the property 'canViewSdkKey' - */ - @Test - public void canViewSdkKeyTest() { - // TODO: test canViewSdkKey - } - - /** - * Test the property 'canRotateSdkKey' - */ - @Test - public void canRotateSdkKeyTest() { - // TODO: test canRotateSdkKey - } - - /** - * Test the property 'canCreateOrUpdateSegments' - */ - @Test - public void canCreateOrUpdateSegmentsTest() { - // TODO: test canCreateOrUpdateSegments - } - - /** - * Test the property 'canDeleteSegments' - */ - @Test - public void canDeleteSegmentsTest() { - // TODO: test canDeleteSegments - } - - /** - * Test the property 'canViewProductAuditLog' - */ - @Test - public void canViewProductAuditLogTest() { - // TODO: test canViewProductAuditLog - } - - /** - * Test the property 'canViewProductStatistics' - */ - @Test - public void canViewProductStatisticsTest() { - // TODO: test canViewProductStatistics - } - - /** - * Test the property 'accessType' - */ - @Test - public void accessTypeTest() { - // TODO: test accessType - } - - /** - * Test the property 'newEnvironmentAccessType' - */ - @Test - public void newEnvironmentAccessTypeTest() { - // TODO: test newEnvironmentAccessType - } - - /** - * Test the property 'environmentAccesses' - */ - @Test - public void environmentAccessesTest() { - // TODO: test environmentAccesses - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/CreateProductRequestTest.java b/src/test/java/com/configcat/publicapi/java/client/model/CreateProductRequestTest.java deleted file mode 100644 index a3bb2dc..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/CreateProductRequestTest.java +++ /dev/null @@ -1,65 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for CreateProductRequest - */ -public class CreateProductRequestTest { - private final CreateProductRequest model = new CreateProductRequest(); - - /** - * Model tests for CreateProductRequest - */ - @Test - public void testCreateProductRequest() { - // TODO: test CreateProductRequest - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'description' - */ - @Test - public void descriptionTest() { - // TODO: test description - } - - /** - * Test the property 'order' - */ - @Test - public void orderTest() { - // TODO: test order - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/CreateSegmentModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/CreateSegmentModelTest.java deleted file mode 100644 index c3174b2..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/CreateSegmentModelTest.java +++ /dev/null @@ -1,81 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for CreateSegmentModel - */ -public class CreateSegmentModelTest { - private final CreateSegmentModel model = new CreateSegmentModel(); - - /** - * Model tests for CreateSegmentModel - */ - @Test - public void testCreateSegmentModel() { - // TODO: test CreateSegmentModel - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'description' - */ - @Test - public void descriptionTest() { - // TODO: test description - } - - /** - * Test the property 'comparisonAttribute' - */ - @Test - public void comparisonAttributeTest() { - // TODO: test comparisonAttribute - } - - /** - * Test the property 'comparator' - */ - @Test - public void comparatorTest() { - // TODO: test comparator - } - - /** - * Test the property 'comparisonValue' - */ - @Test - public void comparisonValueTest() { - // TODO: test comparisonValue - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/CreateSettingInitialValuesTest.java b/src/test/java/com/configcat/publicapi/java/client/model/CreateSettingInitialValuesTest.java deleted file mode 100644 index 77d7ce1..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/CreateSettingInitialValuesTest.java +++ /dev/null @@ -1,100 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.model.InitialValue; -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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for CreateSettingInitialValues - */ -public class CreateSettingInitialValuesTest { - private final CreateSettingInitialValues model = new CreateSettingInitialValues(); - - /** - * Model tests for CreateSettingInitialValues - */ - @Test - public void testCreateSettingInitialValues() { - // TODO: test CreateSettingInitialValues - } - - /** - * Test the property 'hint' - */ - @Test - public void hintTest() { - // TODO: test hint - } - - /** - * Test the property 'tags' - */ - @Test - public void tagsTest() { - // TODO: test tags - } - - /** - * Test the property 'order' - */ - @Test - public void orderTest() { - // TODO: test order - } - - /** - * Test the property 'key' - */ - @Test - public void keyTest() { - // TODO: test key - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'settingType' - */ - @Test - public void settingTypeTest() { - // TODO: test settingType - } - - /** - * Test the property 'initialValues' - */ - @Test - public void initialValuesTest() { - // TODO: test initialValues - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/CreateTagModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/CreateTagModelTest.java deleted file mode 100644 index 1de1547..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/CreateTagModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for CreateTagModel - */ -public class CreateTagModelTest { - private final CreateTagModel model = new CreateTagModel(); - - /** - * Model tests for CreateTagModel - */ - @Test - public void testCreateTagModel() { - // TODO: test CreateTagModel - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/DeleteIntegrationLinkModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/DeleteIntegrationLinkModelTest.java deleted file mode 100644 index 8fc90b9..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/DeleteIntegrationLinkModelTest.java +++ /dev/null @@ -1,48 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for DeleteIntegrationLinkModel - */ -public class DeleteIntegrationLinkModelTest { - private final DeleteIntegrationLinkModel model = new DeleteIntegrationLinkModel(); - - /** - * Model tests for DeleteIntegrationLinkModel - */ - @Test - public void testDeleteIntegrationLinkModel() { - // TODO: test DeleteIntegrationLinkModel - } - - /** - * Test the property 'hasRemainingIntegrationLink' - */ - @Test - public void hasRemainingIntegrationLinkTest() { - // TODO: test hasRemainingIntegrationLink - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/DeleteRepositoryReportsRequestTest.java b/src/test/java/com/configcat/publicapi/java/client/model/DeleteRepositoryReportsRequestTest.java deleted file mode 100644 index 32faa59..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/DeleteRepositoryReportsRequestTest.java +++ /dev/null @@ -1,74 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for DeleteRepositoryReportsRequest - */ -public class DeleteRepositoryReportsRequestTest { - private final DeleteRepositoryReportsRequest model = new DeleteRepositoryReportsRequest(); - - /** - * Model tests for DeleteRepositoryReportsRequest - */ - @Test - public void testDeleteRepositoryReportsRequest() { - // TODO: test DeleteRepositoryReportsRequest - } - - /** - * Test the property 'configId' - */ - @Test - public void configIdTest() { - // TODO: test configId - } - - /** - * Test the property 'repository' - */ - @Test - public void repositoryTest() { - // TODO: test repository - } - - /** - * Test the property 'branch' - */ - @Test - public void branchTest() { - // TODO: test branch - } - - /** - * Test the property 'settingId' - */ - @Test - public void settingIdTest() { - // TODO: test settingId - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/EnvironmentAccessModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/EnvironmentAccessModelTest.java deleted file mode 100644 index 749ae99..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/EnvironmentAccessModelTest.java +++ /dev/null @@ -1,98 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for EnvironmentAccessModel - */ -public class EnvironmentAccessModelTest { - private final EnvironmentAccessModel model = new EnvironmentAccessModel(); - - /** - * Model tests for EnvironmentAccessModel - */ - @Test - public void testEnvironmentAccessModel() { - // TODO: test EnvironmentAccessModel - } - - /** - * Test the property 'environmentId' - */ - @Test - public void environmentIdTest() { - // TODO: test environmentId - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - - /** - * Test the property 'description' - */ - @Test - public void descriptionTest() { - // TODO: test description - } - - /** - * Test the property 'order' - */ - @Test - public void orderTest() { - // TODO: test order - } - - /** - * Test the property 'reasonRequired' - */ - @Test - public void reasonRequiredTest() { - // TODO: test reasonRequired - } - - /** - * Test the property 'environmentAccessType' - */ - @Test - public void environmentAccessTypeTest() { - // TODO: test environmentAccessType - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/EnvironmentModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/EnvironmentModelTest.java deleted file mode 100644 index 710b4f8..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/EnvironmentModelTest.java +++ /dev/null @@ -1,99 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for EnvironmentModel - */ -public class EnvironmentModelTest { - private final EnvironmentModel model = new EnvironmentModel(); - - /** - * Model tests for EnvironmentModel - */ - @Test - public void testEnvironmentModel() { - // TODO: test EnvironmentModel - } - - /** - * Test the property 'product' - */ - @Test - public void productTest() { - // TODO: test product - } - - /** - * Test the property 'environmentId' - */ - @Test - public void environmentIdTest() { - // TODO: test environmentId - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - - /** - * Test the property 'description' - */ - @Test - public void descriptionTest() { - // TODO: test description - } - - /** - * Test the property 'order' - */ - @Test - public void orderTest() { - // TODO: test order - } - - /** - * Test the property 'reasonRequired' - */ - @Test - public void reasonRequiredTest() { - // TODO: test reasonRequired - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/FeatureFlagLimitationsTest.java b/src/test/java/com/configcat/publicapi/java/client/model/FeatureFlagLimitationsTest.java deleted file mode 100644 index bee7cad..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/FeatureFlagLimitationsTest.java +++ /dev/null @@ -1,96 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for FeatureFlagLimitations - */ -public class FeatureFlagLimitationsTest { - private final FeatureFlagLimitations model = new FeatureFlagLimitations(); - - /** - * Model tests for FeatureFlagLimitations - */ - @Test - public void testFeatureFlagLimitations() { - // TODO: test FeatureFlagLimitations - } - - /** - * Test the property 'maxPercentageOptionCount' - */ - @Test - public void maxPercentageOptionCountTest() { - // TODO: test maxPercentageOptionCount - } - - /** - * Test the property 'maxTargetingRuleCount' - */ - @Test - public void maxTargetingRuleCountTest() { - // TODO: test maxTargetingRuleCount - } - - /** - * Test the property 'maxComparisonValueLength' - */ - @Test - public void maxComparisonValueLengthTest() { - // TODO: test maxComparisonValueLength - } - - /** - * Test the property 'maxComparisonValueListLength' - */ - @Test - public void maxComparisonValueListLengthTest() { - // TODO: test maxComparisonValueListLength - } - - /** - * Test the property 'maxComparisonValueListItemLength' - */ - @Test - public void maxComparisonValueListItemLengthTest() { - // TODO: test maxComparisonValueListItemLength - } - - /** - * Test the property 'maxStringFlagValueLength' - */ - @Test - public void maxStringFlagValueLengthTest() { - // TODO: test maxStringFlagValueLength - } - - /** - * Test the property 'maxConditionPerTargetingRuleCount' - */ - @Test - public void maxConditionPerTargetingRuleCountTest() { - // TODO: test maxConditionPerTargetingRuleCount - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/FlagReferenceTest.java b/src/test/java/com/configcat/publicapi/java/client/model/FlagReferenceTest.java deleted file mode 100644 index eb8a39c..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/FlagReferenceTest.java +++ /dev/null @@ -1,59 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for FlagReference - */ -public class FlagReferenceTest { - private final FlagReference model = new FlagReference(); - - /** - * Model tests for FlagReference - */ - @Test - public void testFlagReference() { - // TODO: test FlagReference - } - - /** - * Test the property 'settingId' - */ - @Test - public void settingIdTest() { - // TODO: test settingId - } - - /** - * Test the property 'references' - */ - @Test - public void referencesTest() { - // TODO: test references - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/InitialValueTest.java b/src/test/java/com/configcat/publicapi/java/client/model/InitialValueTest.java deleted file mode 100644 index ae1ff8a..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/InitialValueTest.java +++ /dev/null @@ -1,58 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for InitialValue - */ -public class InitialValueTest { - private final InitialValue model = new InitialValue(); - - /** - * Model tests for InitialValue - */ - @Test - public void testInitialValue() { - // TODO: test InitialValue - } - - /** - * Test the property 'environmentId' - */ - @Test - public void environmentIdTest() { - // TODO: test environmentId - } - - /** - * Test the property 'value' - */ - @Test - public void valueTest() { - // TODO: test value - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetailTest.java b/src/test/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetailTest.java deleted file mode 100644 index 1eb1c59..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetailTest.java +++ /dev/null @@ -1,93 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for IntegrationLinkDetail - */ -public class IntegrationLinkDetailTest { - private final IntegrationLinkDetail model = new IntegrationLinkDetail(); - - /** - * Model tests for IntegrationLinkDetail - */ - @Test - public void testIntegrationLinkDetail() { - // TODO: test IntegrationLinkDetail - } - - /** - * Test the property 'product' - */ - @Test - public void productTest() { - // TODO: test product - } - - /** - * Test the property 'config' - */ - @Test - public void configTest() { - // TODO: test config - } - - /** - * Test the property 'environment' - */ - @Test - public void environmentTest() { - // TODO: test environment - } - - /** - * Test the property 'setting' - */ - @Test - public void settingTest() { - // TODO: test setting - } - - /** - * Test the property 'readOnly' - */ - @Test - public void readOnlyTest() { - // TODO: test readOnly - } - - /** - * Test the property 'status' - */ - @Test - public void statusTest() { - // TODO: test status - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetailsModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetailsModelTest.java deleted file mode 100644 index 0177362..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/IntegrationLinkDetailsModelTest.java +++ /dev/null @@ -1,60 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for IntegrationLinkDetailsModel - */ -public class IntegrationLinkDetailsModelTest { - private final IntegrationLinkDetailsModel model = new IntegrationLinkDetailsModel(); - - /** - * Model tests for IntegrationLinkDetailsModel - */ - @Test - public void testIntegrationLinkDetailsModel() { - // TODO: test IntegrationLinkDetailsModel - } - - /** - * Test the property 'details' - */ - @Test - public void detailsTest() { - // TODO: test details - } - - /** - * Test the property 'allIntegrationLinkCount' - */ - @Test - public void allIntegrationLinkCountTest() { - // TODO: test allIntegrationLinkCount - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/IntegrationLinkModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/IntegrationLinkModelTest.java deleted file mode 100644 index 0605ec6..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/IntegrationLinkModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for IntegrationLinkModel - */ -public class IntegrationLinkModelTest { - private final IntegrationLinkModel model = new IntegrationLinkModel(); - - /** - * Model tests for IntegrationLinkModel - */ - @Test - public void testIntegrationLinkModel() { - // TODO: test IntegrationLinkModel - } - - /** - * Test the property 'key' - */ - @Test - public void keyTest() { - // TODO: test key - } - - /** - * Test the property 'description' - */ - @Test - public void descriptionTest() { - // TODO: test description - } - - /** - * Test the property 'integrationLinkType' - */ - @Test - public void integrationLinkTypeTest() { - // TODO: test integrationLinkType - } - - /** - * Test the property 'url' - */ - @Test - public void urlTest() { - // TODO: test url - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/IntegrationModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/IntegrationModelTest.java deleted file mode 100644 index a96273c..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/IntegrationModelTest.java +++ /dev/null @@ -1,103 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for IntegrationModel - */ -public class IntegrationModelTest { - private final IntegrationModel model = new IntegrationModel(); - - /** - * Model tests for IntegrationModel - */ - @Test - public void testIntegrationModel() { - // TODO: test IntegrationModel - } - - /** - * Test the property 'product' - */ - @Test - public void productTest() { - // TODO: test product - } - - /** - * Test the property 'integrationId' - */ - @Test - public void integrationIdTest() { - // TODO: test integrationId - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'integrationType' - */ - @Test - public void integrationTypeTest() { - // TODO: test integrationType - } - - /** - * Test the property 'parameters' - */ - @Test - public void parametersTest() { - // TODO: test parameters - } - - /** - * Test the property 'environmentIds' - */ - @Test - public void environmentIdsTest() { - // TODO: test environmentIds - } - - /** - * Test the property 'configIds' - */ - @Test - public void configIdsTest() { - // TODO: test configIds - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/IntegrationsModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/IntegrationsModelTest.java deleted file mode 100644 index 1346786..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/IntegrationsModelTest.java +++ /dev/null @@ -1,52 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for IntegrationsModel - */ -public class IntegrationsModelTest { - private final IntegrationsModel model = new IntegrationsModel(); - - /** - * Model tests for IntegrationsModel - */ - @Test - public void testIntegrationsModel() { - // TODO: test IntegrationsModel - } - - /** - * Test the property 'integrations' - */ - @Test - public void integrationsTest() { - // TODO: test integrations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/InvitationModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/InvitationModelTest.java deleted file mode 100644 index 5d0b105..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/InvitationModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for InvitationModel - */ -public class InvitationModelTest { - private final InvitationModel model = new InvitationModel(); - - /** - * Model tests for InvitationModel - */ - @Test - public void testInvitationModel() { - // TODO: test InvitationModel - } - - /** - * Test the property 'invitationId' - */ - @Test - public void invitationIdTest() { - // TODO: test invitationId - } - - /** - * Test the property 'email' - */ - @Test - public void emailTest() { - // TODO: test email - } - - /** - * Test the property 'permissionGroupId' - */ - @Test - public void permissionGroupIdTest() { - // TODO: test permissionGroupId - } - - /** - * Test the property 'createdAt' - */ - @Test - public void createdAtTest() { - // TODO: test createdAt - } - - /** - * Test the property 'expired' - */ - @Test - public void expiredTest() { - // TODO: test expired - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/InviteMembersRequestTest.java b/src/test/java/com/configcat/publicapi/java/client/model/InviteMembersRequestTest.java deleted file mode 100644 index 9dcf047..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/InviteMembersRequestTest.java +++ /dev/null @@ -1,58 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for InviteMembersRequest - */ -public class InviteMembersRequestTest { - private final InviteMembersRequest model = new InviteMembersRequest(); - - /** - * Model tests for InviteMembersRequest - */ - @Test - public void testInviteMembersRequest() { - // TODO: test InviteMembersRequest - } - - /** - * Test the property 'emails' - */ - @Test - public void emailsTest() { - // TODO: test emails - } - - /** - * Test the property 'permissionGroupId' - */ - @Test - public void permissionGroupIdTest() { - // TODO: test permissionGroupId - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/JsonPatchOperationTest.java b/src/test/java/com/configcat/publicapi/java/client/model/JsonPatchOperationTest.java deleted file mode 100644 index 84ad315..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/JsonPatchOperationTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for JsonPatchOperation - */ -public class JsonPatchOperationTest { - private final JsonPatchOperation model = new JsonPatchOperation(); - - /** - * Model tests for JsonPatchOperation - */ - @Test - public void testJsonPatchOperation() { - // TODO: test JsonPatchOperation - } - - /** - * Test the property 'op' - */ - @Test - public void opTest() { - // TODO: test op - } - - /** - * Test the property 'path' - */ - @Test - public void pathTest() { - // TODO: test path - } - - /** - * Test the property 'from' - */ - @Test - public void fromTest() { - // TODO: test from - } - - /** - * Test the property 'value' - */ - @Test - public void valueTest() { - // TODO: test value - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/MeModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/MeModelTest.java deleted file mode 100644 index ddf91c6..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/MeModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for MeModel - */ -public class MeModelTest { - private final MeModel model = new MeModel(); - - /** - * Model tests for MeModel - */ - @Test - public void testMeModel() { - // TODO: test MeModel - } - - /** - * Test the property 'email' - */ - @Test - public void emailTest() { - // TODO: test email - } - - /** - * Test the property 'fullName' - */ - @Test - public void fullNameTest() { - // TODO: test fullName - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/MemberModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/MemberModelTest.java deleted file mode 100644 index 0fa0f67..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/MemberModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for MemberModel - */ -public class MemberModelTest { - private final MemberModel model = new MemberModel(); - - /** - * Model tests for MemberModel - */ - @Test - public void testMemberModel() { - // TODO: test MemberModel - } - - /** - * Test the property 'userId' - */ - @Test - public void userIdTest() { - // TODO: test userId - } - - /** - * Test the property 'productId' - */ - @Test - public void productIdTest() { - // TODO: test productId - } - - /** - * Test the property 'permissionGroupId' - */ - @Test - public void permissionGroupIdTest() { - // TODO: test permissionGroupId - } - - /** - * Test the property 'fullName' - */ - @Test - public void fullNameTest() { - // TODO: test fullName - } - - /** - * Test the property 'email' - */ - @Test - public void emailTest() { - // TODO: test email - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/ModifyIntegrationRequestTest.java b/src/test/java/com/configcat/publicapi/java/client/model/ModifyIntegrationRequestTest.java deleted file mode 100644 index 2320c42..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/ModifyIntegrationRequestTest.java +++ /dev/null @@ -1,77 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for ModifyIntegrationRequest - */ -public class ModifyIntegrationRequestTest { - private final ModifyIntegrationRequest model = new ModifyIntegrationRequest(); - - /** - * Model tests for ModifyIntegrationRequest - */ - @Test - public void testModifyIntegrationRequest() { - // TODO: test ModifyIntegrationRequest - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'parameters' - */ - @Test - public void parametersTest() { - // TODO: test parameters - } - - /** - * Test the property 'environmentIds' - */ - @Test - public void environmentIdsTest() { - // TODO: test environmentIds - } - - /** - * Test the property 'configIds' - */ - @Test - public void configIdsTest() { - // TODO: test configIds - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/OrganizationAdminModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/OrganizationAdminModelTest.java deleted file mode 100644 index 6d46b21..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/OrganizationAdminModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for OrganizationAdminModel - */ -public class OrganizationAdminModelTest { - private final OrganizationAdminModel model = new OrganizationAdminModel(); - - /** - * Model tests for OrganizationAdminModel - */ - @Test - public void testOrganizationAdminModel() { - // TODO: test OrganizationAdminModel - } - - /** - * Test the property 'userId' - */ - @Test - public void userIdTest() { - // TODO: test userId - } - - /** - * Test the property 'fullName' - */ - @Test - public void fullNameTest() { - // TODO: test fullName - } - - /** - * Test the property 'email' - */ - @Test - public void emailTest() { - // TODO: test email - } - - /** - * Test the property 'twoFactorEnabled' - */ - @Test - public void twoFactorEnabledTest() { - // TODO: test twoFactorEnabled - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/OrganizationInvitationModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/OrganizationInvitationModelTest.java deleted file mode 100644 index 781f341..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/OrganizationInvitationModelTest.java +++ /dev/null @@ -1,107 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for OrganizationInvitationModel - */ -public class OrganizationInvitationModelTest { - private final OrganizationInvitationModel model = new OrganizationInvitationModel(); - - /** - * Model tests for OrganizationInvitationModel - */ - @Test - public void testOrganizationInvitationModel() { - // TODO: test OrganizationInvitationModel - } - - /** - * Test the property 'invitationId' - */ - @Test - public void invitationIdTest() { - // TODO: test invitationId - } - - /** - * Test the property 'email' - */ - @Test - public void emailTest() { - // TODO: test email - } - - /** - * Test the property 'productId' - */ - @Test - public void productIdTest() { - // TODO: test productId - } - - /** - * Test the property 'productName' - */ - @Test - public void productNameTest() { - // TODO: test productName - } - - /** - * Test the property 'permissionGroupId' - */ - @Test - public void permissionGroupIdTest() { - // TODO: test permissionGroupId - } - - /** - * Test the property 'createdAt' - */ - @Test - public void createdAtTest() { - // TODO: test createdAt - } - - /** - * Test the property 'expired' - */ - @Test - public void expiredTest() { - // TODO: test expired - } - - /** - * Test the property 'expires' - */ - @Test - public void expiresTest() { - // TODO: test expires - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/OrganizationMemberModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/OrganizationMemberModelTest.java deleted file mode 100644 index 3e02b8d..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/OrganizationMemberModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for OrganizationMemberModel - */ -public class OrganizationMemberModelTest { - private final OrganizationMemberModel model = new OrganizationMemberModel(); - - /** - * Model tests for OrganizationMemberModel - */ - @Test - public void testOrganizationMemberModel() { - // TODO: test OrganizationMemberModel - } - - /** - * Test the property 'userId' - */ - @Test - public void userIdTest() { - // TODO: test userId - } - - /** - * Test the property 'fullName' - */ - @Test - public void fullNameTest() { - // TODO: test fullName - } - - /** - * Test the property 'email' - */ - @Test - public void emailTest() { - // TODO: test email - } - - /** - * Test the property 'twoFactorEnabled' - */ - @Test - public void twoFactorEnabledTest() { - // TODO: test twoFactorEnabled - } - - /** - * Test the property 'permissions' - */ - @Test - public void permissionsTest() { - // TODO: test permissions - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/OrganizationMembersModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/OrganizationMembersModelTest.java deleted file mode 100644 index b371e79..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/OrganizationMembersModelTest.java +++ /dev/null @@ -1,69 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for OrganizationMembersModel - */ -public class OrganizationMembersModelTest { - private final OrganizationMembersModel model = new OrganizationMembersModel(); - - /** - * Model tests for OrganizationMembersModel - */ - @Test - public void testOrganizationMembersModel() { - // TODO: test OrganizationMembersModel - } - - /** - * Test the property 'admins' - */ - @Test - public void adminsTest() { - // TODO: test admins - } - - /** - * Test the property 'billingManagers' - */ - @Test - public void billingManagersTest() { - // TODO: test billingManagers - } - - /** - * Test the property 'members' - */ - @Test - public void membersTest() { - // TODO: test members - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/OrganizationModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/OrganizationModelTest.java deleted file mode 100644 index 6712c8f..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/OrganizationModelTest.java +++ /dev/null @@ -1,58 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for OrganizationModel - */ -public class OrganizationModelTest { - private final OrganizationModel model = new OrganizationModel(); - - /** - * Model tests for OrganizationModel - */ - @Test - public void testOrganizationModel() { - // TODO: test OrganizationModel - } - - /** - * Test the property 'organizationId' - */ - @Test - public void organizationIdTest() { - // TODO: test organizationId - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/OrganizationPermissionGroupModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/OrganizationPermissionGroupModelTest.java deleted file mode 100644 index fdc9338..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/OrganizationPermissionGroupModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for OrganizationPermissionGroupModel - */ -public class OrganizationPermissionGroupModelTest { - private final OrganizationPermissionGroupModel model = new OrganizationPermissionGroupModel(); - - /** - * Model tests for OrganizationPermissionGroupModel - */ - @Test - public void testOrganizationPermissionGroupModel() { - // TODO: test OrganizationPermissionGroupModel - } - - /** - * Test the property 'permissionGroupId' - */ - @Test - public void permissionGroupIdTest() { - // TODO: test permissionGroupId - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/OrganizationPermissionModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/OrganizationPermissionModelTest.java deleted file mode 100644 index 7066bdf..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/OrganizationPermissionModelTest.java +++ /dev/null @@ -1,58 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for OrganizationPermissionModel - */ -public class OrganizationPermissionModelTest { - private final OrganizationPermissionModel model = new OrganizationPermissionModel(); - - /** - * Model tests for OrganizationPermissionModel - */ - @Test - public void testOrganizationPermissionModel() { - // TODO: test OrganizationPermissionModel - } - - /** - * Test the property 'product' - */ - @Test - public void productTest() { - // TODO: test product - } - - /** - * Test the property 'permissionGroup' - */ - @Test - public void permissionGroupTest() { - // TODO: test permissionGroup - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/OrganizationProductModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/OrganizationProductModelTest.java deleted file mode 100644 index 7d518ce..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/OrganizationProductModelTest.java +++ /dev/null @@ -1,58 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for OrganizationProductModel - */ -public class OrganizationProductModelTest { - private final OrganizationProductModel model = new OrganizationProductModel(); - - /** - * Model tests for OrganizationProductModel - */ - @Test - public void testOrganizationProductModel() { - // TODO: test OrganizationProductModel - } - - /** - * Test the property 'productId' - */ - @Test - public void productIdTest() { - // TODO: test productId - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/PercentageOptionModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/PercentageOptionModelTest.java deleted file mode 100644 index 5e4d1f4..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/PercentageOptionModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for PercentageOptionModel - */ -public class PercentageOptionModelTest { - private final PercentageOptionModel model = new PercentageOptionModel(); - - /** - * Model tests for PercentageOptionModel - */ - @Test - public void testPercentageOptionModel() { - // TODO: test PercentageOptionModel - } - - /** - * Test the property 'percentage' - */ - @Test - public void percentageTest() { - // TODO: test percentage - } - - /** - * Test the property 'value' - */ - @Test - public void valueTest() { - // TODO: test value - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/PermissionGroupModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/PermissionGroupModelTest.java deleted file mode 100644 index ae2ae03..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/PermissionGroupModelTest.java +++ /dev/null @@ -1,253 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.model.EnvironmentAccessModel; -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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for PermissionGroupModel - */ -public class PermissionGroupModelTest { - private final PermissionGroupModel model = new PermissionGroupModel(); - - /** - * Model tests for PermissionGroupModel - */ - @Test - public void testPermissionGroupModel() { - // TODO: test PermissionGroupModel - } - - /** - * Test the property 'permissionGroupId' - */ - @Test - public void permissionGroupIdTest() { - // TODO: test permissionGroupId - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'canManageMembers' - */ - @Test - public void canManageMembersTest() { - // TODO: test canManageMembers - } - - /** - * Test the property 'canCreateOrUpdateConfig' - */ - @Test - public void canCreateOrUpdateConfigTest() { - // TODO: test canCreateOrUpdateConfig - } - - /** - * Test the property 'canDeleteConfig' - */ - @Test - public void canDeleteConfigTest() { - // TODO: test canDeleteConfig - } - - /** - * Test the property 'canCreateOrUpdateEnvironment' - */ - @Test - public void canCreateOrUpdateEnvironmentTest() { - // TODO: test canCreateOrUpdateEnvironment - } - - /** - * Test the property 'canDeleteEnvironment' - */ - @Test - public void canDeleteEnvironmentTest() { - // TODO: test canDeleteEnvironment - } - - /** - * Test the property 'canCreateOrUpdateSetting' - */ - @Test - public void canCreateOrUpdateSettingTest() { - // TODO: test canCreateOrUpdateSetting - } - - /** - * Test the property 'canTagSetting' - */ - @Test - public void canTagSettingTest() { - // TODO: test canTagSetting - } - - /** - * Test the property 'canDeleteSetting' - */ - @Test - public void canDeleteSettingTest() { - // TODO: test canDeleteSetting - } - - /** - * Test the property 'canCreateOrUpdateTag' - */ - @Test - public void canCreateOrUpdateTagTest() { - // TODO: test canCreateOrUpdateTag - } - - /** - * Test the property 'canDeleteTag' - */ - @Test - public void canDeleteTagTest() { - // TODO: test canDeleteTag - } - - /** - * Test the property 'canManageWebhook' - */ - @Test - public void canManageWebhookTest() { - // TODO: test canManageWebhook - } - - /** - * Test the property 'canUseExportImport' - */ - @Test - public void canUseExportImportTest() { - // TODO: test canUseExportImport - } - - /** - * Test the property 'canManageProductPreferences' - */ - @Test - public void canManageProductPreferencesTest() { - // TODO: test canManageProductPreferences - } - - /** - * Test the property 'canManageIntegrations' - */ - @Test - public void canManageIntegrationsTest() { - // TODO: test canManageIntegrations - } - - /** - * Test the property 'canViewSdkKey' - */ - @Test - public void canViewSdkKeyTest() { - // TODO: test canViewSdkKey - } - - /** - * Test the property 'canRotateSdkKey' - */ - @Test - public void canRotateSdkKeyTest() { - // TODO: test canRotateSdkKey - } - - /** - * Test the property 'canCreateOrUpdateSegments' - */ - @Test - public void canCreateOrUpdateSegmentsTest() { - // TODO: test canCreateOrUpdateSegments - } - - /** - * Test the property 'canDeleteSegments' - */ - @Test - public void canDeleteSegmentsTest() { - // TODO: test canDeleteSegments - } - - /** - * Test the property 'canViewProductAuditLog' - */ - @Test - public void canViewProductAuditLogTest() { - // TODO: test canViewProductAuditLog - } - - /** - * Test the property 'canViewProductStatistics' - */ - @Test - public void canViewProductStatisticsTest() { - // TODO: test canViewProductStatistics - } - - /** - * Test the property 'accessType' - */ - @Test - public void accessTypeTest() { - // TODO: test accessType - } - - /** - * Test the property 'newEnvironmentAccessType' - */ - @Test - public void newEnvironmentAccessTypeTest() { - // TODO: test newEnvironmentAccessType - } - - /** - * Test the property 'environmentAccesses' - */ - @Test - public void environmentAccessesTest() { - // TODO: test environmentAccesses - } - - /** - * Test the property 'product' - */ - @Test - public void productTest() { - // TODO: test product - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/PreferencesModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/PreferencesModelTest.java deleted file mode 100644 index 97851ba..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/PreferencesModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for PreferencesModel - */ -public class PreferencesModelTest { - private final PreferencesModel model = new PreferencesModel(); - - /** - * Model tests for PreferencesModel - */ - @Test - public void testPreferencesModel() { - // TODO: test PreferencesModel - } - - /** - * Test the property 'reasonRequired' - */ - @Test - public void reasonRequiredTest() { - // TODO: test reasonRequired - } - - /** - * Test the property 'keyGenerationMode' - */ - @Test - public void keyGenerationModeTest() { - // TODO: test keyGenerationMode - } - - /** - * Test the property 'showVariationId' - */ - @Test - public void showVariationIdTest() { - // TODO: test showVariationId - } - - /** - * Test the property 'reasonRequiredEnvironments' - */ - @Test - public void reasonRequiredEnvironmentsTest() { - // TODO: test reasonRequiredEnvironments - } - - /** - * Test the property 'mandatorySettingHint' - */ - @Test - public void mandatorySettingHintTest() { - // TODO: test mandatorySettingHint - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/PrerequisiteFlagConditionModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/PrerequisiteFlagConditionModelTest.java deleted file mode 100644 index e3a86ec..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/PrerequisiteFlagConditionModelTest.java +++ /dev/null @@ -1,65 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for PrerequisiteFlagConditionModel - */ -public class PrerequisiteFlagConditionModelTest { - private final PrerequisiteFlagConditionModel model = new PrerequisiteFlagConditionModel(); - - /** - * Model tests for PrerequisiteFlagConditionModel - */ - @Test - public void testPrerequisiteFlagConditionModel() { - // TODO: test PrerequisiteFlagConditionModel - } - - /** - * Test the property 'prerequisiteSettingId' - */ - @Test - public void prerequisiteSettingIdTest() { - // TODO: test prerequisiteSettingId - } - - /** - * Test the property 'comparator' - */ - @Test - public void comparatorTest() { - // TODO: test comparator - } - - /** - * Test the property 'prerequisiteComparisonValue' - */ - @Test - public void prerequisiteComparisonValueTest() { - // TODO: test prerequisiteComparisonValue - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/ProductModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/ProductModelTest.java deleted file mode 100644 index 4556f9d..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/ProductModelTest.java +++ /dev/null @@ -1,91 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for ProductModel - */ -public class ProductModelTest { - private final ProductModel model = new ProductModel(); - - /** - * Model tests for ProductModel - */ - @Test - public void testProductModel() { - // TODO: test ProductModel - } - - /** - * Test the property 'organization' - */ - @Test - public void organizationTest() { - // TODO: test organization - } - - /** - * Test the property 'productId' - */ - @Test - public void productIdTest() { - // TODO: test productId - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'description' - */ - @Test - public void descriptionTest() { - // TODO: test description - } - - /** - * Test the property 'order' - */ - @Test - public void orderTest() { - // TODO: test order - } - - /** - * Test the property 'reasonRequired' - */ - @Test - public void reasonRequiredTest() { - // TODO: test reasonRequired - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/ReasonRequiredEnvironmentModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/ReasonRequiredEnvironmentModelTest.java deleted file mode 100644 index 36a9307..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/ReasonRequiredEnvironmentModelTest.java +++ /dev/null @@ -1,66 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for ReasonRequiredEnvironmentModel - */ -public class ReasonRequiredEnvironmentModelTest { - private final ReasonRequiredEnvironmentModel model = new ReasonRequiredEnvironmentModel(); - - /** - * Model tests for ReasonRequiredEnvironmentModel - */ - @Test - public void testReasonRequiredEnvironmentModel() { - // TODO: test ReasonRequiredEnvironmentModel - } - - /** - * Test the property 'environmentId' - */ - @Test - public void environmentIdTest() { - // TODO: test environmentId - } - - /** - * Test the property 'reasonRequired' - */ - @Test - public void reasonRequiredTest() { - // TODO: test reasonRequired - } - - /** - * Test the property 'environmentName' - */ - @Test - public void environmentNameTest() { - // TODO: test environmentName - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/ReferenceLineTest.java b/src/test/java/com/configcat/publicapi/java/client/model/ReferenceLineTest.java deleted file mode 100644 index be96360..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/ReferenceLineTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for ReferenceLine - */ -public class ReferenceLineTest { - private final ReferenceLine model = new ReferenceLine(); - - /** - * Model tests for ReferenceLine - */ - @Test - public void testReferenceLine() { - // TODO: test ReferenceLine - } - - /** - * Test the property 'lineText' - */ - @Test - public void lineTextTest() { - // TODO: test lineText - } - - /** - * Test the property 'lineNumber' - */ - @Test - public void lineNumberTest() { - // TODO: test lineNumber - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/ReferenceLinesTest.java b/src/test/java/com/configcat/publicapi/java/client/model/ReferenceLinesTest.java deleted file mode 100644 index 19d874d..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/ReferenceLinesTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for ReferenceLines - */ -public class ReferenceLinesTest { - private final ReferenceLines model = new ReferenceLines(); - - /** - * Model tests for ReferenceLines - */ - @Test - public void testReferenceLines() { - // TODO: test ReferenceLines - } - - /** - * Test the property '_file' - */ - @Test - public void _fileTest() { - // TODO: test _file - } - - /** - * Test the property 'fileUrl' - */ - @Test - public void fileUrlTest() { - // TODO: test fileUrl - } - - /** - * Test the property 'preLines' - */ - @Test - public void preLinesTest() { - // TODO: test preLines - } - - /** - * Test the property 'postLines' - */ - @Test - public void postLinesTest() { - // TODO: test postLines - } - - /** - * Test the property 'referenceLine' - */ - @Test - public void referenceLineTest() { - // TODO: test referenceLine - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/ReplaceSettingModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/ReplaceSettingModelTest.java deleted file mode 100644 index f6d6842..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/ReplaceSettingModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for ReplaceSettingModel - */ -public class ReplaceSettingModelTest { - private final ReplaceSettingModel model = new ReplaceSettingModel(); - - /** - * Model tests for ReplaceSettingModel - */ - @Test - public void testReplaceSettingModel() { - // TODO: test ReplaceSettingModel - } - - /** - * Test the property 'hint' - */ - @Test - public void hintTest() { - // TODO: test hint - } - - /** - * Test the property 'tags' - */ - @Test - public void tagsTest() { - // TODO: test tags - } - - /** - * Test the property 'order' - */ - @Test - public void orderTest() { - // TODO: test order - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/RolloutPercentageItemModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/RolloutPercentageItemModelTest.java deleted file mode 100644 index b4ce6e8..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/RolloutPercentageItemModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for RolloutPercentageItemModel - */ -public class RolloutPercentageItemModelTest { - private final RolloutPercentageItemModel model = new RolloutPercentageItemModel(); - - /** - * Model tests for RolloutPercentageItemModel - */ - @Test - public void testRolloutPercentageItemModel() { - // TODO: test RolloutPercentageItemModel - } - - /** - * Test the property 'percentage' - */ - @Test - public void percentageTest() { - // TODO: test percentage - } - - /** - * Test the property 'value' - */ - @Test - public void valueTest() { - // TODO: test value - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/RolloutRuleModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/RolloutRuleModelTest.java deleted file mode 100644 index 08ab44b..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/RolloutRuleModelTest.java +++ /dev/null @@ -1,90 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for RolloutRuleModel - */ -public class RolloutRuleModelTest { - private final RolloutRuleModel model = new RolloutRuleModel(); - - /** - * Model tests for RolloutRuleModel - */ - @Test - public void testRolloutRuleModel() { - // TODO: test RolloutRuleModel - } - - /** - * Test the property 'comparisonAttribute' - */ - @Test - public void comparisonAttributeTest() { - // TODO: test comparisonAttribute - } - - /** - * Test the property 'comparator' - */ - @Test - public void comparatorTest() { - // TODO: test comparator - } - - /** - * Test the property 'comparisonValue' - */ - @Test - public void comparisonValueTest() { - // TODO: test comparisonValue - } - - /** - * Test the property 'value' - */ - @Test - public void valueTest() { - // TODO: test value - } - - /** - * Test the property 'segmentComparator' - */ - @Test - public void segmentComparatorTest() { - // TODO: test segmentComparator - } - - /** - * Test the property 'segmentId' - */ - @Test - public void segmentIdTest() { - // TODO: test segmentId - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/SdkKeysModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/SdkKeysModelTest.java deleted file mode 100644 index 07bf3d4..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/SdkKeysModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for SdkKeysModel - */ -public class SdkKeysModelTest { - private final SdkKeysModel model = new SdkKeysModel(); - - /** - * Model tests for SdkKeysModel - */ - @Test - public void testSdkKeysModel() { - // TODO: test SdkKeysModel - } - - /** - * Test the property 'primary' - */ - @Test - public void primaryTest() { - // TODO: test primary - } - - /** - * Test the property 'secondary' - */ - @Test - public void secondaryTest() { - // TODO: test secondary - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/SegmentConditionModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/SegmentConditionModelTest.java deleted file mode 100644 index dba7540..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/SegmentConditionModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for SegmentConditionModel - */ -public class SegmentConditionModelTest { - private final SegmentConditionModel model = new SegmentConditionModel(); - - /** - * Model tests for SegmentConditionModel - */ - @Test - public void testSegmentConditionModel() { - // TODO: test SegmentConditionModel - } - - /** - * Test the property 'segmentId' - */ - @Test - public void segmentIdTest() { - // TODO: test segmentId - } - - /** - * Test the property 'comparator' - */ - @Test - public void comparatorTest() { - // TODO: test comparator - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/SegmentListModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/SegmentListModelTest.java deleted file mode 100644 index f6ed3df..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/SegmentListModelTest.java +++ /dev/null @@ -1,132 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for SegmentListModel - */ -public class SegmentListModelTest { - private final SegmentListModel model = new SegmentListModel(); - - /** - * Model tests for SegmentListModel - */ - @Test - public void testSegmentListModel() { - // TODO: test SegmentListModel - } - - /** - * Test the property 'product' - */ - @Test - public void productTest() { - // TODO: test product - } - - /** - * Test the property 'segmentId' - */ - @Test - public void segmentIdTest() { - // TODO: test segmentId - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'description' - */ - @Test - public void descriptionTest() { - // TODO: test description - } - - /** - * Test the property 'creatorEmail' - */ - @Test - public void creatorEmailTest() { - // TODO: test creatorEmail - } - - /** - * Test the property 'creatorFullName' - */ - @Test - public void creatorFullNameTest() { - // TODO: test creatorFullName - } - - /** - * Test the property 'createdAt' - */ - @Test - public void createdAtTest() { - // TODO: test createdAt - } - - /** - * Test the property 'lastUpdaterEmail' - */ - @Test - public void lastUpdaterEmailTest() { - // TODO: test lastUpdaterEmail - } - - /** - * Test the property 'lastUpdaterFullName' - */ - @Test - public void lastUpdaterFullNameTest() { - // TODO: test lastUpdaterFullName - } - - /** - * Test the property 'updatedAt' - */ - @Test - public void updatedAtTest() { - // TODO: test updatedAt - } - - /** - * Test the property 'usage' - */ - @Test - public void usageTest() { - // TODO: test usage - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/SegmentModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/SegmentModelTest.java deleted file mode 100644 index d3d4e47..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/SegmentModelTest.java +++ /dev/null @@ -1,148 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for SegmentModel - */ -public class SegmentModelTest { - private final SegmentModel model = new SegmentModel(); - - /** - * Model tests for SegmentModel - */ - @Test - public void testSegmentModel() { - // TODO: test SegmentModel - } - - /** - * Test the property 'product' - */ - @Test - public void productTest() { - // TODO: test product - } - - /** - * Test the property 'segmentId' - */ - @Test - public void segmentIdTest() { - // TODO: test segmentId - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'description' - */ - @Test - public void descriptionTest() { - // TODO: test description - } - - /** - * Test the property 'creatorEmail' - */ - @Test - public void creatorEmailTest() { - // TODO: test creatorEmail - } - - /** - * Test the property 'creatorFullName' - */ - @Test - public void creatorFullNameTest() { - // TODO: test creatorFullName - } - - /** - * Test the property 'createdAt' - */ - @Test - public void createdAtTest() { - // TODO: test createdAt - } - - /** - * Test the property 'lastUpdaterEmail' - */ - @Test - public void lastUpdaterEmailTest() { - // TODO: test lastUpdaterEmail - } - - /** - * Test the property 'lastUpdaterFullName' - */ - @Test - public void lastUpdaterFullNameTest() { - // TODO: test lastUpdaterFullName - } - - /** - * Test the property 'updatedAt' - */ - @Test - public void updatedAtTest() { - // TODO: test updatedAt - } - - /** - * Test the property 'comparisonAttribute' - */ - @Test - public void comparisonAttributeTest() { - // TODO: test comparisonAttribute - } - - /** - * Test the property 'comparator' - */ - @Test - public void comparatorTest() { - // TODO: test comparator - } - - /** - * Test the property 'comparisonValue' - */ - @Test - public void comparisonValueTest() { - // TODO: test comparisonValue - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/SettingDataModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/SettingDataModelTest.java deleted file mode 100644 index 65384ab..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/SettingDataModelTest.java +++ /dev/null @@ -1,122 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for SettingDataModel - */ -public class SettingDataModelTest { - private final SettingDataModel model = new SettingDataModel(); - - /** - * Model tests for SettingDataModel - */ - @Test - public void testSettingDataModel() { - // TODO: test SettingDataModel - } - - /** - * Test the property 'settingId' - */ - @Test - public void settingIdTest() { - // TODO: test settingId - } - - /** - * Test the property 'key' - */ - @Test - public void keyTest() { - // TODO: test key - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'hint' - */ - @Test - public void hintTest() { - // TODO: test hint - } - - /** - * Test the property 'settingType' - */ - @Test - public void settingTypeTest() { - // TODO: test settingType - } - - /** - * Test the property 'order' - */ - @Test - public void orderTest() { - // TODO: test order - } - - /** - * Test the property 'createdAt' - */ - @Test - public void createdAtTest() { - // TODO: test createdAt - } - - /** - * Test the property 'creatorEmail' - */ - @Test - public void creatorEmailTest() { - // TODO: test creatorEmail - } - - /** - * Test the property 'creatorFullName' - */ - @Test - public void creatorFullNameTest() { - // TODO: test creatorFullName - } - - /** - * Test the property 'isWatching' - */ - @Test - public void isWatchingTest() { - // TODO: test isWatching - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/SettingFormulaModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/SettingFormulaModelTest.java deleted file mode 100644 index fb72fb2..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/SettingFormulaModelTest.java +++ /dev/null @@ -1,173 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for SettingFormulaModel - */ -public class SettingFormulaModelTest { - private final SettingFormulaModel model = new SettingFormulaModel(); - - /** - * Model tests for SettingFormulaModel - */ - @Test - public void testSettingFormulaModel() { - // TODO: test SettingFormulaModel - } - - /** - * Test the property 'lastVersionId' - */ - @Test - public void lastVersionIdTest() { - // TODO: test lastVersionId - } - - /** - * Test the property 'defaultValue' - */ - @Test - public void defaultValueTest() { - // TODO: test defaultValue - } - - /** - * Test the property 'targetingRules' - */ - @Test - public void targetingRulesTest() { - // TODO: test targetingRules - } - - /** - * Test the property 'setting' - */ - @Test - public void settingTest() { - // TODO: test setting - } - - /** - * Test the property 'updatedAt' - */ - @Test - public void updatedAtTest() { - // TODO: test updatedAt - } - - /** - * Test the property 'percentageEvaluationAttribute' - */ - @Test - public void percentageEvaluationAttributeTest() { - // TODO: test percentageEvaluationAttribute - } - - /** - * Test the property 'lastUpdaterUserEmail' - */ - @Test - public void lastUpdaterUserEmailTest() { - // TODO: test lastUpdaterUserEmail - } - - /** - * Test the property 'lastUpdaterUserFullName' - */ - @Test - public void lastUpdaterUserFullNameTest() { - // TODO: test lastUpdaterUserFullName - } - - /** - * Test the property 'integrationLinks' - */ - @Test - public void integrationLinksTest() { - // TODO: test integrationLinks - } - - /** - * Test the property 'settingTags' - */ - @Test - public void settingTagsTest() { - // TODO: test settingTags - } - - /** - * Test the property 'settingIdsWherePrerequisite' - */ - @Test - public void settingIdsWherePrerequisiteTest() { - // TODO: test settingIdsWherePrerequisite - } - - /** - * Test the property 'config' - */ - @Test - public void configTest() { - // TODO: test config - } - - /** - * Test the property 'environment' - */ - @Test - public void environmentTest() { - // TODO: test environment - } - - /** - * Test the property 'readOnly' - */ - @Test - public void readOnlyTest() { - // TODO: test readOnly - } - - /** - * Test the property 'featureFlagLimitations' - */ - @Test - public void featureFlagLimitationsTest() { - // TODO: test featureFlagLimitations - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/SettingModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/SettingModelTest.java deleted file mode 100644 index 0cca2a6..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/SettingModelTest.java +++ /dev/null @@ -1,117 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for SettingModel - */ -public class SettingModelTest { - private final SettingModel model = new SettingModel(); - - /** - * Model tests for SettingModel - */ - @Test - public void testSettingModel() { - // TODO: test SettingModel - } - - /** - * Test the property 'settingId' - */ - @Test - public void settingIdTest() { - // TODO: test settingId - } - - /** - * Test the property 'key' - */ - @Test - public void keyTest() { - // TODO: test key - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'hint' - */ - @Test - public void hintTest() { - // TODO: test hint - } - - /** - * Test the property 'order' - */ - @Test - public void orderTest() { - // TODO: test order - } - - /** - * Test the property 'settingType' - */ - @Test - public void settingTypeTest() { - // TODO: test settingType - } - - /** - * Test the property 'configId' - */ - @Test - public void configIdTest() { - // TODO: test configId - } - - /** - * Test the property 'configName' - */ - @Test - public void configNameTest() { - // TODO: test configName - } - - /** - * Test the property 'tags' - */ - @Test - public void tagsTest() { - // TODO: test tags - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/SettingTagModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/SettingTagModelTest.java deleted file mode 100644 index 66c1de7..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/SettingTagModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for SettingTagModel - */ -public class SettingTagModelTest { - private final SettingTagModel model = new SettingTagModel(); - - /** - * Model tests for SettingTagModel - */ - @Test - public void testSettingTagModel() { - // TODO: test SettingTagModel - } - - /** - * Test the property 'settingTagId' - */ - @Test - public void settingTagIdTest() { - // TODO: test settingTagId - } - - /** - * Test the property 'tagId' - */ - @Test - public void tagIdTest() { - // TODO: test tagId - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/SettingValueModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/SettingValueModelTest.java deleted file mode 100644 index 4d31d9f..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/SettingValueModelTest.java +++ /dev/null @@ -1,156 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for SettingValueModel - */ -public class SettingValueModelTest { - private final SettingValueModel model = new SettingValueModel(); - - /** - * Model tests for SettingValueModel - */ - @Test - public void testSettingValueModel() { - // TODO: test SettingValueModel - } - - /** - * Test the property 'rolloutRules' - */ - @Test - public void rolloutRulesTest() { - // TODO: test rolloutRules - } - - /** - * Test the property 'rolloutPercentageItems' - */ - @Test - public void rolloutPercentageItemsTest() { - // TODO: test rolloutPercentageItems - } - - /** - * Test the property 'value' - */ - @Test - public void valueTest() { - // TODO: test value - } - - /** - * Test the property 'setting' - */ - @Test - public void settingTest() { - // TODO: test setting - } - - /** - * Test the property 'updatedAt' - */ - @Test - public void updatedAtTest() { - // TODO: test updatedAt - } - - /** - * Test the property 'lastUpdaterUserEmail' - */ - @Test - public void lastUpdaterUserEmailTest() { - // TODO: test lastUpdaterUserEmail - } - - /** - * Test the property 'lastUpdaterUserFullName' - */ - @Test - public void lastUpdaterUserFullNameTest() { - // TODO: test lastUpdaterUserFullName - } - - /** - * Test the property 'integrationLinks' - */ - @Test - public void integrationLinksTest() { - // TODO: test integrationLinks - } - - /** - * Test the property 'settingTags' - */ - @Test - public void settingTagsTest() { - // TODO: test settingTags - } - - /** - * Test the property 'config' - */ - @Test - public void configTest() { - // TODO: test config - } - - /** - * Test the property 'environment' - */ - @Test - public void environmentTest() { - // TODO: test environment - } - - /** - * Test the property 'featureFlagLimitations' - */ - @Test - public void featureFlagLimitationsTest() { - // TODO: test featureFlagLimitations - } - - /** - * Test the property 'readOnly' - */ - @Test - public void readOnlyTest() { - // TODO: test readOnly - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/TagModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/TagModelTest.java deleted file mode 100644 index 09a1ca5..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/TagModelTest.java +++ /dev/null @@ -1,74 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for TagModel - */ -public class TagModelTest { - private final TagModel model = new TagModel(); - - /** - * Model tests for TagModel - */ - @Test - public void testTagModel() { - // TODO: test TagModel - } - - /** - * Test the property 'product' - */ - @Test - public void productTest() { - // TODO: test product - } - - /** - * Test the property 'tagId' - */ - @Test - public void tagIdTest() { - // TODO: test tagId - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/TargetingRuleModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/TargetingRuleModelTest.java deleted file mode 100644 index d5866a4..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/TargetingRuleModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for TargetingRuleModel - */ -public class TargetingRuleModelTest { - private final TargetingRuleModel model = new TargetingRuleModel(); - - /** - * Model tests for TargetingRuleModel - */ - @Test - public void testTargetingRuleModel() { - // TODO: test TargetingRuleModel - } - - /** - * Test the property 'conditions' - */ - @Test - public void conditionsTest() { - // TODO: test conditions - } - - /** - * Test the property 'percentageOptions' - */ - @Test - public void percentageOptionsTest() { - // TODO: test percentageOptions - } - - /** - * Test the property 'value' - */ - @Test - public void valueTest() { - // TODO: test value - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/UpdateConfigRequestTest.java b/src/test/java/com/configcat/publicapi/java/client/model/UpdateConfigRequestTest.java deleted file mode 100644 index 7e36e2e..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/UpdateConfigRequestTest.java +++ /dev/null @@ -1,65 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for UpdateConfigRequest - */ -public class UpdateConfigRequestTest { - private final UpdateConfigRequest model = new UpdateConfigRequest(); - - /** - * Model tests for UpdateConfigRequest - */ - @Test - public void testUpdateConfigRequest() { - // TODO: test UpdateConfigRequest - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'description' - */ - @Test - public void descriptionTest() { - // TODO: test description - } - - /** - * Test the property 'order' - */ - @Test - public void orderTest() { - // TODO: test order - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/UpdateEnvironmentModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/UpdateEnvironmentModelTest.java deleted file mode 100644 index 069ba55..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/UpdateEnvironmentModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for UpdateEnvironmentModel - */ -public class UpdateEnvironmentModelTest { - private final UpdateEnvironmentModel model = new UpdateEnvironmentModel(); - - /** - * Model tests for UpdateEnvironmentModel - */ - @Test - public void testUpdateEnvironmentModel() { - // TODO: test UpdateEnvironmentModel - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - - /** - * Test the property 'description' - */ - @Test - public void descriptionTest() { - // TODO: test description - } - - /** - * Test the property 'order' - */ - @Test - public void orderTest() { - // TODO: test order - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaModelTest.java deleted file mode 100644 index 4cefc11..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaModelTest.java +++ /dev/null @@ -1,69 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for UpdateEvaluationFormulaModel - */ -public class UpdateEvaluationFormulaModelTest { - private final UpdateEvaluationFormulaModel model = new UpdateEvaluationFormulaModel(); - - /** - * Model tests for UpdateEvaluationFormulaModel - */ - @Test - public void testUpdateEvaluationFormulaModel() { - // TODO: test UpdateEvaluationFormulaModel - } - - /** - * Test the property 'defaultValue' - */ - @Test - public void defaultValueTest() { - // TODO: test defaultValue - } - - /** - * Test the property 'targetingRules' - */ - @Test - public void targetingRulesTest() { - // TODO: test targetingRules - } - - /** - * Test the property 'percentageEvaluationAttribute' - */ - @Test - public void percentageEvaluationAttributeTest() { - // TODO: test percentageEvaluationAttribute - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaWithIdModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaWithIdModelTest.java deleted file mode 100644 index 83e4506..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulaWithIdModelTest.java +++ /dev/null @@ -1,77 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for UpdateEvaluationFormulaWithIdModel - */ -public class UpdateEvaluationFormulaWithIdModelTest { - private final UpdateEvaluationFormulaWithIdModel model = new UpdateEvaluationFormulaWithIdModel(); - - /** - * Model tests for UpdateEvaluationFormulaWithIdModel - */ - @Test - public void testUpdateEvaluationFormulaWithIdModel() { - // TODO: test UpdateEvaluationFormulaWithIdModel - } - - /** - * Test the property 'defaultValue' - */ - @Test - public void defaultValueTest() { - // TODO: test defaultValue - } - - /** - * Test the property 'targetingRules' - */ - @Test - public void targetingRulesTest() { - // TODO: test targetingRules - } - - /** - * Test the property 'percentageEvaluationAttribute' - */ - @Test - public void percentageEvaluationAttributeTest() { - // TODO: test percentageEvaluationAttribute - } - - /** - * Test the property 'settingId' - */ - @Test - public void settingIdTest() { - // TODO: test settingId - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulasModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulasModelTest.java deleted file mode 100644 index b88482f..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/UpdateEvaluationFormulasModelTest.java +++ /dev/null @@ -1,52 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for UpdateEvaluationFormulasModel - */ -public class UpdateEvaluationFormulasModelTest { - private final UpdateEvaluationFormulasModel model = new UpdateEvaluationFormulasModel(); - - /** - * Model tests for UpdateEvaluationFormulasModel - */ - @Test - public void testUpdateEvaluationFormulasModel() { - // TODO: test UpdateEvaluationFormulasModel - } - - /** - * Test the property 'updateFormulas' - */ - @Test - public void updateFormulasTest() { - // TODO: test updateFormulas - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/UpdateMemberPermissionsRequestTest.java b/src/test/java/com/configcat/publicapi/java/client/model/UpdateMemberPermissionsRequestTest.java deleted file mode 100644 index f825759..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/UpdateMemberPermissionsRequestTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for UpdateMemberPermissionsRequest - */ -public class UpdateMemberPermissionsRequestTest { - private final UpdateMemberPermissionsRequest model = new UpdateMemberPermissionsRequest(); - - /** - * Model tests for UpdateMemberPermissionsRequest - */ - @Test - public void testUpdateMemberPermissionsRequest() { - // TODO: test UpdateMemberPermissionsRequest - } - - /** - * Test the property 'permissionGroupIds' - */ - @Test - public void permissionGroupIdsTest() { - // TODO: test permissionGroupIds - } - - /** - * Test the property 'isAdmin' - */ - @Test - public void isAdminTest() { - // TODO: test isAdmin - } - - /** - * Test the property 'isBillingManager' - */ - @Test - public void isBillingManagerTest() { - // TODO: test isBillingManager - } - - /** - * Test the property 'removeFromPermissionGroupsWhereIdNotSet' - */ - @Test - public void removeFromPermissionGroupsWhereIdNotSetTest() { - // TODO: test removeFromPermissionGroupsWhereIdNotSet - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/UpdatePermissionGroupRequestTest.java b/src/test/java/com/configcat/publicapi/java/client/model/UpdatePermissionGroupRequestTest.java deleted file mode 100644 index 8298ffc..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/UpdatePermissionGroupRequestTest.java +++ /dev/null @@ -1,236 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.model.CreateOrUpdateEnvironmentAccessModel; -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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for UpdatePermissionGroupRequest - */ -public class UpdatePermissionGroupRequestTest { - private final UpdatePermissionGroupRequest model = new UpdatePermissionGroupRequest(); - - /** - * Model tests for UpdatePermissionGroupRequest - */ - @Test - public void testUpdatePermissionGroupRequest() { - // TODO: test UpdatePermissionGroupRequest - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'canManageMembers' - */ - @Test - public void canManageMembersTest() { - // TODO: test canManageMembers - } - - /** - * Test the property 'canCreateOrUpdateConfig' - */ - @Test - public void canCreateOrUpdateConfigTest() { - // TODO: test canCreateOrUpdateConfig - } - - /** - * Test the property 'canDeleteConfig' - */ - @Test - public void canDeleteConfigTest() { - // TODO: test canDeleteConfig - } - - /** - * Test the property 'canCreateOrUpdateEnvironment' - */ - @Test - public void canCreateOrUpdateEnvironmentTest() { - // TODO: test canCreateOrUpdateEnvironment - } - - /** - * Test the property 'canDeleteEnvironment' - */ - @Test - public void canDeleteEnvironmentTest() { - // TODO: test canDeleteEnvironment - } - - /** - * Test the property 'canCreateOrUpdateSetting' - */ - @Test - public void canCreateOrUpdateSettingTest() { - // TODO: test canCreateOrUpdateSetting - } - - /** - * Test the property 'canTagSetting' - */ - @Test - public void canTagSettingTest() { - // TODO: test canTagSetting - } - - /** - * Test the property 'canDeleteSetting' - */ - @Test - public void canDeleteSettingTest() { - // TODO: test canDeleteSetting - } - - /** - * Test the property 'canCreateOrUpdateTag' - */ - @Test - public void canCreateOrUpdateTagTest() { - // TODO: test canCreateOrUpdateTag - } - - /** - * Test the property 'canDeleteTag' - */ - @Test - public void canDeleteTagTest() { - // TODO: test canDeleteTag - } - - /** - * Test the property 'canManageWebhook' - */ - @Test - public void canManageWebhookTest() { - // TODO: test canManageWebhook - } - - /** - * Test the property 'canUseExportImport' - */ - @Test - public void canUseExportImportTest() { - // TODO: test canUseExportImport - } - - /** - * Test the property 'canManageProductPreferences' - */ - @Test - public void canManageProductPreferencesTest() { - // TODO: test canManageProductPreferences - } - - /** - * Test the property 'canManageIntegrations' - */ - @Test - public void canManageIntegrationsTest() { - // TODO: test canManageIntegrations - } - - /** - * Test the property 'canViewSdkKey' - */ - @Test - public void canViewSdkKeyTest() { - // TODO: test canViewSdkKey - } - - /** - * Test the property 'canRotateSdkKey' - */ - @Test - public void canRotateSdkKeyTest() { - // TODO: test canRotateSdkKey - } - - /** - * Test the property 'canCreateOrUpdateSegments' - */ - @Test - public void canCreateOrUpdateSegmentsTest() { - // TODO: test canCreateOrUpdateSegments - } - - /** - * Test the property 'canDeleteSegments' - */ - @Test - public void canDeleteSegmentsTest() { - // TODO: test canDeleteSegments - } - - /** - * Test the property 'canViewProductAuditLog' - */ - @Test - public void canViewProductAuditLogTest() { - // TODO: test canViewProductAuditLog - } - - /** - * Test the property 'canViewProductStatistics' - */ - @Test - public void canViewProductStatisticsTest() { - // TODO: test canViewProductStatistics - } - - /** - * Test the property 'accessType' - */ - @Test - public void accessTypeTest() { - // TODO: test accessType - } - - /** - * Test the property 'newEnvironmentAccessType' - */ - @Test - public void newEnvironmentAccessTypeTest() { - // TODO: test newEnvironmentAccessType - } - - /** - * Test the property 'environmentAccesses' - */ - @Test - public void environmentAccessesTest() { - // TODO: test environmentAccesses - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/UpdatePreferencesRequestTest.java b/src/test/java/com/configcat/publicapi/java/client/model/UpdatePreferencesRequestTest.java deleted file mode 100644 index 3abae42..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/UpdatePreferencesRequestTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for UpdatePreferencesRequest - */ -public class UpdatePreferencesRequestTest { - private final UpdatePreferencesRequest model = new UpdatePreferencesRequest(); - - /** - * Model tests for UpdatePreferencesRequest - */ - @Test - public void testUpdatePreferencesRequest() { - // TODO: test UpdatePreferencesRequest - } - - /** - * Test the property 'reasonRequired' - */ - @Test - public void reasonRequiredTest() { - // TODO: test reasonRequired - } - - /** - * Test the property 'keyGenerationMode' - */ - @Test - public void keyGenerationModeTest() { - // TODO: test keyGenerationMode - } - - /** - * Test the property 'showVariationId' - */ - @Test - public void showVariationIdTest() { - // TODO: test showVariationId - } - - /** - * Test the property 'mandatorySettingHint' - */ - @Test - public void mandatorySettingHintTest() { - // TODO: test mandatorySettingHint - } - - /** - * Test the property 'reasonRequiredEnvironments' - */ - @Test - public void reasonRequiredEnvironmentsTest() { - // TODO: test reasonRequiredEnvironments - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/UpdateProductRequestTest.java b/src/test/java/com/configcat/publicapi/java/client/model/UpdateProductRequestTest.java deleted file mode 100644 index b34a661..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/UpdateProductRequestTest.java +++ /dev/null @@ -1,65 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for UpdateProductRequest - */ -public class UpdateProductRequestTest { - private final UpdateProductRequest model = new UpdateProductRequest(); - - /** - * Model tests for UpdateProductRequest - */ - @Test - public void testUpdateProductRequest() { - // TODO: test UpdateProductRequest - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'description' - */ - @Test - public void descriptionTest() { - // TODO: test description - } - - /** - * Test the property 'order' - */ - @Test - public void orderTest() { - // TODO: test order - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/UpdateReasonRequiredEnvironmentModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/UpdateReasonRequiredEnvironmentModelTest.java deleted file mode 100644 index 4d646ef..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/UpdateReasonRequiredEnvironmentModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for UpdateReasonRequiredEnvironmentModel - */ -public class UpdateReasonRequiredEnvironmentModelTest { - private final UpdateReasonRequiredEnvironmentModel model = new UpdateReasonRequiredEnvironmentModel(); - - /** - * Model tests for UpdateReasonRequiredEnvironmentModel - */ - @Test - public void testUpdateReasonRequiredEnvironmentModel() { - // TODO: test UpdateReasonRequiredEnvironmentModel - } - - /** - * Test the property 'environmentId' - */ - @Test - public void environmentIdTest() { - // TODO: test environmentId - } - - /** - * Test the property 'reasonRequired' - */ - @Test - public void reasonRequiredTest() { - // TODO: test reasonRequired - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/UpdateSegmentModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/UpdateSegmentModelTest.java deleted file mode 100644 index 77c646a..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/UpdateSegmentModelTest.java +++ /dev/null @@ -1,81 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for UpdateSegmentModel - */ -public class UpdateSegmentModelTest { - private final UpdateSegmentModel model = new UpdateSegmentModel(); - - /** - * Model tests for UpdateSegmentModel - */ - @Test - public void testUpdateSegmentModel() { - // TODO: test UpdateSegmentModel - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'description' - */ - @Test - public void descriptionTest() { - // TODO: test description - } - - /** - * Test the property 'comparisonAttribute' - */ - @Test - public void comparisonAttributeTest() { - // TODO: test comparisonAttribute - } - - /** - * Test the property 'comparator' - */ - @Test - public void comparatorTest() { - // TODO: test comparator - } - - /** - * Test the property 'comparisonValue' - */ - @Test - public void comparisonValueTest() { - // TODO: test comparisonValue - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/UpdateSettingValueModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/UpdateSettingValueModelTest.java deleted file mode 100644 index fbc7ab9..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/UpdateSettingValueModelTest.java +++ /dev/null @@ -1,69 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for UpdateSettingValueModel - */ -public class UpdateSettingValueModelTest { - private final UpdateSettingValueModel model = new UpdateSettingValueModel(); - - /** - * Model tests for UpdateSettingValueModel - */ - @Test - public void testUpdateSettingValueModel() { - // TODO: test UpdateSettingValueModel - } - - /** - * Test the property 'rolloutRules' - */ - @Test - public void rolloutRulesTest() { - // TODO: test rolloutRules - } - - /** - * Test the property 'rolloutPercentageItems' - */ - @Test - public void rolloutPercentageItemsTest() { - // TODO: test rolloutPercentageItems - } - - /** - * Test the property 'value' - */ - @Test - public void valueTest() { - // TODO: test value - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/UpdateSettingValueWithSettingIdModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/UpdateSettingValueWithSettingIdModelTest.java deleted file mode 100644 index 19a70ee..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/UpdateSettingValueWithSettingIdModelTest.java +++ /dev/null @@ -1,77 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for UpdateSettingValueWithSettingIdModel - */ -public class UpdateSettingValueWithSettingIdModelTest { - private final UpdateSettingValueWithSettingIdModel model = new UpdateSettingValueWithSettingIdModel(); - - /** - * Model tests for UpdateSettingValueWithSettingIdModel - */ - @Test - public void testUpdateSettingValueWithSettingIdModel() { - // TODO: test UpdateSettingValueWithSettingIdModel - } - - /** - * Test the property 'rolloutRules' - */ - @Test - public void rolloutRulesTest() { - // TODO: test rolloutRules - } - - /** - * Test the property 'rolloutPercentageItems' - */ - @Test - public void rolloutPercentageItemsTest() { - // TODO: test rolloutPercentageItems - } - - /** - * Test the property 'value' - */ - @Test - public void valueTest() { - // TODO: test value - } - - /** - * Test the property 'settingId' - */ - @Test - public void settingIdTest() { - // TODO: test settingId - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/UpdateSettingValuesWithIdModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/UpdateSettingValuesWithIdModelTest.java deleted file mode 100644 index fa7aa74..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/UpdateSettingValuesWithIdModelTest.java +++ /dev/null @@ -1,52 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for UpdateSettingValuesWithIdModel - */ -public class UpdateSettingValuesWithIdModelTest { - private final UpdateSettingValuesWithIdModel model = new UpdateSettingValuesWithIdModel(); - - /** - * Model tests for UpdateSettingValuesWithIdModel - */ - @Test - public void testUpdateSettingValuesWithIdModel() { - // TODO: test UpdateSettingValuesWithIdModel - } - - /** - * Test the property 'settingValues' - */ - @Test - public void settingValuesTest() { - // TODO: test settingValues - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/UpdateTagModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/UpdateTagModelTest.java deleted file mode 100644 index e79a170..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/UpdateTagModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for UpdateTagModel - */ -public class UpdateTagModelTest { - private final UpdateTagModel model = new UpdateTagModel(); - - /** - * Model tests for UpdateTagModel - */ - @Test - public void testUpdateTagModel() { - // TODO: test UpdateTagModel - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/UserConditionModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/UserConditionModelTest.java deleted file mode 100644 index 1cf96bd..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/UserConditionModelTest.java +++ /dev/null @@ -1,65 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.model.ComparisonValueModel; -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.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for UserConditionModel - */ -public class UserConditionModelTest { - private final UserConditionModel model = new UserConditionModel(); - - /** - * Model tests for UserConditionModel - */ - @Test - public void testUserConditionModel() { - // TODO: test UserConditionModel - } - - /** - * Test the property 'comparisonAttribute' - */ - @Test - public void comparisonAttributeTest() { - // TODO: test comparisonAttribute - } - - /** - * Test the property 'comparator' - */ - @Test - public void comparatorTest() { - // TODO: test comparator - } - - /** - * Test the property 'comparisonValue' - */ - @Test - public void comparisonValueTest() { - // TODO: test comparisonValue - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/UserModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/UserModelTest.java deleted file mode 100644 index 5472a8d..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/UserModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for UserModel - */ -public class UserModelTest { - private final UserModel model = new UserModel(); - - /** - * Model tests for UserModel - */ - @Test - public void testUserModel() { - // TODO: test UserModel - } - - /** - * Test the property 'userId' - */ - @Test - public void userIdTest() { - // TODO: test userId - } - - /** - * Test the property 'fullName' - */ - @Test - public void fullNameTest() { - // TODO: test fullName - } - - /** - * Test the property 'email' - */ - @Test - public void emailTest() { - // TODO: test email - } - - /** - * Test the property 'twoFactorEnabled' - */ - @Test - public void twoFactorEnabledTest() { - // TODO: test twoFactorEnabled - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/ValueModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/ValueModelTest.java deleted file mode 100644 index 74de93d..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/ValueModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for ValueModel - */ -public class ValueModelTest { - private final ValueModel model = new ValueModel(); - - /** - * Model tests for ValueModel - */ - @Test - public void testValueModel() { - // TODO: test ValueModel - } - - /** - * Test the property 'boolValue' - */ - @Test - public void boolValueTest() { - // TODO: test boolValue - } - - /** - * Test the property 'stringValue' - */ - @Test - public void stringValueTest() { - // TODO: test stringValue - } - - /** - * Test the property 'intValue' - */ - @Test - public void intValueTest() { - // TODO: test intValue - } - - /** - * Test the property 'doubleValue' - */ - @Test - public void doubleValueTest() { - // TODO: test doubleValue - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/WebHookRequestTest.java b/src/test/java/com/configcat/publicapi/java/client/model/WebHookRequestTest.java deleted file mode 100644 index eb0bb0e..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/WebHookRequestTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for WebHookRequest - */ -public class WebHookRequestTest { - private final WebHookRequest model = new WebHookRequest(); - - /** - * Model tests for WebHookRequest - */ - @Test - public void testWebHookRequest() { - // TODO: test WebHookRequest - } - - /** - * Test the property 'url' - */ - @Test - public void urlTest() { - // TODO: test url - } - - /** - * Test the property 'content' - */ - @Test - public void contentTest() { - // TODO: test content - } - - /** - * Test the property 'httpMethod' - */ - @Test - public void httpMethodTest() { - // TODO: test httpMethod - } - - /** - * Test the property 'webHookHeaders' - */ - @Test - public void webHookHeadersTest() { - // TODO: test webHookHeaders - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/WebhookConfigTest.java b/src/test/java/com/configcat/publicapi/java/client/model/WebhookConfigTest.java deleted file mode 100644 index e243187..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/WebhookConfigTest.java +++ /dev/null @@ -1,58 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for WebhookConfig - */ -public class WebhookConfigTest { - private final WebhookConfig model = new WebhookConfig(); - - /** - * Model tests for WebhookConfig - */ - @Test - public void testWebhookConfig() { - // TODO: test WebhookConfig - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'configId' - */ - @Test - public void configIdTest() { - // TODO: test configId - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/WebhookEnvironmentTest.java b/src/test/java/com/configcat/publicapi/java/client/model/WebhookEnvironmentTest.java deleted file mode 100644 index 2da844d..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/WebhookEnvironmentTest.java +++ /dev/null @@ -1,58 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for WebhookEnvironment - */ -public class WebhookEnvironmentTest { - private final WebhookEnvironment model = new WebhookEnvironment(); - - /** - * Model tests for WebhookEnvironment - */ - @Test - public void testWebhookEnvironment() { - // TODO: test WebhookEnvironment - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'environmentId' - */ - @Test - public void environmentIdTest() { - // TODO: test environmentId - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/WebhookHeaderModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/WebhookHeaderModelTest.java deleted file mode 100644 index 7932468..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/WebhookHeaderModelTest.java +++ /dev/null @@ -1,64 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for WebhookHeaderModel - */ -public class WebhookHeaderModelTest { - private final WebhookHeaderModel model = new WebhookHeaderModel(); - - /** - * Model tests for WebhookHeaderModel - */ - @Test - public void testWebhookHeaderModel() { - // TODO: test WebhookHeaderModel - } - - /** - * Test the property 'key' - */ - @Test - public void keyTest() { - // TODO: test key - } - - /** - * Test the property 'value' - */ - @Test - public void valueTest() { - // TODO: test value - } - - /** - * Test the property 'isSecure' - */ - @Test - public void isSecureTest() { - // TODO: test isSecure - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/WebhookModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/WebhookModelTest.java deleted file mode 100644 index 77731be..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/WebhookModelTest.java +++ /dev/null @@ -1,102 +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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for WebhookModel - */ -public class WebhookModelTest { - private final WebhookModel model = new WebhookModel(); - - /** - * Model tests for WebhookModel - */ - @Test - public void testWebhookModel() { - // TODO: test WebhookModel - } - - /** - * Test the property 'webhookId' - */ - @Test - public void webhookIdTest() { - // TODO: test webhookId - } - - /** - * Test the property 'url' - */ - @Test - public void urlTest() { - // TODO: test url - } - - /** - * Test the property 'httpMethod' - */ - @Test - public void httpMethodTest() { - // TODO: test httpMethod - } - - /** - * Test the property 'content' - */ - @Test - public void contentTest() { - // TODO: test content - } - - /** - * Test the property 'webHookHeaders' - */ - @Test - public void webHookHeadersTest() { - // TODO: test webHookHeaders - } - - /** - * Test the property 'config' - */ - @Test - public void configTest() { - // TODO: test config - } - - /** - * Test the property 'environment' - */ - @Test - public void environmentTest() { - // TODO: test environment - } - -} diff --git a/src/test/java/com/configcat/publicapi/java/client/model/WebhookSigningKeysModelTest.java b/src/test/java/com/configcat/publicapi/java/client/model/WebhookSigningKeysModelTest.java deleted file mode 100644 index 7b4cbd8..0000000 --- a/src/test/java/com/configcat/publicapi/java/client/model/WebhookSigningKeysModelTest.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://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://test-api.configcat.com/swagger). The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format. **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead. # OpenAPI Specification The complete specification is publicly available in the following formats: - [OpenAPI v3](https://test-api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://test-api.configcat.com/docs/v1/swagger.v2.json) You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header. - * - * The version of the OpenAPI document: v1 - * Contact: support@configcat.com - * - * NOTE: This class is auto 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.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 org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Model tests for WebhookSigningKeysModel - */ -public class WebhookSigningKeysModelTest { - private final WebhookSigningKeysModel model = new WebhookSigningKeysModel(); - - /** - * Model tests for WebhookSigningKeysModel - */ - @Test - public void testWebhookSigningKeysModel() { - // TODO: test WebhookSigningKeysModel - } - - /** - * Test the property 'key1' - */ - @Test - public void key1Test() { - // TODO: test key1 - } - - /** - * Test the property 'key2' - */ - @Test - public void key2Test() { - // TODO: test key2 - } - -}